public IActionResult OnPost(string username) { var confirmdelete = deleteUser.Delete(username); deleteUser.Commit(); return(RedirectToPage("./UsersList")); }
public IActionResult OnPost(string userId) { DeletedUser = userData.Delete(userId); userData.Commit(); if (DeletedUser == null) { return(RedirectToPage("../NotFound")); } return(RedirectToPage("../UsersList")); }
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")); }
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)); }
public void OnPost() { dbUserData.Update(EditUser); int commitInt = dbUserData.Commit(); if (commitInt == 1) { Console.Beep(); } else { Console.WriteLine(commitInt); } }
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 })); }
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()); }
public IActionResult OnPost() { userData.UpdateDeadline(User); userData.Commit(); return(RedirectToPage("/MainPage")); }
public IActionResult OnPost() { userData.UpdateBudget(Budget); userData.Commit(); return(RedirectToPage("./BudgetList/")); }