コード例 #1
0
        public JsonResult ChangePassword(string password)
        {
            Login        user   = new Login();
            LoginServise _login = new LoginServise();

            user          = _login.GetByID(id);
            user.Password = _encript.EncryptData(password);
            _login.Save(user);

            return(Json("ok"));
        }
コード例 #2
0
        public JsonResult ChangeEmail(string email)
        {
            Login        user   = new Login();
            LoginServise _login = new LoginServise();

            user       = _login.GetByID(id);
            user.Email = _encript.EncryptData(email);
            _login.Save(user);

            return(Json("ok"));
        }
コード例 #3
0
        private string EnterLoginInformation(RegistrationVM reg)
        {
            Login   login   = new Login();
            LoginVM loginVm = new LoginVM();

            login.Email = _encript.EncryptData(reg.Email);
            if (reg.Password == reg.ConfirmPassword)
            {
                login.Password = _encript.EncryptData(reg.Password);

                if (!_servise.CheckForAdmin())
                {
                    login.isRegisted = true;
                    login.Role       = 1;
                    _servise.Save(login);

                    loginVm.Email    = reg.Email;
                    loginVm.Password = reg.Password;
                    CreateCookie(loginVm);
                }
                else
                {
                    login.isRegisted = false;
                    login.Role       = 2;
                    _servise.Save(login);

                    login = new Login();
                    login = _servise.GetLastElement();
                    EmailServises _email = new EmailServises(login);
                    _email.SendEmail(1);
                }
            }
            else
            {
                return("Password no match");
            }

            return("OK");
        }