/// <summary> /// 新增操作员或权限角色 /// </summary> private void btnHandleNew_Click(object sender, EventArgs e) { try { DataRow focusedRow = gridViewLineCondition.GetFocusedDataRow(); if (focusedRow == null) { MessageHandler.ShowMessageBox("请先新增条件信息后,再进行新增处理人员或通知人员的操作。"); btnNew.Focus(); return; } string handleOwnerStr = DataTypeConvert.GetString(searchLookUpHandleOwner.EditValue); if (handleOwnerStr == "") { MessageHandler.ShowMessageBox("请选择要登记的操作员或者权限角色。"); searchLookUpHandleOwner.Focus(); return; } int conditionAutoIdInt = DataTypeConvert.GetInt(focusedRow["AutoId"]); if (TabControlConditionOtherInfo.SelectedTabPage == PageLineHandle)//处理人员 { //setDAO.InsertWorkFlowsLineHandle(lineIdInt, conditionAutoIdInt, radioHandleCate.SelectedIndex, DataTypeConvert.GetString(searchLookUpHandleOwner.EditValue), DataTypeConvert.GetInt(spinMultiLevelApprover.EditValue)); //RefreshHandleInfo(conditionAutoIdInt); DataRow dr = TableLineHandle.NewRow(); dr["LineId"] = lineIdInt > 0 ? lineIdInt : (object)DBNull.Value; dr["ConditionId"] = conditionAutoIdInt; dr["MultiLevelApprover"] = DataTypeConvert.GetInt(spinMultiLevelApprover.EditValue); dr["LineHandleCate"] = radioHandleCate.SelectedIndex; dr["HandleOwner"] = DataTypeConvert.GetString(searchLookUpHandleOwner.EditValue); dr["HandleName"] = searchLookUpHandleOwner.Text; dr["Creator"] = SystemInfo.user.AutoId; dr["GetTime"] = BaseSQL.GetServerDateTime(); TableLineHandle.Rows.Add(dr); BSLineHandle.MoveLast(); } else if (TabControlConditionOtherInfo.SelectedTabPage == PageLineNotice)//通知人员 { //setDAO.InsertWorkFlowsLineNotice(lineIdInt, conditionAutoIdInt, radioHandleCate.SelectedIndex, DataTypeConvert.GetString(searchLookUpHandleOwner.EditValue), DataTypeConvert.GetInt(spinMultiLevelApprover.EditValue)); //RefreshNoticeInfo(conditionAutoIdInt); DataRow dr = TableLineNotice.NewRow(); dr["LineId"] = lineIdInt > 0 ? lineIdInt : (object)DBNull.Value; dr["ConditionId"] = conditionAutoIdInt; dr["MultiLevelApprover"] = DataTypeConvert.GetInt(spinMultiLevelApprover.EditValue); dr["LineHandleCate"] = radioHandleCate.SelectedIndex; dr["HandleOwner"] = DataTypeConvert.GetString(searchLookUpHandleOwner.EditValue); dr["HandleName"] = searchLookUpHandleOwner.Text; dr["Creator"] = SystemInfo.user.AutoId; dr["GetTime"] = BaseSQL.GetServerDateTime(); TableLineNotice.Rows.Add(dr); BSLineNotice.MoveLast(); } } catch (Exception ex) { ExceptionHandler.HandleException(this.Text + "--新增操作员或权限角色错误。", ex); } }
/// <summary> /// 复制处理人员信息到通知人员事件 /// </summary> private void BtnCopy_Click(object sender, EventArgs e) { try { DataRow focusedConditionRow = gridViewLineCondition.GetFocusedDataRow(); if (focusedConditionRow == null) { MessageHandler.ShowMessageBox("请先新增条件信息后,再进行处理人员或通知人员的操作。"); btnNew.Focus(); return; } int conditionAutoIdInt = DataTypeConvert.GetInt(focusedConditionRow["AutoId"]); if (gridViewLineHandle.DataRowCount == 0) { MessageHandler.ShowMessageBox("没有处理人员可以进行复制,请添加处理人员后再进行操作。"); return; } if (gridViewLineNotice.DataRowCount > 0) { if (MessageHandler.ShowMessageBox_YesNo("通知人员已经有记录,确认是否删除之前的通知人员,复制处理人员信息吗?") != DialogResult.Yes) { return; } } for (int i = gridViewLineNotice.DataRowCount - 1; i >= 0; i--) { gridViewLineNotice.GetDataRow(i).Delete(); } for (int i = 0; i < gridViewLineHandle.DataRowCount; i++) { DataRow dr = gridViewLineHandle.GetDataRow(i); DataRow newRow = TableLineNotice.NewRow(); newRow["LineId"] = dr["LineId"]; newRow["ConditionId"] = dr["ConditionId"]; newRow["MultiLevelApprover"] = dr["MultiLevelApprover"]; newRow["LineHandleCate"] = dr["LineHandleCate"]; newRow["HandleOwner"] = dr["HandleOwner"]; newRow["HandleName"] = dr["HandleName"]; newRow["Creator"] = SystemInfo.user.AutoId; newRow["GetTime"] = BaseSQL.GetServerDateTime(); TableLineNotice.Rows.Add(newRow); } MessageHandler.ShowMessageBox("通知人员复制成功。"); } catch (Exception ex) { ExceptionHandler.HandleException(this.Text + "--复制处理人员信息到通知人员事件错误。", ex); } }