예제 #1
0
        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"));
        }
예제 #2
0
        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);
        }