public IActionResult OnPost(string username)
        {
            var confirmdelete = deleteUser.Delete(username);

            deleteUser.Commit();
            return(RedirectToPage("./UsersList"));
        }
예제 #2
0
 public IActionResult OnPost(string userId)
 {
     DeletedUser = userData.Delete(userId);
     userData.Commit();
     if (DeletedUser == null)
     {
         return(RedirectToPage("../NotFound"));
     }
     return(RedirectToPage("../UsersList"));
 }
예제 #3
0
 public void OnPost()
 {
     dbUserData.Delete(UserId);
     deleteCode = dbUserData.Commit();
     if (deleteCode == 1)
     {
         RedirectToPage("Users");
     }
     else
     {
         DeleteSuccess = false;
     }
 }
        public IActionResult OnPost(int userId)
        {
            var user = _data.Delete(userId);

            _data.Commit();
            if (user == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            TempData["Message"] = $"{user.FirstName} {user.LastName} deleted";
            return(RedirectToPage("./List"));
        }
예제 #5
0
        public IActionResult Edit(string id, RegisterUserModel register)
        {
            var model = _userData.Get(id);

            // var usrid = model;
            if (ModelState.IsValid)
            {
                //var newPassword = register.Password;
                model.UserName = register.Username;
                //model.PasswordHash = userEditModel.Password;
                model.Email       = register.Email;
                model.PhoneNumber = register.PhoneNumber;

                //await _userManager.RemovePasswordAsync(usrid);
                //await _userManager.AddPasswordAsync(usrid, newPassword);

                _userData.Commit();


                return(RedirectToAction("Details"));
            }
            return(View(model));
        }
예제 #6
0
        public void OnPost()
        {
            dbUserData.Update(EditUser);
            int commitInt = dbUserData.Commit();

            if (commitInt == 1)
            {
                Console.Beep();
            }
            else
            {
                Console.WriteLine(commitInt);
            }
        }
예제 #7
0
 public IActionResult OnPost()
 {
     User = userData.GetByLoginAndPassword2(Login, Password);
     if (User == null)
     {
         userData.SetMessage("Nie ma użytkownika o takim loginie i haśle, wprowadź poprawną konfigurację");
         userData.GetMessage();
         return(RedirectToPage("./Login"));
     }
     userData.SetId(User.Id);
     userData.ClearDeadline();
     userData.UpdateDeadline(User);
     userData.Commit();
     return(RedirectToPage("/MainPage"));
 }
 public IActionResult OnPost()
 {
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     if (Account.Id > 0)
     {
         //Do something
     }
     else
     {
         Account.Password = Hashit();
         Account.Role     = "Admin";
         _userData.AddUser(Account);
     }
     _userData.Commit();
     return(RedirectToPage("/CMS/Settings/User/UserList"));
 }
        public IActionResult OnPost()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            if (User.Id > 0)
            {
                _data.Update(User);
            }
            else
            {
                _data.Add(User);
            }
            _data.Commit();

            TempData["Message"] = "User saved!";
            return(RedirectToPage("./Detail", new { userId = User.Id }));
        }
예제 #10
0
        public IActionResult OnPost()
        {
            var user = userData.GetByLogin(User);

            if (user != null)
            {
                userData.SetMessage("Użytkownik o takim loginie istnieje, wybierz inny");
                userData.GetMessage();
                return(RedirectToPage("./CreateUser"));
            }
            else
            {
                userData.Add(User);
                userData.AddBudget();
                userData.Commit();
                userData.SetMessage(string.Empty);
                return(RedirectToPage("./UserCreated"));
            }
        }
        public IActionResult OnPost(Users UserDetails)
        {
            if (UploadPicture != null)
            {
                UserDetails.ProfilePicture = UploadedProPicture(UploadPicture);
            }

            if (ModelState.IsValid)
            {
                Message = userSignup.Add(UserDetails);
                if (Message == "Added")
                {
                    userSignup.Commit();
                    HttpContext.Session.SetString("username", UserDetails.UserName);
                    return(RedirectToPage("Dashboard", new { urlname = UserDetails.UserName }));
                }
            }
            return(Page());
        }
예제 #12
0
 public IActionResult OnPost()
 {
     userData.UpdateDeadline(User);
     userData.Commit();
     return(RedirectToPage("/MainPage"));
 }
예제 #13
0
 public IActionResult OnPost()
 {
     userData.UpdateBudget(Budget);
     userData.Commit();
     return(RedirectToPage("./BudgetList/"));
 }