public ActionResult AddUpdateUser(ModelAddUpdateUser model) { if (_IUser.Admin_CheckUserExist(model.UserName, model.AdminUserId).Count > 0) { model.ErrorMessage = "Username already existed"; } else { _IUser.Admin_UpdateUser(model.UserName, model.Password, CurrentUser.UserName, model.AdminUserId); Response.Redirect("/User/ManageUser"); } return(View(model)); }
public ActionResult AddUpdateUser(ModelAddUpdateUser model) { if (_IUser.Admin_CheckUserExist(model.UserName, model.AdminUserId).Count > 0) { model.ErrorMessage = "Username already existed"; } else { _IUser.Admin_UpdateUser(model.UserName, model.Password, userEntity.UserName, model.AdminUserId); return(RedirectToAction("ManageUser")); } return(View(model)); }
public ActionResult AddUpdateUser(int adminUserId) { ModelAddUpdateUser model = new ModelAddUpdateUser(); if (adminUserId > 0) { Admin_GetUser _adminUser = _IUser.Admin_GetUserOnId(adminUserId); model.AdminUserId = _adminUser.AdminUserId; model.UserName = _adminUser.UserName; model.Password = _adminUser.Password; } return(View(model)); }