Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult DeleteUser(int id)
- {
- UserBusinessLayer userService = new UserBusinessLayer("sqlconn");
- UserModel userModel = new UserModel();
- try
- {
- UserEntity userEntity = userService.GetUserId(id);
- userModel.usr_Id = userEntity.usr_Id;
- userModel.email = userEntity.email;
- userModel.username = userEntity.username;
- userModel.password = userEntity.password;
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return View(userModel);
- }
- [HttpPost, ActionName("DeleteUser")]
- public ActionResult DeleteUserConfirmed(int id)
- {
- UserBusinessLayer userService = new UserBusinessLayer("sqlconn");
- userService.DeleteUser(new UserEntity(){
- usr_Id = id
- });
- return RedirectToAction("List");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement