/// <summary> /// 修改管理员 /// </summary> /// <param name="handle">当前行</param> private void ManagerUpdate(int handle) { try { if (handle < 0) { return; } ManagerEdit managerEdit = new ManagerEdit(); managerEdit.EditType = 2; DataRow dw = ViewManage.GetDataRow(handle); int UserID = int.Parse(dw["UserID"].ToString()); UM_UserInfo UserInfo = UserInfoBLL.GetModel(UserID); managerEdit.UserInfo = UserInfo; UM_ManagerBeloneToGroupBLL ManagerBeloneToGroupBLL = new UM_ManagerBeloneToGroupBLL(); UM_ManagerBeloneToGroup ManagerBeloneToGroup = ManagerBeloneToGroupBLL.GetModel(UserID); managerEdit.RightGroupID = (int)ManagerBeloneToGroup.ManagerGroupID; if (managerEdit.ShowDialog(this) == DialogResult.OK) { LoadManagerList(); this.ViewManage.FocusedRowHandle = handle; } } catch (Exception ex) { ShowMessageBox.ShowInformation("修改管理员失败!"); string errCode = "GL-1005"; string errMsg = "修改管理员异常!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } }
private void Btn_Del_Click(object sender, EventArgs e) { if (this.ViewManage != null && this.ViewManage.FocusedRowHandle >= 0) { if (ShowMessageBox.ShowQuestion("确认删除此用户?") == DialogResult.No) { return; } try { m_cutRow = this.ViewManage.FocusedRowHandle; DataRow dw = ViewManage.GetDataRow(m_cutRow); int UserID = int.Parse(dw["UserID"].ToString()); if (UserInfoBLL.ManagerDelete(UserID)) { ShowMessageBox.ShowInformation("删除成功!"); LoadManagerList(); } else { ShowMessageBox.ShowInformation("删除失败!"); } } catch (Exception ex) { ShowMessageBox.ShowInformation("删除失败!"); string errCode = "GL-1004"; string errMsg = "删除失败!"; VTException exception = new VTException(errCode, errMsg, ex); LogHelper.WriteError(exception.ToString(), exception.InnerException); } } else { ShowMessageBox.ShowInformation("请选中记录行"); } }