private void btnDel_Click(object sender, ImageClickEventArgs e) { string PKID; int selectedIndex = -1; foreach (DataGridItem item in this.dgUser.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { if (((System.Web.UI.WebControls.RadioButton)item.Cells[0].Controls[1]).Checked) { selectedIndex = item.ItemIndex; break; } } } if (selectedIndex != -1) { PKID = this.dgUser.Items[selectedIndex].Cells[1].Text; Wicresoft.Session.Session session = new Wicresoft.Session.Session(); BusinessMapping.User bo = new BusinessMapping.User(); bo.SessionInstance = session; BusinessFilter filter = new BusinessFilter("User"); filter.AddFilterItem("PKID", PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND); bo.AddFilter(filter); bo.Load(); if (bo.IsReserved.Value) { GlobalFacade.Utils.ShowMessage(Enums.Constants.RecordReserved); } else { bo.ModifyUser.Value = this.MyContext.UserID; bo.ModifyTime.Value = DateTime.Now; bo.IsValid.Value = false; bo.Update(); //BusinessRule.SystemManage.OperationLog rule = new BusinessRule.SystemManage.OperationLog(); //rule.WriteOperationLog("用户信息管理", "删除用户信息"); // Reload Data ucCustomPaging.LoadData(ucCustomPaging.CurrentPage); } } }
private void LoadData() { BusinessFilter filter = new BusinessFilter("Role"); filter.AddFilterItem("PKID", PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND); BusinessMapping.Role role = new BusinessMapping.Role(); role.SessionInstance = new Wicresoft.Session.Session(); role.AddFilter(filter); role.Load(); if (role.HaveRecord) { this.tbxRoleCode.Text = role.RoleCode.Value; this.tbxRoleName.Text = role.RoleName.Value; this.tbxMemo.Text = role.Memo.Value; } }
private void btnDel_Click(object sender, ImageClickEventArgs e) { string PKID; int selectedIndex = -1; foreach (DataGridItem item in this.dgCWOneChild.Items) { if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem) { if (((System.Web.UI.WebControls.RadioButton)item.Cells[0].Controls[1]).Checked) { selectedIndex = item.ItemIndex; break; } } } if (selectedIndex != -1) { PKID = this.dgCWOneChild.Items[selectedIndex].Cells[1].Text; Wicresoft.Session.Session session = new Wicresoft.Session.Session(); BusinessMapping.CWOneChild bo = new BusinessMapping.CWOneChild(); bo.SessionInstance = session; BusinessFilter filter = new BusinessFilter("CWOneChild"); filter.AddFilterItem("PKID", PKID.ToString(), Operation.Equal, FilterType.NumberType, AndOr.AND); bo.AddFilter(filter); bo.Load(); if (bo.HaveRecord) { bo.ModifyUser.Value = GlobalFacade.SystemContext.GetContext().UserID; bo.ModifyTime.Value = DateTime.Now; bo.IsValid.Value = false; bo.Update(); // Reload Data ucCustomPaging.LoadData(ucCustomPaging.CurrentPage); } } }