/// <summary> /// 获得已被选择的权限主键数组 /// </summary> /// <returns></returns> private void GetSelectedId() { DataRow dataRow = BaseInterfaceLogic.GetSelecteRow(this.grdItemDetails, "colSelected"); if (dataRow != null) { this.SelectedId = dataRow[BaseItemDetailsEntity.FieldId].ToString(); this.SelectedFullName = dataRow[BaseItemDetailsEntity.FieldItemName].ToString(); } }
private void btnEdit_Click(object sender, EventArgs e) { string id = BaseInterfaceLogic.GetDataGridViewEntityId(this.grdUser, BaseUserEntity.FieldId); FrmAccountEdit frmAccountEdit = new FrmAccountEdit(id); if (frmAccountEdit.ShowDialog(this) == DialogResult.OK) { // 获得用户列表 this.DoSearch(); } }
private void grdExceptionAdmin_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdExceptionAdmin); if (dataRow != null) { BaseExceptionEntity exceptionEntity = new BaseExceptionEntity(dataRow); FrmException frmException = new FrmException(exceptionEntity); frmException.ShowDialog(); } }
public void Edit() { string id = BaseInterfaceLogic.GetDataGridViewEntityId(this.grdRole, BaseRoleEntity.FieldId); FrmOrganizeRoleEdit FrmOrganizeRoleEdit = new FrmOrganizeRoleEdit(id); if (FrmOrganizeRoleEdit.ShowDialog(this) == DialogResult.OK) { // 获得岗位列表 this.GetRoleList(); } }
/// <summary> /// 编辑 /// </summary> public void Edit() { string id = BaseInterfaceLogic.GetDataGridViewEntityId(this.grdItems_, BaseItemsEntity.FieldId); FrmItemsEdit frmItemsEdit = new FrmItemsEdit(id); if (frmItemsEdit.ShowDialog(this) == DialogResult.OK) { // 加载窗体 this.FormOnLoad(); } }
/// <summary> /// 获得已被选择的角色主键 /// </summary> /// <returns></returns> private void GetSelectedId() { DataRow dataRow = BaseInterfaceLogic.GetSelecteRow(this.grdRole, "colSelected"); // DataRowView dataRowView = (DataRowView)this.grdRole.BindingContext[this.grdRole.DataSource].Current; if (dataRow != null) { this.SelectedId = dataRow[BaseRoleEntity.FieldId].ToString(); this.SelectedFullName = dataRow[BaseRoleEntity.FieldRealName].ToString(); } }
private void grdPermission_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdPermission); if (dataRow != null) { this.GetSelectedId(dataRow); this.DialogResult = DialogResult.OK; this.Close(); } }
private void btnAuditDetail_Click(object sender, EventArgs e) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdWorkFlowCurrent); if (dataRow != null) { BaseWorkFlowCurrentEntity workFlowCurrentEntity = new BaseWorkFlowCurrentEntity(dataRow); FrmWorkFlowAuditDetail frmWorkFlowAuditDetail = new FrmWorkFlowAuditDetail(workFlowCurrentEntity.CategoryCode, workFlowCurrentEntity.ObjectId); frmWorkFlowAuditDetail.Show(); } }
private void btnSetPassword_Click(object sender, EventArgs e) { if (BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdUser, "colSelected")) { string assemblyName = "DotNet.WinForm"; string formName = "FrmUserSetPassword"; Type assemblyType = CacheManager.Instance.GetType(assemblyName, formName); Form frmUserSetPassword = (Form)Activator.CreateInstance(assemblyType, (object)this.GetSelectIds()); frmUserSetPassword.ShowDialog(this); } }
private void SetCondition() { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdTable); string tableName = dataRow[BaseTableColumnsEntity.FieldTableCode].ToString(); FrmTableScopeConstraint frmTableScopeCondition = new FrmTableScopeConstraint(this.ResourceCategory, this.ResourceId, tableName); if (frmTableScopeCondition.ShowDialog(this) == DialogResult.OK) { this.FormOnLoad(); } }
private void grdOrganize_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdOrganize); if (dataRow != null) { this.SelectedId = dataRow[BaseOrganizeEntity.FieldId].ToString(); this.SelectedFullName = dataRow[BaseOrganizeEntity.FieldFullName].ToString(); this.DialogResult = DialogResult.OK; this.Close(); } }
private bool ucWorkFlowUser_BeforBtnAuditDetailClick(string categoryId, string objectId) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdWorkFlowCurrent); if (dataRow != null) { BaseWorkFlowCurrentEntity workFlowCurrentEntity = new BaseWorkFlowCurrentEntity(dataRow); FrmWorkFlowAuditDetail frmWorkFlowAuditDetail = new FrmWorkFlowAuditDetail(workFlowCurrentEntity.CategoryCode, workFlowCurrentEntity.ObjectId); frmWorkFlowAuditDetail.Show(); } return(false); }
private void btnSetOrganize_Click(object sender, EventArgs e) { if (BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdUser, "colSelected")) { FrmUserOrganizeBatchSet frmUserOrganizeBatchSet = new FrmUserOrganizeBatchSet(this.GetSelectIds()); if (frmUserOrganizeBatchSet.ShowDialog(this) == DialogResult.OK) { // 重新加载页面 this.FormOnLoad(); } } }
private void btnRoleUser_Click(object sender, EventArgs e) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdUser); if (dataRow != null) { string id = dataRow[BaseUserEntity.FieldId].ToString(); string realName = dataRow[BaseUserEntity.FieldRealName].ToString(); FrmUserRoleAdmin frmUserRoleAdmin = new FrmUserRoleAdmin(id, realName); frmUserRoleAdmin.ShowDialog(this); } }
/// <summary> /// 绑定屏幕数据 /// </summary> /// <param name="reloadTree">重新加载文件夹树</param> private void BindData(bool reloadTree) { // 加载文件夹树的主键 if (reloadTree) { this.LoadTree(); if (this.tvFolder.SelectedNode == null) { if (this.tvFolder.Nodes.Count > 0) { if (this.parentEntityId.Length == 0) { this.tvFolder.SelectedNode = this.tvFolder.Nodes[0]; } else { BaseInterfaceLogic.FindTreeNode(this.tvFolder, this.parentEntityId); if (BaseInterfaceLogic.TargetNode != null) { this.tvFolder.SelectedNode = BaseInterfaceLogic.TargetNode; // 展开当前选中节点的所有父节点 BaseInterfaceLogic.ExpandTreeNode(this.tvFolder); } } if (this.tvFolder.SelectedNode != null) { this.tvFolder.SelectedNode.EnsureVisible(); this.tvFolder.SelectedNode.Expand(); } } } } // 添加选择列 if (this.ParentEntityId.Length > 0) { if (reloadTree) { // 获得子文件夹列表 this.GetFolderList(); } } if (!this.permissionEdit) { // 只读属性设置 this.grdFolder.Columns["colSelected"].ReadOnly = !this.permissionEdit; this.grdFolder.Columns["colDescription"].ReadOnly = !this.permissionEdit; // 修改背景颜色 this.grdFolder.Columns["colDescription"].DefaultCellStyle.BackColor = Color.White; } // 设置按钮状态 this.SetControlState(); }
private void btnUserRole_Click(object sender, EventArgs e) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdUser); string id = dataRow[BaseUserEntity.FieldId].ToString(); string realName = dataRow[BaseUserEntity.FieldRealName].ToString(); string assemblyName = "DotNet.WinForm"; string formName = "FrmUserRoleAdmin"; Type assemblyType = CacheManager.Instance.GetType(assemblyName, formName); Form frmUserPermissionAdmin = (Form)Activator.CreateInstance(assemblyType, id, realName); frmUserPermissionAdmin.ShowDialog(this); }
private void SelectMulti() { if (BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdStaff, "colSelected")) { if (this.CheckInput()) { this.SelectedIds = this.GetSelectedIds(); this.SelectedFullName = BaseBusinessLogic.ObjectsToList(this.GetSelectedFullNames()); this.DialogResult = DialogResult.OK; this.Close(); } } }
private void btnEdit_Click(object sender, EventArgs e) { string id = BaseInterfaceLogic.GetDataGridViewEntityId(this.grdStaffAddress, BaseStaffEntity.FieldId); FrmStaffAddressEdit frmStaffAddressEdit = new FrmStaffAddressEdit(id); if (frmStaffAddressEdit.ShowDialog(this) == DialogResult.OK) { // 记录当前选中的主键 this.CurrentEntityId = this.EntityId; // 加载窗体 this.FormOnLoad(); } }
/// <summary> /// 绑定屏幕数据 /// </summary> private void BindData() { // 获取表格的权限 this.GetPermission(); this.grdStaffAddress.AutoGenerateColumns = false; this.grdStaffAddress.DataSource = this.DTStaff.DefaultView; this.grdStaffAddress.Refresh(); if (this.CurrentEntityId.Length > 0) { this.grdStaffAddress.FirstDisplayedScrollingRowIndex = BaseInterfaceLogic.GetRowIndex(this.DTStaff, BaseStaffEntity.FieldId, this.CurrentEntityId); } // 设置按钮状态 this.SetControlState(); }
/// <summary> /// 绑定数据 /// </summary> private void BindGrdData() { this.DTWorkFlowActivity = DotNetService.Instance.WorkFlowActivityAdminService.GetDataTable(this.UserInfo, this.WorkFlowId); this.DTWorkFlowActivity.DefaultView.Sort = BaseWorkFlowActivityEntity.FieldSortCode; this.grdWorkFlowActivity.AutoGenerateColumns = false; this.grdWorkFlowActivity.DataSource = this.DTWorkFlowActivity.DefaultView; this.grdWorkFlowActivity.Refresh(); if (this.EntityId.Length > 0) { this.grdWorkFlowActivity.FirstDisplayedScrollingRowIndex = BaseInterfaceLogic.GetRowIndex(this.DTWorkFlowActivity, BaseWorkFlowActivityEntity.FieldId, this.EntityId); } // 设置排序按钮 this.ucTableSort.DataBind(this.grdWorkFlowActivity, this.PermissionEdit); }
/// <summary> /// 加载窗体 /// </summary> public override void FormOnLoad() { // 获得组织机构数据 this.DTOrganize = this.GetOrganizeScope(this.PermissionItemScopeCode, true); if (!UserInfo.IsAdministrator) { // 查找 ParentId 字段的值是否在 Id字段 里 BaseInterfaceLogic.CheckTreeParentId(this.DTOrganize, BaseOrganizeEntity.FieldId, BaseOrganizeEntity.FieldParentId); } // 加载树 this.BindData(true); // 加载角色列表的主键 this.GetRoleList(); }
public void Edit() { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdRole); if (dataRow != null) { FrmRoleEdit frmRoleEdit = new FrmRoleEdit(dataRow); if (frmRoleEdit.ShowDialog(this) == DialogResult.OK) { // this.grdRole.Refresh(); this.FormOnLoad(false); } } }
/// <summary> /// 加载窗体 /// </summary> public override void FormOnLoad() { this.splUser.SplitterDistance = 0; // 获取部门数据,这里按管理范围进行获取数据 this.DTOrganize = this.GetOrganizeScope(this.PermissionItemScopeCode, true); // 内部组织机构必须要检查父亲节点的逻辑关系 BaseInterfaceLogic.CheckTreeParentId(this.DTOrganize, BaseOrganizeEntity.FieldId, BaseOrganizeEntity.FieldParentId); this.LoadTreeOrganize(); // 表格显示序号的处理部分 this.DataGridViewOnLoad(grdUser); // 加载窗体,检查是否配置为默认加载用户列表,就怕用户数量太多了。 FormOnLoad(BaseSystemInfo.LoadAllUser); this.SetRowFilter(); }
private void grdUser_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // TODO: 若是单选功能,双击就表示选定了当前的数据了。 if (!this.MultiSelect) { DataRow dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdUser); if (dataRow != null) { this.SelectedId = dataRow[BaseUserEntity.FieldId].ToString(); this.SelectedFullName = dataRow[BaseUserEntity.FieldRealName].ToString(); this.DialogResult = DialogResult.OK; this.Close(); } } }
/// <summary> /// 获得已被选择的权限主键数组 /// </summary> private void GetSelectedId() { DataRow dataRow = BaseInterfaceLogic.GetSelecteRow(this.grdStaff, "colSelected"); if (dataRow == null) { // 默认当前的行 dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdStaff); } if (dataRow != null) { this.SelectedId = dataRow[BaseStaffEntity.FieldId].ToString(); this.SelectedFullName = dataRow[BaseStaffEntity.FieldRealName].ToString(); } }
/// <summary> /// 设置当前所有选中的记录为隐藏状态 /// </summary> /// <returns>设置更新成功</returns> private bool SetInvisible() { bool returnValue = false; string statusCode = string.Empty; string statusMessage = string.Empty; // 检查至少要选择一个 if (!BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdSequence, "colSelected")) { return(returnValue); } int selectedCount = 0; BaseSequenceEntity sequenceEntity = new BaseSequenceEntity(); BaseSequenceManager sequenceManager = new BaseSequenceManager(this.UserInfo); foreach (DataGridViewRow dgvRow in grdSequence.Rows) { DataRow dataRow = (dgvRow.DataBoundItem as DataRowView).Row; if (dataRow.RowState != DataRowState.Deleted) { if ((System.Boolean)(dgvRow.Cells["colSelected"].Value ?? false)) { sequenceEntity = new BaseSequenceEntity(dataRow); // 记录BaseSequence不能被隐藏 if (!sequenceEntity.FullName.Equals("BaseSequence")) { selectedCount++; sequenceEntity.IsVisible = 0; //sequenceManager.Update(sequenceEntity);该方法调用不成,所以使用了下面调用服务方法更新,待优化 int rowCount = DotNetService.Instance.SequenceService.Update(UserInfo, sequenceEntity, out statusCode, out statusMessage); } else { MessageBox.Show(AppMessage.Format(AppMessage.MSG0018, "BaseSequence"), AppMessage.MSG0020, MessageBoxButtons.OK, MessageBoxIcon.Information); return(returnValue); } } } } // 被选中记录中被设置隐藏的次数 returnValue = selectedCount > 0; if (!returnValue) { MessageBox.Show(AppMessage.MSG0024, AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } return(returnValue); }
/// <summary> /// 获得已被选择的权限主键数组 /// </summary> private void GetSelectedId() { // 是否已有选中的 DataRow dataRow = BaseInterfaceLogic.GetSelecteRow(this.grdOrganize, "colSelected"); if (dataRow == null) { // 默认当前的行 dataRow = BaseInterfaceLogic.GetDataGridViewEntity(this.grdOrganize); } if (dataRow != null) { this.SelectedId = dataRow[BaseOrganizeEntity.FieldId].ToString(); this.SelectedFullName = dataRow[BaseOrganizeEntity.FieldFullName].ToString(); } }
/// <summary> /// 加载窗体 /// </summary> public override void FormOnLoad() { this.isUserClick = false; // 获取部门数据 this.DTOrganize = this.GetOrganizeScope(this.PermissionItemScopeCode, true); if (!UserInfo.IsAdministrator) { // 查找 ParentId 字段的值是否在 ID字段 里 BaseInterfaceLogic.CheckTreeParentId(this.DTOrganize, BaseOrganizeEntity.FieldId, BaseOrganizeEntity.FieldParentId); } BaseBusinessLogic.SetFilter(this.DTOrganize, BaseOrganizeEntity.FieldEnabled, "1"); this.RoleIds = DotNetService.Instance.UserService.GetUserRoleIds(UserInfo, this.TargetStaffId); // 加载树 this.BindData(true); this.isUserClick = true; }
/// <summary> /// 绑定屏幕数据 /// </summary> private void BindData() { this.grdItems_.AutoGenerateColumns = false; this.DTItems.DefaultView.Sort = BaseItemsEntity.FieldSortCode; string rowFilter = string.Empty; if (this.chkEnabled.Checked) { rowFilter = BaseItemsEntity.FieldEnabled + " = 1 "; this.DTItems.DefaultView.RowFilter = rowFilter; } this.grdItems_.DataSource = this.DTItems.DefaultView; // this.grdItems_.Refresh(); if (this.grdItems_.Rows.Count > 0) { if (this.CurrentEntityId.Length > 0) { this.grdItems_.FirstDisplayedScrollingRowIndex = BaseInterfaceLogic.GetRowIndex(this.DTItems, BaseItemsEntity.FieldId, this.CurrentEntityId); } } // 判断编辑权限 if (!this.permissionEdit) { // 只读属性设置 this.grdItems_.Columns["colSelected"].ReadOnly = true; this.grdItems_.Columns["colCode"].ReadOnly = true; this.grdItems_.Columns["colFullName"].ReadOnly = true; this.grdItems_.Columns["colTargetTable"].ReadOnly = true; this.grdItems_.Columns["colDescription"].ReadOnly = true; this.grdItems_.Columns["colUseItemCode"].ReadOnly = true; this.grdItems_.Columns["colUseItemName"].ReadOnly = true; this.grdItems_.Columns["colUseItemValue"].ReadOnly = true; this.grdItems_.Columns["colEnabled"].ReadOnly = true; // 修改背景颜色 this.grdItems_.Columns["colCode"].DefaultCellStyle.BackColor = Color.White; this.grdItems_.Columns["colFullName"].DefaultCellStyle.BackColor = Color.White; this.grdItems_.Columns["colTargetTable"].DefaultCellStyle.BackColor = Color.White; this.grdItems_.Columns["colDescription"].DefaultCellStyle.BackColor = Color.White; } // 设置排序按钮 this.ucTableSort.DataBind(this.grdItems_, this.permissionEdit); // 设置按钮状态 this.SetControlState(); }
/// <summary> /// 删除数据 /// </summary> public int Delete() { int returnValue = 0; // 检查至少要选择一个? if (!BaseInterfaceLogic.CheckInputSelectAnyOne(this.grdRole, "colSelected")) { return(returnValue); } // 检查是否有不允许删除的数据? if (!this.CheckInput()) { return(returnValue); } // 是否确认删除了? if (MessageBox.Show(AppMessage.MSG0015, AppMessage.MSG0000, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) != DialogResult.OK) { return(returnValue); } // 设置鼠标繁忙状态,并保留原先的状态 Cursor holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; try { this.btnBatchDelete.Enabled = false; returnValue = this.BatchDelete(); // 重新加载数据,先刷新屏幕,再显示提示信息 this.FormOnLoad(false); // 是否需要有提示信息? if (BaseSystemInfo.ShowInformation) { // 批量保存,进行提示 MessageBox.Show(AppMessage.Format(AppMessage.MSG0077, returnValue.ToString()), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { this.ProcessException(ex); } finally { // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; } return(returnValue); }