//called from Login view and authenticate user create session and if user not verified redirect to verifyemail view througn ajax promise public ActionResult LoginAuth(LoginCredentials lc) { using (JamiaRDBEntities db = new JamiaRDBEntities()) { var user = db.tbl_user.SingleOrDefault(x => (x.userName == lc.userName) && (x.userPassword == lc.userPassword)); if (user == null) { user = db.tbl_user.SingleOrDefault(x => (x.userCellNumber == lc.userName) && (x.userPassword == lc.userPassword)); } if (user == null) { user = db.tbl_user.SingleOrDefault(x => (x.userDisplayName == lc.userName) && (x.userPassword == lc.userPassword)); } if (user != null) { if (lc.is_remember == true) { if (user.userToken == null) { var token = Guid.NewGuid().ToString(); user.userToken = token; db.SaveChanges(); } RememberChecked(user.userDisplayName, user.userToken); } Session["UserID"] = user.userID; Session["UserName"] = user.userDisplayName; Session["UserRole"] = user.userRole; return(Json("success")); } return(Json("failed")); } }
public BatchController() { this.db = new JamiaRDBEntities(); }
public CampusController() { this.db = new JamiaRDBEntities(); }
public CourseController() { this.db = new JamiaRDBEntities(); }
// GET: Files public FilesController() { this.db = new JamiaRDBEntities(); }
public UserController() { db = new JamiaRDBEntities(); }
public StudentController() { this.db = new JamiaRDBEntities(); }