if("1".equals(request.getParameter("isView")))
{
parentUserId=Integer.parseInt(request.getParameter("parentUserId"));
}
String orgNum=UtilDAO.getOrgNum();
new TbUsersDAO().add(new TbUsers(userName,userPass,userPhone,userEmail,userAddress,userBirthday,userState,roleId,parentUserId,((TbUsers)request.getSession().getAttribute("User")).getUserId(),orgNum));
response.sendRedirect("UserModule/UsersList.jsp");
}//end method add
if ("edit".equals(method)) {
int userId=Integer.parseInt(request.getParameter("userId"));
String userName=request.getParameter("userName");
String userPass=request.getParameter("userPass");
String userPhone=request.getParameter("userPhone");
String userEmail=request.getParameter("userEmail");
String userAddress=request.getParameter("userAddress");
String userBirthday=request.getParameter("userBirthday");
int roleId=Integer.parseInt(request.getParameter("roleId"));
int userState=Integer.parseInt(request.getParameter("userState"));
int parentUserId=-1;
if("1".equals(request.getParameter("isView")))
{
parentUserId=Integer.parseInt(request.getParameter("parentUserId"));
}
new TbUsersDAO().edit(new TbUsers(userId,userName,userPass,userPhone,userEmail,userAddress,userBirthday,userState,roleId,parentUserId));
response.sendRedirect("UserModule/UsersList.jsp");
}
if("login".equals(method)){
isLogin=true;
String userName=request.getParameter("userName");
String userPass=request.getParameter("userPass");
TbUsers tu=new TbUsersDAO().checkLogin(userName, userPass);
if(tu!=null){
flag=true;
HttpSession session = request.getSession();
session.setAttribute("User",tu);
response.sendRedirect("index.jsp");