示例#1
0
        public bool FindEmail(string email, string password)
        {
            var result = this.userContext.StoreAccount.Where(opt => opt.Email == email).SingleOrDefault();

            if (result != null)
            {
                var encrptpassword = PasswordEncryption.EncodePasswordMd5(password);
                var res            = this.userContext.StoreAccount.Where(opt => opt.Email == email && opt.Password == encrptpassword).SingleOrDefault();
                if (res != null)
                {
                    return(true);
                }
            }
            return(false);
        }
示例#2
0
        public async Task <int> StoreRegistration(BookRegistrationModel bookRegistrationModel)
        {
            BookRegistrationModel bookcred = new BookRegistrationModel()
            {
                Id        = bookRegistrationModel.Id,
                FirstName = bookRegistrationModel.FirstName,
                LastName  = bookRegistrationModel.LastName,
                Email     = bookRegistrationModel.Email,
                Password  = bookRegistrationModel.Password,
            };
            var password = PasswordEncryption.EncodePasswordMd5(bookRegistrationModel.Password);

            bookcred.Password = password;
            var registeruser = this.userContext.StoreAccount.Add(bookcred);
            var result       = this.userContext.SaveChanges();
            var rest         = await Task.Run(() => result);

            return(rest);
        }