652 lines
27 KiB
C#
652 lines
27 KiB
C#
using DevExpress.Utils;
|
|
using DevExpress.XtraEditors.Controls;
|
|
using DevExpress.XtraEditors.Repository;
|
|
using DevExpress.XtraGrid.Columns;
|
|
using DevExpress.XtraReports.Design;
|
|
using Lskj.Business;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Control;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Data;
|
|
using Lskj.Model;
|
|
using Lskj.Util;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Lskj.PubUserTomodule.AuditPermissionControls
|
|
{
|
|
public partial class StepPage4 : UserControl
|
|
{
|
|
protected bool mLoading = false;
|
|
protected Timer mTimer = new Timer();
|
|
/// <summary>
|
|
/// 下拉框数据源绑定完成后执行
|
|
/// </summary>
|
|
//public event EventHandler OnDataSourceBindCallBack;
|
|
|
|
/// <summary>
|
|
/// 模块编号
|
|
/// </summary>
|
|
private string mMenuCode;
|
|
/// <summary>
|
|
/// 基础对象
|
|
/// </summary>
|
|
//public ModuleModel moduleModel;
|
|
/// <summary>
|
|
/// 主页转过来的操作权限
|
|
/// </summary>
|
|
public bool SerpPagePower;
|
|
/// <summary>
|
|
/// 是基础模块true 还是单据
|
|
/// </summary>
|
|
public bool isBasis;
|
|
/// <summary>
|
|
/// key
|
|
/// </summary>
|
|
public string OverBackKey;
|
|
/// <summary>
|
|
/// 删除条件id
|
|
/// </summary>
|
|
public List<string> deleteId = new List<string>();
|
|
|
|
public DevExpress.XtraTab.XtraTabControl Sp4XtraTabControl { get { return this.xtraTabControl1; } }
|
|
|
|
public StepPage4()
|
|
{
|
|
InitializeComponent();
|
|
this.labelTextEdit1.TextEdit.EditValueChanged += new EventHandler(OnUserEditValueChanged);
|
|
this.labelComboxEdit1.TextEdit.EditValueChanged += new EventHandler(OnDepEditValueChanged);
|
|
GridDragMemo dragGrid2 = new GridDragMemo(this.gridView, this.memoEdit2);
|
|
dragGrid2.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
GridDragMemo dragGrid4 = new GridDragMemo(this.gridView2, this.memoEdit2);
|
|
dragGrid4.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
|
|
CreateTableColumn();
|
|
}
|
|
|
|
//条件删除
|
|
public void onBut_delete()
|
|
{
|
|
DataRow dr = this.ConditionsControlEx.GridView.GetFocusedDataRow();
|
|
if (dr != null)
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(dr["Id"] + "")) deleteId.Add(dr["Id"] + "");
|
|
DataTable dataTable = this.ConditionsControlEx.gridControl.DataSource as DataTable;
|
|
dataTable.Rows.Remove(dr);
|
|
}
|
|
}
|
|
|
|
//条件新增
|
|
public void onBut_increase()
|
|
{
|
|
DataTable dataTable = this.ConditionsControlEx.gridControl.DataSource as DataTable;
|
|
DataRow dr = dataTable.NewRow();
|
|
dr["ShowMobile"] = 0;
|
|
dataTable.Rows.Add(dr);
|
|
}
|
|
|
|
public void CreateTableColumn()
|
|
{
|
|
GridColumn idColumn = new GridColumn();
|
|
idColumn.Caption = "ID";
|
|
idColumn.FieldName = "id";
|
|
idColumn.Visible = true;
|
|
idColumn.VisibleIndex = 0;
|
|
idColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn nameColumn = new GridColumn();
|
|
nameColumn.Caption = "条件名";
|
|
nameColumn.FieldName = "controlName";
|
|
nameColumn.Visible = true;
|
|
nameColumn.VisibleIndex = 1;
|
|
//nameColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn promptColumn = new GridColumn();
|
|
promptColumn.Caption = "条件提示";
|
|
promptColumn.FieldName = "controlLabel";
|
|
promptColumn.Visible = true;
|
|
promptColumn.VisibleIndex = 2;
|
|
//promptColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
|
|
|
|
|
|
GridColumn TypeColumn = new GridColumn();
|
|
TypeColumn.Caption = "类型";
|
|
TypeColumn.FieldName = "controlType";
|
|
TypeColumn.Visible = true;
|
|
TypeColumn.VisibleIndex = 3;
|
|
//TypeColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
RepositoryItemLookUpEdit comboxEdit = new RepositoryItemLookUpEdit();
|
|
comboxEdit.SearchMode = SearchMode.AutoFilter;
|
|
comboxEdit.ShowHeader = false;
|
|
comboxEdit.ImmediatePopup = false;
|
|
comboxEdit.NullText = "";
|
|
comboxEdit.PopupBorderStyle = PopupBorderStyles.Flat;
|
|
comboxEdit.AllowNullInput = DefaultBoolean.False;
|
|
comboxEdit.DisplayMember = "showname";
|
|
comboxEdit.ValueMember = "showid";
|
|
//comboxEdit.DataSource = MainImpl.GetDataTableResult(model.SqlSource);
|
|
|
|
|
|
LookUpColumnInfo valueColumn = new LookUpColumnInfo();
|
|
valueColumn.Caption = "编码";
|
|
valueColumn.FieldName = "showid";
|
|
valueColumn.Visible = false;
|
|
|
|
LookUpColumnInfo textColumn = new LookUpColumnInfo();
|
|
textColumn.Caption = "名称";
|
|
textColumn.FieldName = "showname";
|
|
|
|
comboxEdit.Columns.AddRange(new LookUpColumnInfo[] { valueColumn, textColumn });
|
|
|
|
ConditionsControlEx.gridControl.RepositoryItems.Add(comboxEdit);
|
|
TypeColumn.ColumnEdit = comboxEdit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GridColumn defaultValueColumn = new GridColumn();
|
|
defaultValueColumn.Caption = "默认值";
|
|
defaultValueColumn.FieldName = "defaultValue";
|
|
defaultValueColumn.Visible = true;
|
|
defaultValueColumn.VisibleIndex = 4;
|
|
//defaultValueColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn SQLColumn = new GridColumn();
|
|
SQLColumn.Caption = "SQL";
|
|
SQLColumn.FieldName = "sourceSql";
|
|
SQLColumn.Visible = true;
|
|
SQLColumn.VisibleIndex = 5;
|
|
//SQLColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn keyFieldColumn = new GridColumn();
|
|
keyFieldColumn.Caption = "关联字段";
|
|
keyFieldColumn.FieldName = "keyField";
|
|
keyFieldColumn.Visible = true;
|
|
keyFieldColumn.VisibleIndex = 6;
|
|
//keyFieldColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn resultFieldColumn = new GridColumn();
|
|
resultFieldColumn.Caption = "名称字段";
|
|
resultFieldColumn.FieldName = "resultField";
|
|
resultFieldColumn.Visible = true;
|
|
resultFieldColumn.VisibleIndex = 7;
|
|
// resultFieldColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn LeftColumn = new GridColumn();
|
|
LeftColumn.Caption = "左";
|
|
LeftColumn.FieldName = "controlLeft";
|
|
LeftColumn.Visible = true;
|
|
LeftColumn.VisibleIndex = 8;
|
|
//LeftColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn TopColumn = new GridColumn();
|
|
TopColumn.Caption = "上";
|
|
TopColumn.FieldName = "controlTop";
|
|
TopColumn.Visible = true;
|
|
TopColumn.VisibleIndex = 9;
|
|
//TopColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn WidthColumn = new GridColumn();
|
|
WidthColumn.Caption = "宽";
|
|
WidthColumn.FieldName = "controlWidth";
|
|
WidthColumn.Visible = true;
|
|
WidthColumn.VisibleIndex = 10;
|
|
//WidthColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn HeightColumn = new GridColumn();
|
|
HeightColumn.Caption = "高";
|
|
HeightColumn.FieldName = "controlHeight";
|
|
HeightColumn.Visible = true;
|
|
HeightColumn.VisibleIndex = 11;
|
|
//HeightColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
GridColumn checkCondColumn = new GridColumn();
|
|
checkCondColumn.Caption = "条件";
|
|
checkCondColumn.FieldName = "checkCond";
|
|
checkCondColumn.Visible = true;
|
|
checkCondColumn.VisibleIndex = 12;
|
|
//checkCondColumn.OptionsColumn.AllowEdit = false;
|
|
|
|
|
|
RepositoryItemCheckEdit checkEdit = new RepositoryItemCheckEdit();
|
|
checkEdit.ValueChecked = 1;
|
|
checkEdit.ValueUnchecked = 0;
|
|
checkEdit.ValueGrayed = 3;
|
|
|
|
|
|
|
|
GridColumn ShowMobileColumn = new GridColumn();
|
|
ShowMobileColumn.Caption = "移动显示";
|
|
ShowMobileColumn.FieldName = "ShowMobile";
|
|
ShowMobileColumn.Visible = true;
|
|
ShowMobileColumn.VisibleIndex = 13;
|
|
//ShowMobileColumn.OptionsColumn.AllowEdit = false;
|
|
ShowMobileColumn.ColumnEdit = checkEdit;
|
|
|
|
this.ConditionsControlEx.GridView.Columns.AddRange(new GridColumn[] {
|
|
idColumn,
|
|
nameColumn,
|
|
promptColumn,
|
|
TypeColumn,
|
|
defaultValueColumn,
|
|
SQLColumn,
|
|
keyFieldColumn,
|
|
resultFieldColumn,
|
|
LeftColumn,
|
|
TopColumn,
|
|
WidthColumn,
|
|
HeightColumn,
|
|
checkCondColumn,
|
|
ShowMobileColumn
|
|
});
|
|
|
|
|
|
this.mTimer.Tick += new EventHandler(mTimerTick);
|
|
this.mTimer.Start();
|
|
}
|
|
|
|
protected void mTimerTick(object sender, EventArgs e)
|
|
{
|
|
if (!mLoading)
|
|
{
|
|
mLoading = true;
|
|
try
|
|
{
|
|
|
|
Application.DoEvents();
|
|
RepositoryItemLookUpEdit lookUp = ConditionsControlEx.GridView.Columns["controlType"].ColumnEdit as RepositoryItemLookUpEdit;
|
|
lookUp.DataSource = BaseImpl.GetDataTableResult(@" select 0 as showid,'字符串' as showname union all select 200 as showid,'字符串扩展' as showname union all select 1 as showid,'下拉框返回ID' as showname union all select 21 as showid,'带复选下拉框返回ID' as showname union all select 2 as
|
|
showid,'下拉框返回名称' as showname union all select 22 as showid,'带复选下拉框返回名称' as showname union all select 4 as showid,'日期类型框' as showname union all select 24 as showid,'带复选日期类型框' as showname union all
|
|
select 44 as showid,'日期时间类型框(时分秒)' as showname union all select 244 as showid,'带复选日期时间类型框(时分秒)' as showname union all select 444 as showid,'日期时间类型框(时分)' as showname union all select 2444 as
|
|
showid,'带复选日期时间类型框(时分)' as showname union all select 4444 as showid,'时间类型框(时分秒)' as showname union all select 24444 as showid,'带复选时间类型框(时分秒)' as showname union all select 44444 as
|
|
showid,'时间类型框(时分)' as showname union all select 244444 as showid,'带复选时间类型框(时分)' as showname union all select 5 as showid,'搜索框返回ID' as showname union all select 25 as showid,'带复选搜索框返回ID' as showname union all select 6 as showid,'搜索框返回名称' as showname union all select 26 as showid,'带复选搜索框返回名称' as showname union all select 7 as showid,'数值' as showname union all select 8 as showid,'密码框' as showname union all select 98 as showid,'条码类型' as showname union all select 13 as showid,'多选返回ID' as showname union all select 14 as showid,'多选返回名称' as showname union all select 15 as showid,'搜索框返回ID-带参数' as showname union all select 16 as showid,'搜索框返回名称-带参数' as showname union all select 215 as showid,'带复选搜索框返回ID-带参数' as showname union all select 216 as showid,'带复选搜索框返回名称-带参数' as showname union all select 33 as showid,'多选返回ID-带参数' as showname union all select 34 as showid,'多选返回名称-带参数' as showname union all select 38 as showid,'智能搜索返回ID' as showname union all select 39 as showid,'智能搜索返回名称' as showname union all select 213 as showid,'带复选多选返回ID' as showname union all select 214 as showid,'带复选多选返回名称' as showname union all select 17 as showid,'复选框' as showname union all select 118 as showid,'树型下拉返回ID' as showname union all select 119 as showid,'树型下拉返回名称' as showname union all select 120 as showid,'树型下拉返回ID-带参数' as showname union all select 121 as showid,'树型下拉返回名称-带参数' as showname union all select 122 as showid,'树型下拉返回ID末级' as showname union all select 123 as showid,'树型下拉返回名称末级' as showname union all select 124 as showid,'树型下拉返回ID末级-带参数' as showname union all select 125 as showid,'树型下拉返回名称末级-带参数' as showname
|
|
");
|
|
|
|
}
|
|
catch (Exception)
|
|
{
|
|
}
|
|
finally
|
|
{
|
|
//if (this.OnDataSourceBindCallBack != null) this.OnDataSourceBindCallBack(null, null);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.mTimer.Stop();
|
|
this.mTimer.Dispose();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <para>说明:部门下拉框值改变后</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnDepEditValueChanged(object sender, EventArgs e)
|
|
{
|
|
string depid = this.labelComboxEdit1.EditValue;
|
|
string mf = this.labelTextEdit1.EditText;
|
|
|
|
DataTable table = isBasis ? WorkFlowBaseImpl.GetWorkFlowUsers(depid, mf) : WorkFlowBillImpl.GetWorkFlowUsers(depid, mf);
|
|
|
|
this.gridControl.DataSource = table;
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <para>说明:用户值改变后</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnUserEditValueChanged(object sender, EventArgs e)
|
|
{
|
|
string depid = this.labelComboxEdit1.EditValue;
|
|
string mf = this.labelTextEdit1.EditText;
|
|
|
|
DataTable table = isBasis ? WorkFlowBaseImpl.GetWorkFlowUsers(depid, mf) : WorkFlowBillImpl.GetWorkFlowUsers(depid, mf);
|
|
DataTable Roletable = isBasis ? WorkFlowBaseImpl.GetWorkFlowRole(mf) : WorkFlowBillImpl.GetWorkFlowRole(mf);
|
|
this.gridControl.DataSource = table;
|
|
this.gridControl1.DataSource = Roletable;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 初始化
|
|
/// </summary>
|
|
/// <param name="menuCode"></param>
|
|
public void InitializeControl(string menuCode, bool Basis)
|
|
{
|
|
this.isBasis = Basis;
|
|
this.mMenuCode = menuCode;
|
|
this.InitializeUsers();
|
|
this.InitializeDeps();
|
|
this.initialLoad();
|
|
}
|
|
|
|
|
|
|
|
|
|
//GridDragMemo dragGrid2 = null;
|
|
//GridDragMemo dragGrid4 = null;
|
|
/// <summary>
|
|
/// <para>说明:</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitializeUsers()
|
|
{
|
|
DataTable table = isBasis ? WorkFlowBaseImpl.GetWorkFlowUsers("", "") : WorkFlowBillImpl.GetWorkFlowUsers("", "");
|
|
DataTable Roletable = isBasis ? WorkFlowBaseImpl.GetWorkFlowRole("") : WorkFlowBillImpl.GetWorkFlowRole("");
|
|
this.gridControl.DataSource = table;
|
|
this.gridControl1.DataSource = Roletable;
|
|
|
|
//GridDragMemo dragGrid2 = new GridDragMemo(this.gridView, this.memoEdit2);
|
|
//dragGrid2.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
//GridDragMemo dragGrid4 = new GridDragMemo(this.gridView2, this.memoEdit2);
|
|
//dragGrid4.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化部门数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitializeDeps()
|
|
{
|
|
DataTable table = isBasis ? WorkFlowBaseImpl.GetDeps() : WorkFlowBillImpl.GetDeps();
|
|
|
|
this.labelComboxEdit1.ValueMember = "departmentid";
|
|
this.labelComboxEdit1.ValueField = "departmentid";
|
|
this.labelComboxEdit1.TextField = "departmentname";
|
|
this.labelComboxEdit1.SetDataSource(table);
|
|
}
|
|
|
|
///// <summary>
|
|
///// <para>说明:表格拖拽完成</para>
|
|
///// <para>创建人:龚宇超</para>
|
|
///// <para>创建日期:2017-11-14 </para>
|
|
///// <para>修改人:</para>
|
|
///// <para>修改日期:</para>
|
|
///// <para>修改备注:</para>
|
|
///// <para>版本:1.0</para>
|
|
///// </summary>
|
|
///// <param name="sender">The sender.</param>
|
|
///// <param name="e">The e.</param>
|
|
//void OnDragGridCompleted(object sender, GridDragMemoArgs e)
|
|
//{
|
|
// if (e.GridViewSelectRows == null || e.GridViewSelectRows.Length == 0) return;
|
|
|
|
// try
|
|
// {
|
|
// string userNames = string.Empty;
|
|
// if (e.SourceGridViewObj.Name == "gridView")
|
|
// {
|
|
// foreach (DataRow item in e.GridViewSelectRows)
|
|
// {
|
|
// userNames += item["employeename"] + ",";
|
|
// }
|
|
|
|
// }
|
|
// else if (e.SourceGridViewObj.Name == "gridView2")
|
|
// {
|
|
// foreach (DataRow item in e.GridViewSelectRows)
|
|
// {
|
|
// userNames += "{&" + item["roleName"] + "&},";
|
|
// }
|
|
// }
|
|
// this.memoEdit1.EditValue += userNames;
|
|
// }
|
|
// catch (Exception ex)
|
|
// {
|
|
// LogHelper.Instance.WriteError(ex);
|
|
// MessageUtil.Show(ResourceKeys.OperFault);
|
|
// }
|
|
//}
|
|
|
|
/// <summary>
|
|
/// <para>说明:表格拖拽完成</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-14 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The e.</param>
|
|
void OnDragGridCompleted2(object sender, GridDragMemoArgs e)
|
|
{
|
|
if (e.GridViewSelectRows == null || e.GridViewSelectRows.Length == 0) return;
|
|
|
|
try
|
|
{
|
|
string userNames = string.Empty;
|
|
string RoleNames = string.Empty;
|
|
if (e.SourceGridViewObj.Name == "gridView")
|
|
{
|
|
foreach (DataRow item in e.GridViewSelectRows)
|
|
{
|
|
userNames += item["employeename"] + ",";
|
|
}
|
|
|
|
}
|
|
else if (e.SourceGridViewObj.Name == "gridView2")
|
|
{
|
|
foreach (DataRow item in e.GridViewSelectRows)
|
|
{
|
|
userNames += "{&" + item["roleName"] + "&},";
|
|
}
|
|
|
|
//userNames = PowerImpl.getAllPersonnel(userNames);
|
|
//if (userNames.Equals(",")) userNames = "";
|
|
}
|
|
//List<System.String> namesList = new List<System.String>((this.memoEdit2.EditValue + "").Split(','));
|
|
//foreach (string item in userNames.Split(','))
|
|
//{
|
|
// if (!namesList.Exists(t => t.Equals(item)))
|
|
// {
|
|
// this.memoEdit2.EditValue += item + ",";
|
|
// }
|
|
|
|
//}
|
|
this.memoEdit2.EditValue += userNames;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
MessageUtil.Show(ResourceKeys.OperFault);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:验证数据合法性</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-06 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
public bool VerifyNull()
|
|
{
|
|
foreach (System.Windows.Forms.Control item in groupBox1.Controls)
|
|
{
|
|
if (item is LabelTextEdit)
|
|
{
|
|
LabelTextEdit textEdit = item as LabelTextEdit;
|
|
if (string.IsNullOrEmpty(textEdit.EditText) && textEdit.Required)
|
|
{
|
|
textEdit.Focus();
|
|
MessageUtil.Show(textEdit.LabelText + "不能为空!");
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public void UpdateFinalReturnSettings()
|
|
{
|
|
try
|
|
{
|
|
if (this.VerifyNull())
|
|
{
|
|
string sql = this.memoEdit1.EditValue + "";//终审sql
|
|
string name = this.memoEdit2.EditValue + "";//终审回退人员
|
|
bool result = isBasis ? WorkFlowBaseImpl.UpdateFinalReturnSettings(sql, name, mMenuCode) : WorkFlowBillImpl.UpdateFinalReturnSettings(sql, name, mMenuCode);
|
|
if (!result)
|
|
{
|
|
MessageUtil.Show("设置保存失败!");
|
|
return;
|
|
}
|
|
|
|
//删除
|
|
foreach (string id in deleteId)
|
|
{
|
|
|
|
if (isBasis)
|
|
{
|
|
result = WorkFlowBaseImpl.deleteFinalConditions(id, OverBackKey);
|
|
}
|
|
else
|
|
{
|
|
result = WorkFlowBillImpl.deleteFinalConditions(id, OverBackKey);
|
|
}
|
|
if (!result)
|
|
{
|
|
MessageUtil.Show("条件保存失败!");
|
|
return;
|
|
}
|
|
|
|
}
|
|
//保存条件
|
|
DataTable dataTable = this.ConditionsControlEx.gridControl.DataSource as DataTable;
|
|
foreach (DataRow dr in dataTable.Rows)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
result = WorkFlowBaseImpl.SaveFinalConditions(dr, OverBackKey);
|
|
}
|
|
else
|
|
{
|
|
result = WorkFlowBillImpl.SaveFinalConditions(dr, OverBackKey);
|
|
}
|
|
if (!result)
|
|
{
|
|
MessageUtil.Show("条件保存失败!");
|
|
return;
|
|
}
|
|
}
|
|
|
|
MessageUtil.Show("设置保存成功!");
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
finally
|
|
{
|
|
deleteId = new List<string>();
|
|
this.ConditionsControlEx.gridControl.DataSource = isBasis ? WorkFlowBaseImpl.getFallbackCondition(OverBackKey) : WorkFlowBillImpl.getFallbackCondition(OverBackKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
//初始加载终审回退sql和终审回退人员信息,回退条件
|
|
public void initialLoad()
|
|
{
|
|
this.memoEdit1.Text = "";
|
|
this.memoEdit2.Text = "";
|
|
OverBackKey = "";
|
|
deleteId = new List<string>();
|
|
DataTable dataTable = isBasis ? WorkFlowBaseImpl.getFinalBack(mMenuCode) : WorkFlowBillImpl.getFinalBack(mMenuCode);
|
|
if (dataTable.Rows.Count > 0)
|
|
{
|
|
this.memoEdit1.Text = dataTable.Rows[0]["OverBackSql"] + "";
|
|
this.memoEdit2.Text = dataTable.Rows[0]["OverBackOper"] + "";
|
|
string key = dataTable.Rows[0]["OverBackKey"] + "";
|
|
OverBackKey = key;
|
|
this.ConditionsControlEx.gridControl.DataSource = isBasis ? WorkFlowBaseImpl.getFallbackCondition(key) : WorkFlowBillImpl.getFallbackCondition(key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 生成终审sql
|
|
/// </summary>
|
|
public void GenerateFinalSqlStatement()
|
|
{
|
|
bool result = WorkFlowBaseImpl.CreateSQL();
|
|
//DataTable table = isBasis ? WorkFlowBaseImpl.GetBaseFlowData(mMenuCode) : WorkFlowBillImpl.GetBillFlowData(mMenuCode);
|
|
if (result)
|
|
{
|
|
//单据,单表用的同一个存储过程
|
|
string sql = "";
|
|
//string stepcode = table.Rows[0]["stepcode"] + "";
|
|
int resultNew = WorkFlowBaseImpl.GenerateFinalSqlStatement(mMenuCode, "0", out sql);
|
|
if (resultNew == 1)
|
|
{
|
|
this.memoEdit1.Text = sql;
|
|
this.UpdateFinalReturnSettings();
|
|
}
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show("p_systemCreateendFlowSQL存储过程错!");
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|