public ActionResult Delete(UserGroup userGroup) { Require.NotNull(userGroup, nameof(userGroup)); UserGroupService.Delete(userGroup); return(RedirectToAction("Index")); }
public ActionResult Delete() { var grouplist = Request.Form["arrselections"]; IEnumerable <UserGroupVM> list = JsonConvert.DeserializeObject <List <UserGroupVM> >(grouplist); var result = _userGroupService.Delete(list); result.Message = result.Message ?? result.ResultType.GetDescription(); return(Json(result)); }
protected void grdUserGroup_RowCommand(object sender, FineUI.GridCommandEventArgs e) { UserGroupService userGroupService = new UserGroupService(); int id = Convert.ToInt32(grdUserGroup.DataKeys[e.RowIndex][0]); if (e.CommandName == "Delete") { userGroupService.Delete(userGroupService.FindBy(id)); } grdUserGroupDataBind(); }
protected void btnDelete_Click(object sender, EventArgs e) { UserGroupService userGroupService = new UserGroupService(); foreach (int rowIndex in grdUserGroup.SelectedRowIndexArray) { int id = Convert.ToInt32(grdUserGroup.DataKeys[rowIndex + grdUserGroup.PageIndex * grdUserGroup.PageSize][0]); userGroupService.Delete(userGroupService.FindBy(id)); } grdUserGroupDataBind(); }