コード例 #1
0
        public ActionResult Delete(UserGroup userGroup)
        {
            Require.NotNull(userGroup, nameof(userGroup));
            UserGroupService.Delete(userGroup);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        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();
        }