public ActionResult Index(UserProfile objUser) { if (ModelState.IsValid) { var obj = new UserLoginDAO().GetUserProfile(objUser.Username, objUser.Password); if (obj != null) { Session["UserProfile"] = obj as UserProfileVM; Session.Timeout = 525600; return(RedirectToAction("Index", "Home")); } } return(View(objUser)); }
public ActionResult Index(UserProfile objUser) { if (ModelState.IsValid) { var obj = new UserLoginDAO().GetUserProfile(objUser.Username, objUser.Password); if (obj != null) { Session["UserID"] = obj.ID.ToInt(); Session["UserName"] = obj.Username.ToSafetyString(); Session["FullName"] = obj.FullName.ToSafetyString(); Session["Role"] = obj.Role.ToInt(); Session.Timeout = 525600; return(RedirectToAction("Index", "Home")); } } return(View(objUser)); }
public BaseResponse <UserLogin> Login(UserLogin obj) { UserLoginDAO dao = new UserLoginDAO(); LoginStatus result = dao.Login(obj); UserLogin user = null; if (result == LoginStatus.Success) { user = dao.GetLogin(obj.Name); } var list = new List <UserLogin>(); list.Add(user); BaseResponse <UserLogin> response = new BaseResponse <UserLogin>(StatusResponse.Success, result + "", list); return(response); }
public UserLoginBUS() { ulDao = new UserLoginDAO(); }