public ActionResult Inquiry(int Id) { if (sessiondto.getName() == null) { return(RedirectToAction("Login", "Auth", new { Id = StringCipher.Base64Encode("0"), err = "" })); } else if (sessiondto.getRole() == 1 || sessiondto.getRole() == 2) { return(RedirectToAction("Index", "Account")); } else { ViewBag.user = new UserBL().getUserById(Id); ViewBag.phone = new UserBL().getUserById(sessiondto.getId()).Phone; ViewBag.email = new UserBL().getUserById(sessiondto.getId()).Email; return(View()); } }
public ActionResult PostLogin(string Id, string Email, string Password) { List <User> Users = new UserBL().getUserList().Where(x => x.Is_Authorize == 1).ToList(); foreach (User User in Users) { if (User.Email == Email && User.Password == Password) { SessionDTO session = new SessionDTO(); session.Name = User.Name; session.Id = User.Id; session.Role = User.Role; Session["Session"] = session; SessionDTO sdto = (SessionDTO)Session["Session"]; return(RedirectToAction("Index", "Home")); } } return(RedirectToAction("Login", "Auth", new { Id = StringCipher.Base64Encode(Id), err = "Incorrect Email or Password" })); }