コード例 #1
0
        public void AddCoockiesForLogin(string username, string password)
        {
            HttpCookie cookie = new HttpCookie("UserInformation");

            cookie.Values["username"] = _cript.EncryptData(username);
            cookie.Values["password"] = _cript.EncryptData(password);
            cookie.Expires            = DateTime.Now.AddDays(30);
            HttpContext.Current.Response.Cookies.Add(cookie);
        }
コード例 #2
0
        private User AddUserInDB(User user, RegistrationVM model)
        {
            EncriptServises _encript = new EncriptServises();

            user.Name       = _encript.EncryptData(model.FirstName);
            user.SecondName = _encript.EncryptData(model.SecondName);
            user.City       = _encript.EncryptData(model.City);
            user.Adress     = _encript.EncryptData(model.Adress);
            user.Telephone  = _encript.EncryptData(model.Telephone);
            return(user);
        }
コード例 #3
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"));
        }
コード例 #4
0
        public IActionResult ChangeDetails(UserEditVm model, IFormFile[] photo)
        {
            User entity = new User();

            entity.ID         = UserID;
            entity.Name       = _encript.EncryptData(model.FirstName);
            entity.SecondName = _encript.EncryptData(model.SecondName);
            entity.City       = _encript.EncryptData(model.City);
            entity.Adress     = _encript.EncryptData(model.Adress);
            entity.Telephone  = _encript.EncryptData(model.Telephone);
            entity.Image      = GetImagePath(photo);
            entity.LoginID    = loginID;
            Addimage(photo);

            _servise.Save(entity);

            return(RedirectToAction("Details"));
        }