public ActionResult Registration(LoginInfo loginModel) { loginModel.Password = RegistrationModel.Encryptdata(loginModel.Password); TestDBEntities db = new TestDBEntities(); // loginModel.LastLoginDate.Value = System.DateTime.Now(); db.LoginInfoes.Add(loginModel); db.SaveChanges(); return(View("Index")); }
public bool IsUserExist(string UserName, string password) { TestDBEntities db = new TestDBEntities(); bool isExists = false; password = RegistrationModel.Encryptdata(password); isExists = db.LoginInfoes.Any(x => (x.UserName == UserName) && x.Password == password); return(isExists); }