Ejemplo n.º 1
0
        /// <summary>
        /// 聚焦条件列表信息事件
        /// </summary>
        private void gridViewLineCondition_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
        {
            try
            {
                DataRow focusedRow = gridViewLineCondition.GetFocusedDataRow();
                if (focusedRow != null)
                {
                    int conditionAutoIdInt = DataTypeConvert.GetInt(focusedRow["AutoId"]);

                    string filterStr = string.Format("ConditionId = {0}", conditionAutoIdInt);
                    BSLineHandle.Filter = filterStr;
                    BSLineNotice.Filter = filterStr;

                    int maxLevel = DataTypeConvert.GetInt(TableLineHandle.Compute("Max(MultiLevelApprover)", filterStr));
                    spinMultiLevelApprover.Value = maxLevel < 1 ? 1 : maxLevel;
                }
                else
                {
                    BSLineHandle.Filter = "1=2";
                    BSLineNotice.Filter = "1=2";

                    spinMultiLevelApprover.Value = 1;
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(this.Text + "--聚焦条件列表信息事件错误。", ex);
            }
        }
Ejemplo n.º 2
0
        /// <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);
            }
        }