public static MasterUser StaticUserId(int userid = 0, string username = "") { MasterUser objMasterUser = new MasterUser(); if (userid != 0) { objMasterUser = new UsersDAL().GetUsers().Where(x => x.UserID == userid).FirstOrDefault(); } else if (username != "") { objMasterUser = new UsersDAL().GetUsers().Where(x => x.UserName == username).FirstOrDefault(); } return(objMasterUser); }
public ActionResult Index(UserModel model) { if (ModelState.IsValid) { UsersDAL u = new UsersDAL(); UserDTO dto1 = new UserDTO(); UserDTO dto2 = new UserDTO(); dto1 = u.GetUserByLogin(model.login); dto2 = u.GetUserByPassword(model.password); if ((dto1 != null) && (dto2 != null)) { if (dto1.id_user == dto2.id_user) { //FormsAuthentication.SetAuthCookie(model.login,false); return RedirectToAction("Index","MagorPage"); } else ModelState.AddModelError("", "Invalid login or password"); } else { ModelState.AddModelError("", "Invalid login or password"); } } return View(); }
public int Update_UsersBAL(User u) { UsersDAL usersdal = new UsersDAL(); return usersdal.Update_UsersDAL(u); }
public int Delete_UsersBAL(string username) { UsersDAL usersdal = new UsersDAL(); return usersdal.Delete_UsersDAL(username); }
public int Add_UsersBAL(User u) { UsersDAL usersdal = new UsersDAL(); return usersdal.Add_UsersDAL(u); }