示例#1
0
        private void loadData(int id)
        {
            UserGroupService userGroupService = new UserGroupService();
            UserGroup        userGroup        = userGroupService.FindBy(id);

            txtGroupName.Text = userGroup.GroupName;
        }
        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();
        }