1398 lines
59 KiB
C#
1398 lines
59 KiB
C#
using DevExpress.XtraEditors;
|
|
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.Data.SqlClient;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Lskj.PubUserTomodule.AuditPermissionControls
|
|
{
|
|
public partial class StepPage3 : UserControl
|
|
{
|
|
private string mMenuCode;
|
|
/// <summary>
|
|
/// 当前选中小类对象
|
|
/// </summary>
|
|
private BaseflowTypeModel SelectBaseflowTypeModel;
|
|
/// <summary>
|
|
/// 当前选中的流转步骤对象
|
|
/// </summary>
|
|
public BaseflowTypeStepModel SelectBaseflowTypeStepModel;
|
|
/// <summary>
|
|
/// 缓存model
|
|
/// </summary>
|
|
public List<BaseflowTypeModel> BaseModellist = new List<BaseflowTypeModel>();
|
|
/// <summary>
|
|
/// 当前选中小类对象
|
|
/// </summary>
|
|
private BillflowTypeModel SelectBillflowTypeModel;
|
|
/// <summary>
|
|
/// 当前选中的流转步骤对象
|
|
/// </summary>
|
|
public BillflowTypeStepModel SelectBillflowTypeStepModel;
|
|
/// <summary>
|
|
/// 缓存model
|
|
/// </summary>
|
|
public List<BillflowTypeModel> BillModellist = new List<BillflowTypeModel>();
|
|
/// <summary>
|
|
/// 主页转过来的操作权限
|
|
/// </summary>
|
|
public bool SerpPage3Power;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// 是基础模块true 还是单据
|
|
/// </summary>
|
|
public bool isBasis;
|
|
public StepPage3()
|
|
{
|
|
InitializeComponent();
|
|
setCombox();
|
|
this.labelTextEdit1.TextEdit.EditValueChanged += new EventHandler(OnUserEditValueChanged);
|
|
this.labelComboxEdit1.TextEdit.EditValueChanged += new EventHandler(OnDepEditValueChanged);
|
|
this.FlowCharfillcolor.TextEdit.Click += new EventHandler(color_Click);
|
|
this.LeftFontColor.TextEdit.Click += new EventHandler(color_Click);
|
|
this.fontColor.TextEdit.Click += new EventHandler(color_Click);
|
|
this.LeftFlowCharfillcolor.TextEdit.Click += new EventHandler(color_Click);
|
|
if (SystemInfo.Instance.HideFlowchartTab) this.xtraTabControl1.TabPages[1].PageVisible = false;
|
|
|
|
GridDragMemo dragGrid = new GridDragMemo(this.gridView, this.memoEdit1);
|
|
dragGrid.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted);
|
|
|
|
GridDragMemo dragGrid2 = new GridDragMemo(this.gridView, this.memoEdit2);
|
|
dragGrid2.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
GridDragMemo dragGrid3 = new GridDragMemo(this.gridView2, this.memoEdit1);
|
|
dragGrid3.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted);
|
|
|
|
GridDragMemo dragGrid4 = new GridDragMemo(this.gridView2, this.memoEdit2);
|
|
dragGrid4.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
|
|
}
|
|
|
|
#region 公共方法
|
|
/// <summary>
|
|
/// 设置下拉框值
|
|
/// </summary>
|
|
public void setCombox()
|
|
{
|
|
DataTable flowcharTagIdTable = new DataTable();
|
|
flowcharTagIdTable.Columns.Add("dm");
|
|
flowcharTagIdTable.Columns.Add("mc");
|
|
flowcharTagIdTable.Rows.Add("1", "普通的长方形");
|
|
flowcharTagIdTable.Rows.Add("2", "圆角长方形");
|
|
flowcharTagIdTable.Rows.Add("3", "椭圆");
|
|
flowcharTagIdTable.Rows.Add("4", "菱形");
|
|
flowcharTagIdTable.Rows.Add("5", "平行四边形");
|
|
|
|
this.flowcharTagId.ValueMember = "dm";
|
|
this.flowcharTagId.ValueField = "dm";
|
|
this.flowcharTagId.TextField = "mc";
|
|
this.flowcharTagId.SetDataSource(flowcharTagIdTable);
|
|
DataTable fontFamilyTable = new DataTable();
|
|
fontFamilyTable.Columns.Add("dm");
|
|
fontFamilyTable.Columns.Add("mc");
|
|
fontFamilyTable.Rows.Add("1", "Microsoft YaHei");
|
|
fontFamilyTable.Rows.Add("2", "Arial");
|
|
fontFamilyTable.Rows.Add("3", "仿宋");
|
|
|
|
this.fontFamily.ValueMember = "dm";
|
|
this.fontFamily.ValueField = "dm";
|
|
this.fontFamily.TextField = "mc";
|
|
this.fontFamily.SetDataSource(fontFamilyTable);
|
|
|
|
DataTable fontWeightTable = new DataTable();
|
|
fontWeightTable.Columns.Add("dm");
|
|
fontWeightTable.Columns.Add("mc");
|
|
fontWeightTable.Rows.Add("1", "normal");
|
|
fontWeightTable.Rows.Add("2", "lighter");
|
|
fontWeightTable.Rows.Add("3", "bold");
|
|
this.fontWeight.ValueMember = "dm";
|
|
this.fontWeight.ValueField = "dm";
|
|
this.fontWeight.TextField = "mc";
|
|
this.fontWeight.SetDataSource(fontWeightTable);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化界面控件</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void InitializeControl(string menuCode, bool Basis)
|
|
{
|
|
try
|
|
{
|
|
this.isBasis = Basis;
|
|
this.mMenuCode = menuCode;
|
|
this.InitializeStepType();
|
|
this.InitializeStepTypeFlow();
|
|
this.InitializeUsers();
|
|
this.InitializeDeps();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化小类</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void InitializeStepType()
|
|
{
|
|
this.comboBoxEdit1.Properties.Items.Clear();
|
|
BaseModellist.Clear();
|
|
BillModellist.Clear();
|
|
DataTable table = isBasis ? WorkFlowBaseImpl.GetBaseFlowType(mMenuCode) : WorkFlowBillImpl.GetBillFlowType(mMenuCode);
|
|
if (table.Rows.Count == 0)
|
|
{
|
|
this.comboBoxEdit1.Visible = false;
|
|
return;
|
|
}
|
|
this.comboBoxEdit1.Visible = true;
|
|
for (int i = 0; i < table.Rows.Count; i++)
|
|
{
|
|
DataRow rowItem = table.Rows[i];
|
|
if (isBasis)
|
|
{
|
|
|
|
BaseflowTypeModel model = new BaseflowTypeModel(rowItem);
|
|
this.comboBoxEdit1.Properties.Items.Add(model.billTypeName);
|
|
BaseModellist.Add(model);
|
|
if (i == 0)
|
|
{
|
|
this.SetStepTypeItem(model);
|
|
this.InitializeStepTypeFlow();
|
|
this.comboBoxEdit1.EditValue = model.billTypeName;//查询界面默认选中全部
|
|
this.comboBoxEdit1.RefreshEditValue();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
BillflowTypeModel model = new BillflowTypeModel(rowItem);
|
|
this.comboBoxEdit1.Properties.Items.Add(model.billTypeName);
|
|
BillModellist.Add(model);
|
|
if (i == 0)
|
|
{
|
|
this.SetStepTypeItem(model);
|
|
this.InitializeStepTypeFlow();
|
|
this.comboBoxEdit1.EditValue = model.billTypeName;//查询界面默认选中全部
|
|
this.comboBoxEdit1.RefreshEditValue();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 一键设置所有流程图设置
|
|
/// </summary>
|
|
public void InitAllStepTypeFlow()
|
|
{
|
|
if (isBasis)
|
|
{
|
|
if (this.SelectBaseflowTypeModel != null)
|
|
{
|
|
this.PlStep2Container.Controls.Clear();
|
|
try
|
|
{
|
|
DataTable table = WorkFlowBaseImpl.GetBaseFlowTypeStep(mMenuCode, this.SelectBaseflowTypeModel.id + "");
|
|
for (int i = table.Rows.Count; i > 0; i--)
|
|
{
|
|
DataRow rowItem = table.Rows[i - 1];
|
|
BaseflowTypeStepModel model = new BaseflowTypeStepModel(rowItem);
|
|
this.UpdateBaseFlowTypeStep(model);
|
|
}
|
|
InitializeStepTypeFlow();
|
|
MessageUtil.Show("保存成功");
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.SelectBillflowTypeModel != null)
|
|
{
|
|
this.PlStep2Container.Controls.Clear();
|
|
try
|
|
{
|
|
DataTable table = WorkFlowBillImpl.GetBillFlowTypeStep(mMenuCode, this.SelectBillflowTypeModel.id + "");
|
|
for (int i = table.Rows.Count; i > 0; i--)
|
|
{
|
|
DataRow rowItem = table.Rows[i - 1];
|
|
BaseflowTypeStepModel model = new BaseflowTypeStepModel(rowItem);
|
|
this.UpdateBillFlowTypeStep(model);
|
|
}
|
|
InitializeStepTypeFlow();
|
|
MessageUtil.Show("保存成功");
|
|
}
|
|
catch (Exception)
|
|
{
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化流转步骤</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void InitializeStepTypeFlow()
|
|
{
|
|
if (isBasis)
|
|
{
|
|
if (this.SelectBaseflowTypeModel != null)
|
|
{
|
|
this.PlStep2Container.Controls.Clear();
|
|
|
|
DataTable table = WorkFlowBaseImpl.GetBaseFlowTypeStep(mMenuCode, this.SelectBaseflowTypeModel.id + "");
|
|
if (table.Rows.Count == 0)
|
|
{
|
|
this.xtraTabControl1.Visible = false;
|
|
|
|
return;
|
|
}
|
|
for (int i = table.Rows.Count; i > 0; i--)
|
|
{
|
|
|
|
DataRow rowItem = table.Rows[i - 1];
|
|
BaseflowTypeStepModel model = new BaseflowTypeStepModel(rowItem);
|
|
// 设置面板值
|
|
if (i == 1)
|
|
{
|
|
this.SelectBaseflowTypeStepModel = model;
|
|
this.SetStepTypeFlowItem(model);
|
|
}
|
|
this.PlStep2Container.Controls.Add(this.InitStepTypeFlowItem(model, i));
|
|
}
|
|
this.xtraTabControl1.Visible = true;
|
|
}
|
|
else
|
|
{
|
|
this.xtraTabControl1.Visible = false;
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.SelectBillflowTypeModel != null)
|
|
{
|
|
this.PlStep2Container.Controls.Clear();
|
|
DataTable table = WorkFlowBillImpl.GetBillFlowTypeStep(mMenuCode, this.SelectBillflowTypeModel.id + "");
|
|
|
|
if (table.Rows.Count == 0)
|
|
{
|
|
this.xtraTabControl1.Visible = false;
|
|
return;
|
|
}
|
|
for (int i = table.Rows.Count; i > 0; i--)
|
|
{
|
|
DataRow rowItem = table.Rows[i - 1];
|
|
BillflowTypeStepModel model = new BillflowTypeStepModel(rowItem);
|
|
// 设置面板值
|
|
if (i == 1)
|
|
{
|
|
this.SelectBillflowTypeStepModel = model;
|
|
this.SetStepTypeFlowItem(model);
|
|
}
|
|
this.PlStep2Container.Controls.Add(this.InitStepTypeFlowItem(model, i));
|
|
}
|
|
this.xtraTabControl1.Visible = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 执行生成时候的存储过程
|
|
/// </summary>
|
|
/// <param name="modid"></param>
|
|
/// <param name="tagid"></param>
|
|
/// <param name="mid"></param>
|
|
/// <returns></returns>
|
|
public int createFlow(int tagid, string Dllcode, int typeID)
|
|
{
|
|
SqlParameter pMsg = new SqlParameter("@msg", SqlDbType.VarChar, 2000);
|
|
pMsg.Direction = ParameterDirection.Output;
|
|
SqlParameter returnValue = new SqlParameter("@return", SqlDbType.Int, 4);
|
|
returnValue.Direction = ParameterDirection.ReturnValue;
|
|
SqlParameter[] param =
|
|
{
|
|
new SqlParameter("@tagid",SqlDbType.Int),
|
|
new SqlParameter("@Dllcode",SqlDbType.VarChar,50),
|
|
new SqlParameter("@typeID",SqlDbType.Int),
|
|
pMsg,
|
|
returnValue
|
|
};
|
|
param[0].Value = tagid;
|
|
param[1].Value = Dllcode;
|
|
param[2].Value = typeID;
|
|
BaseImpl.ExecProcedure("[p_systemInsertSpeciesFlowInfo]", param);
|
|
return Convert.ToInt32(returnValue.Value.ToString());
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:生成流转步骤</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-26 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void CreateFlowTypeStep()
|
|
{
|
|
if (isBasis)
|
|
{
|
|
if (this.SelectBaseflowTypeModel != null)
|
|
{
|
|
if (createFlow(0, mMenuCode, this.SelectBaseflowTypeModel.id) == 0)
|
|
{
|
|
// 重排控件
|
|
this.InitializeStepTypeFlow();
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.SelectBillflowTypeModel != null)
|
|
{
|
|
if (createFlow(1, mMenuCode, this.SelectBillflowTypeModel.id) == 0)
|
|
{
|
|
// 重排控件
|
|
this.InitializeStepTypeFlow();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:更新小类流转步骤数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-25 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void UpdateBaseFlowTypeStep()
|
|
{
|
|
if (this.VerifyNull())
|
|
{
|
|
// 获取基本数据
|
|
BaseflowTypeStepModel model = this.SelectBaseflowTypeStepModel;
|
|
model.stepTime = this.ltestepTime.EditText;
|
|
model.autoStep = this.lceautoStep.EditText;
|
|
model.viewUser = this.memoEdit1.EditValue + "";
|
|
model.operUser = this.memoEdit2.EditValue + "";
|
|
model.stepBackCode = this.ltestepBackCode.EditText;
|
|
//model.StepOverCond = this.lceStepOverCond.EditText;
|
|
model.autoStepCond = this.lteautoStepCond.EditText;
|
|
model.pStepCode = this.ltepStepCode.EditText;
|
|
model.SameAudited = this.lceSameAudited.EditText;
|
|
model.stepClosed = this.lcestepClosed.EditText;
|
|
model.comfirmOper = this.lcecomfirmOper.EditText;
|
|
model.remindOper = this.lceremindOper.EditText;
|
|
model.remindSelect = this.lceremindSelect.EditText;
|
|
model.signOper = this.fontFamily.EditText;
|
|
model.FlowCharfillcolor = FlowCharfillcolor.EditText;
|
|
model.flowcharHeght = flowcharHeght.EditText;
|
|
model.flowcharTagId = flowcharTagId.EditValue;
|
|
model.flowcharWidth = flowcharWidth.EditText;
|
|
model.LeftFlowCharfillcolor = LeftFlowCharfillcolor.EditText;
|
|
model.LeftFlowCharWidth = LeftFlowCharWidth.EditText;
|
|
model.fontSize = fontSize.EditText;
|
|
model.fontWeight = fontWeight.EditText;
|
|
model.fontFamily = fontFamily.EditText;
|
|
model.flowcharLineHeght = flowcharLineHeght.EditText;
|
|
model.LeftFontColor = LeftFontColor.EditText;
|
|
model.fontColor = fontColor.EditText;
|
|
model.affirmbak = affirmbak.Text;
|
|
bool result = WorkFlowBaseImpl.newUpdateBaseFlowTypeStep(model);
|
|
|
|
if (result)
|
|
{
|
|
this.SelectBaseflowTypeStepModel = model;
|
|
}
|
|
MessageUtil.Show(result ? "保存成功!" : "保存失败!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:更新小类流转步骤数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-25 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void UpdateBillFlowTypeStep()
|
|
{
|
|
if (this.VerifyNull())
|
|
{
|
|
// 获取基本数据
|
|
BillflowTypeStepModel model = this.SelectBillflowTypeStepModel;
|
|
model.stepTime = this.ltestepTime.EditText;
|
|
model.autoStep = this.lceautoStep.EditText;
|
|
model.viewUser = this.memoEdit1.EditValue + "";
|
|
model.operUser = this.memoEdit2.EditValue + "";
|
|
model.stepBackCode = this.ltestepBackCode.EditText;
|
|
//model.StepOverCond = this.lceStepOverCond.EditText;
|
|
model.StepOverCondBak = this.lceStepOverCondBak.EditText;
|
|
model.autoStepCond = this.lteautoStepCond.EditText;
|
|
model.pStepCode = this.ltepStepCode.EditText;
|
|
model.SameAudited = this.lceSameAudited.EditText;
|
|
model.stepClosed = this.lcestepClosed.EditText;
|
|
model.comfirmOper = this.lcecomfirmOper.EditText;
|
|
model.remindOper = this.lceremindOper.EditText;
|
|
model.remindSelect = this.lceremindSelect.EditText;
|
|
model.signOper = this.lcesignOper.EditText;
|
|
model.FlowCharfillcolor = FlowCharfillcolor.EditText;
|
|
model.flowcharHeght = flowcharHeght.EditText;
|
|
model.flowcharTagId = flowcharTagId.EditValue;
|
|
model.flowcharWidth = flowcharWidth.EditText;
|
|
model.LeftFlowCharfillcolor = LeftFlowCharfillcolor.EditText;
|
|
model.LeftFlowCharWidth = LeftFlowCharWidth.EditText;
|
|
model.fontSize = fontSize.EditText;
|
|
model.fontWeight = fontWeight.EditText;
|
|
model.fontFamily = fontFamily.EditText;
|
|
model.flowcharLineHeght = flowcharLineHeght.EditText;
|
|
model.LeftFontColor = LeftFontColor.EditText;
|
|
model.fontColor = fontColor.EditText;
|
|
model.affirmbak = affirmbak.Text;
|
|
bool result = WorkFlowBillImpl.newUpdateBillFlowTypeStep(model);
|
|
if (result)
|
|
{
|
|
this.SelectBillflowTypeStepModel = model;
|
|
}
|
|
MessageUtil.Show(result ? "保存成功!" : "保存失败!");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:一键更新所有小类流程图设置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-25 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void UpdateBaseFlowTypeStep(BaseflowTypeStepModel model)
|
|
{
|
|
if (this.VerifyNull())
|
|
{
|
|
model.FlowCharfillcolor = FlowCharfillcolor.EditText;
|
|
model.flowcharHeght = flowcharHeght.EditText;
|
|
model.flowcharTagId = flowcharTagId.EditValue;
|
|
model.flowcharWidth = flowcharWidth.EditText;
|
|
model.LeftFlowCharfillcolor = LeftFlowCharfillcolor.EditText;
|
|
model.LeftFlowCharWidth = LeftFlowCharWidth.EditText;
|
|
model.fontSize = fontSize.EditText;
|
|
model.fontWeight = fontWeight.EditText;
|
|
model.fontFamily = fontFamily.EditText;
|
|
model.flowcharLineHeght = flowcharLineHeght.EditText;
|
|
model.LeftFontColor = LeftFontColor.EditText;
|
|
model.fontColor = fontColor.EditText;
|
|
model.affirmbak = affirmbak.Text;
|
|
bool result = WorkFlowBaseImpl.UpdateAllBaseFlow(model);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:一键更新所有小类流程图设置</para>
|
|
/// <para>创建人:王一帆</para>
|
|
/// <para>创建日期:2019-10-12 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void UpdateBillFlowTypeStep(BaseflowTypeStepModel model)
|
|
{
|
|
if (this.VerifyNull())
|
|
{
|
|
model.FlowCharfillcolor = FlowCharfillcolor.EditText;
|
|
model.flowcharHeght = flowcharHeght.EditText;
|
|
model.flowcharTagId = flowcharTagId.EditValue;
|
|
model.flowcharWidth = flowcharWidth.EditText;
|
|
model.LeftFlowCharfillcolor = LeftFlowCharfillcolor.EditText;
|
|
model.LeftFlowCharWidth = LeftFlowCharWidth.EditText;
|
|
model.fontSize = fontSize.EditText;
|
|
model.fontWeight = fontWeight.EditText;
|
|
model.fontFamily = fontFamily.EditText;
|
|
model.flowcharLineHeght = flowcharLineHeght.EditText;
|
|
model.LeftFontColor = LeftFontColor.EditText;
|
|
model.fontColor = fontColor.EditText;
|
|
model.affirmbak = affirmbak.Text;
|
|
bool result = WorkFlowBillImpl.UpdateAllBillFlow(model);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:重置权限</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void ResetPurview()
|
|
{
|
|
try
|
|
{
|
|
if (isBasis)
|
|
{
|
|
if (this.SelectBaseflowTypeStepModel != null && this.SelectBaseflowTypeModel != null)
|
|
{
|
|
if (MessageUtil.Show("确定重置当前审批方案[" + this.SelectBaseflowTypeModel.billTypeName + "]权限?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
WorkFlowBaseImpl.ResetPurview(mMenuCode, this.SelectBaseflowTypeStepModel.id);
|
|
MessageUtil.Show("重置成功!");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.SelectBillflowTypeStepModel != null && this.SelectBillflowTypeModel != null)
|
|
{
|
|
if (MessageUtil.Show("确定重置当前审批方案[" + this.SelectBillflowTypeModel.billTypeName + "]权限?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
WorkFlowBillImpl.ResetPurview(mMenuCode, this.SelectBillflowTypeStepModel.id);
|
|
MessageUtil.Show("重置成功!");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
LogUtil.WriteError("重置权限出错!", ex);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化权限</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void InitPurview()
|
|
{
|
|
try
|
|
{
|
|
if (isBasis)
|
|
{
|
|
if (this.SelectBaseflowTypeModel != null)
|
|
{
|
|
if (MessageUtil.Show("确定初始化所有审批方案权限?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
WorkFlowBaseImpl.InitPurview(mMenuCode);
|
|
MessageUtil.Show("初始化成功!");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.SelectBillflowTypeModel != null)
|
|
{
|
|
if (MessageUtil.Show("确定初始化所有审批方案权限?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
WorkFlowBillImpl.InitPurview(mMenuCode);
|
|
MessageUtil.Show("初始化成功!");
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
LogUtil.WriteError("初始化失败!", ex);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <para>说明:生成流程图</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-28 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
public void InitFlow()
|
|
{
|
|
try
|
|
{
|
|
// 获取基本数据
|
|
BillflowTypeStepModel model = this.SelectBillflowTypeStepModel;
|
|
if (this.SelectBillflowTypeModel != null)
|
|
{
|
|
// 保存流转步骤
|
|
//FlowChart flowchart = new FlowChart();
|
|
//flowchart.SetUrl("http://114.116.135.188:9004/lserp_xcl/pages/flowchart/FlowChart.html?ModuleId=" + model.typeCode + "&ModuleType=" + "1" + "&billType=" + model.billType);
|
|
//flowchart.ShowDialog();
|
|
}
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 私有方法
|
|
/// <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 dragGrid = new GridDragMemo(this.gridView, this.memoEdit1);
|
|
//dragGrid.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted);
|
|
|
|
//GridDragMemo dragGrid2 = new GridDragMemo(this.gridView, this.memoEdit2);
|
|
//dragGrid2.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
//GridDragMemo dragGrid3 = new GridDragMemo(this.gridView2, this.memoEdit1);
|
|
//dragGrid3.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted);
|
|
|
|
//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>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="model">The model.</param>
|
|
public void SetStepTypeFlowItem(BaseflowTypeStepModel model)
|
|
{
|
|
if (model != null)
|
|
{
|
|
this.ltestepGroup.EditText = model.stepGroup;
|
|
this.ltestepName.EditText = model.stepName;
|
|
this.ltestepTime.EditText = model.stepTime;
|
|
this.ltestepBackCode.EditText = model.stepBackCode;
|
|
this.lteautoStepCond.EditText = model.autoStepCond;
|
|
//this.lceStepOverCond.EditText = model.StepOverCond;
|
|
this.ltestepCode.EditText = model.stepCode;
|
|
this.ltepStepCode.EditText = model.pStepCode;
|
|
this.lceremindOper.EditText = model.remindOper;
|
|
this.lcecomfirmOper.EditText = model.comfirmOper;
|
|
this.fontFamily.EditText = model.signOper;
|
|
this.lceautoStep.EditText = model.autoStep;
|
|
this.lceSameAudited.EditText = model.SameAudited;
|
|
this.lcestepClosed.EditText = model.stepClosed;
|
|
this.lceremindSelect.EditText = model.remindSelect;
|
|
this.memoEdit1.EditValue = model.viewUser;
|
|
this.memoEdit2.EditValue = model.operUser;
|
|
this.flowcharTagId.EditText = string.IsNullOrWhiteSpace(model.flowcharTagId) ? "1" : model.flowcharTagId;
|
|
this.flowcharWidth.EditText = string.IsNullOrWhiteSpace(model.FlowCharfillcolor) || model.flowcharWidth == "0" ? "200" : model.flowcharWidth;
|
|
this.flowcharHeght.EditText = string.IsNullOrWhiteSpace(model.FlowCharfillcolor) || model.flowcharHeght == "0" ? "50" : model.flowcharHeght;
|
|
this.FlowCharfillcolor.EditText = string.IsNullOrWhiteSpace(model.FlowCharfillcolor) ? "#FFFFFF" : model.FlowCharfillcolor;
|
|
this.FlowCharfillcolor.TextEdit.BackColor = ColorTranslator.FromHtml(this.FlowCharfillcolor.EditText);
|
|
this.LeftFlowCharfillcolor.EditText = string.IsNullOrWhiteSpace(model.LeftFlowCharfillcolor) ? "#FFFFFF" : model.LeftFlowCharfillcolor;
|
|
this.LeftFlowCharfillcolor.TextEdit.BackColor = ColorTranslator.FromHtml(this.LeftFlowCharfillcolor.EditText);
|
|
this.fontSize.EditText = string.IsNullOrWhiteSpace(model.fontSize) ? "18" : model.fontSize;
|
|
this.fontWeight.EditText = string.IsNullOrWhiteSpace(model.fontWeight) ? "normal" : model.fontWeight;
|
|
this.LeftFlowCharWidth.EditText = string.IsNullOrWhiteSpace(model.LeftFlowCharWidth) ? "160" : model.LeftFlowCharWidth;
|
|
this.fontFamily.EditText = string.IsNullOrWhiteSpace(model.fontFamily) ? "Microsoft YaHei" : model.fontFamily;
|
|
this.flowcharLineHeght.EditText = string.IsNullOrWhiteSpace(model.fontFamily) ? "40" : model.flowcharLineHeght;
|
|
this.LeftFontColor.EditText = string.IsNullOrWhiteSpace(model.fontFamily) ? "#000000" : model.LeftFontColor;
|
|
this.LeftFontColor.TextEdit.BackColor = ColorTranslator.FromHtml(this.LeftFontColor.EditText);
|
|
this.fontColor.EditText = string.IsNullOrWhiteSpace(model.fontColor) ? "#000000" : model.fontColor;
|
|
this.fontColor.TextEdit.BackColor = ColorTranslator.FromHtml(this.fontColor.EditText);
|
|
this.affirmbak.Text = model.affirmbak;
|
|
this.SelectBaseflowTypeStepModel = model;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置面板值</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="model">The model.</param>
|
|
public void SetStepTypeFlowItem(BillflowTypeStepModel model)
|
|
{
|
|
if (model != null)
|
|
{
|
|
this.ltestepGroup.EditText = model.stepGroup;
|
|
this.ltestepName.EditText = model.stepName;
|
|
this.ltestepTime.EditText = model.stepTime;
|
|
this.ltestepBackCode.EditText = model.stepBackCode;
|
|
this.lteautoStepCond.EditText = model.autoStepCond;
|
|
//this.lceStepOverCond.EditText = model.StepOverCond;
|
|
this.ltestepCode.EditText = model.stepCode;
|
|
this.ltepStepCode.EditText = model.pStepCode;
|
|
this.lceStepOverCondBak.EditText = model.StepOverCondBak;
|
|
this.lceremindOper.EditText = model.remindOper;
|
|
this.lcecomfirmOper.EditText = model.comfirmOper;
|
|
this.lcesignOper.EditText = model.signOper;
|
|
this.lceautoStep.EditText = model.autoStep;
|
|
this.lceSameAudited.EditText = model.SameAudited;
|
|
this.lcestepClosed.EditText = model.stepClosed;
|
|
this.lceremindSelect.EditText = model.remindSelect;
|
|
this.memoEdit1.EditValue = model.viewUser;
|
|
this.memoEdit2.EditValue = model.operUser;
|
|
this.flowcharTagId.EditText = string.IsNullOrWhiteSpace(model.flowcharTagId) || model.flowcharTagId == "0" ? "1" : model.flowcharTagId;
|
|
this.flowcharWidth.EditText = string.IsNullOrWhiteSpace(model.FlowCharfillcolor) || model.flowcharWidth == "0" ? "200" : model.flowcharWidth;
|
|
this.flowcharHeght.EditText = string.IsNullOrWhiteSpace(model.FlowCharfillcolor) || model.flowcharHeght == "0" ? "50" : model.flowcharHeght;
|
|
this.FlowCharfillcolor.EditText = string.IsNullOrWhiteSpace(model.FlowCharfillcolor) ? "#FFFFFF" : model.FlowCharfillcolor;
|
|
this.FlowCharfillcolor.TextEdit.BackColor = ColorTranslator.FromHtml(this.FlowCharfillcolor.EditText);
|
|
this.LeftFlowCharfillcolor.EditText = string.IsNullOrWhiteSpace(model.LeftFlowCharfillcolor) ? "#FFFFFF" : model.LeftFlowCharfillcolor;
|
|
this.LeftFlowCharfillcolor.TextEdit.BackColor = ColorTranslator.FromHtml(this.LeftFlowCharfillcolor.EditText);
|
|
this.fontSize.EditText = string.IsNullOrWhiteSpace(model.fontSize) ? "18" : model.fontSize;
|
|
this.fontWeight.EditText = string.IsNullOrWhiteSpace(model.fontWeight) ? "normal" : model.fontWeight;
|
|
this.LeftFlowCharWidth.EditText = string.IsNullOrWhiteSpace(model.LeftFlowCharWidth) ? "160" : model.LeftFlowCharWidth;
|
|
this.fontFamily.EditText = string.IsNullOrWhiteSpace(model.fontFamily) ? "Microsoft YaHei" : model.fontFamily;
|
|
this.flowcharLineHeght.EditText = string.IsNullOrWhiteSpace(model.fontFamily) ? "40" : model.flowcharLineHeght;
|
|
this.LeftFontColor.EditText = string.IsNullOrWhiteSpace(model.fontFamily) ? "#000000" : model.LeftFontColor;
|
|
this.LeftFontColor.TextEdit.BackColor = ColorTranslator.FromHtml(this.LeftFontColor.EditText);
|
|
this.fontColor.EditText = string.IsNullOrWhiteSpace(model.fontColor) ? "#000000" : model.fontColor;
|
|
this.fontColor.TextEdit.BackColor = ColorTranslator.FromHtml(this.fontColor.EditText);
|
|
this.affirmbak.Text = model.affirmbak;
|
|
this.SelectBillflowTypeStepModel = model;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置面板值</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="model">The model.</param>
|
|
private void SetStepTypeItem(BaseflowTypeModel model)
|
|
{
|
|
if (model != null)
|
|
{
|
|
this.SelectBaseflowTypeModel = model;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:设置面板值</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="model">The model.</param>
|
|
private void SetStepTypeItem(BillflowTypeModel model)
|
|
{
|
|
if (model != null)
|
|
{
|
|
this.SelectBillflowTypeModel = model;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="flowName">Name of the flow.</param>
|
|
private StepItem3 InitStepTypeFlowItem(BaseflowTypeStepModel model, int pos)
|
|
{
|
|
StepItem3 item = new StepItem3();
|
|
item.TitleLabelObj.Text = pos + "、" + model.stepName + " " + model.stepCode;
|
|
//item.DeletePabelObj.Visible = false;
|
|
if (SerpPage3Power)
|
|
{
|
|
item.DeletePabelObj.Enabled = false;
|
|
}
|
|
item.DeletePabelObj.Click += new EventHandler(OnDeletePabelObjClick);
|
|
item.Dock = DockStyle.Top;
|
|
item.Tag = item.TitleLabelObj.Tag = item.DeletePabelObj.Tag = model;
|
|
item.SetHoverEvent(OnBillFlowLabelObjClick);
|
|
if (pos == 1)
|
|
{
|
|
item.SetDefaultSelectItem(item);
|
|
}
|
|
return item;
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <para>说明:</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="flowName">Name of the flow.</param>
|
|
private StepItem3 InitStepTypeFlowItem(BillflowTypeStepModel model, int pos)
|
|
{
|
|
StepItem3 item = new StepItem3();
|
|
item.TitleLabelObj.Text = pos + "、" + model.stepName + " " + model.stepCode;
|
|
//item.DeletePabelObj.Visible = false;
|
|
if (SerpPage3Power)
|
|
{
|
|
item.DeletePabelObj.Enabled = false;
|
|
}
|
|
item.DeletePabelObj.Click += new EventHandler(OnDeletePabelObjClick);
|
|
item.Dock = DockStyle.Top;
|
|
item.Tag = item.TitleLabelObj.Tag = item.DeletePabelObj.Tag = model;
|
|
item.SetHoverEvent(OnBillFlowLabelObjClick);
|
|
if (pos == 1)
|
|
{
|
|
item.SetDefaultSelectItem(item);
|
|
}
|
|
return item;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化小类设置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private StepTypeItem InitStepTypeItem(BaseflowTypeModel model, int pos)
|
|
{
|
|
StepTypeItem item = new StepTypeItem();
|
|
item.LabelObj.Text = model.billTypeName;
|
|
item.Dock = DockStyle.Left;
|
|
item.Tag = item.LabelObj.Tag = model;
|
|
item.SetClickEvent(OnBillFlowTypeLabelObjClick);
|
|
if (pos == 1)
|
|
{
|
|
item.SetDefaultSelectItem(item);
|
|
}
|
|
return item;
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化小类设置</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private StepTypeItem InitStepTypeItem(BillflowTypeModel model, int pos)
|
|
{
|
|
StepTypeItem item = new StepTypeItem();
|
|
item.LabelObj.Text = model.billTypeName;
|
|
item.Dock = DockStyle.Left;
|
|
item.Tag = item.LabelObj.Tag = model;
|
|
item.SetClickEvent(OnBillFlowTypeLabelObjClick);
|
|
if (pos == 1)
|
|
{
|
|
item.SetDefaultSelectItem(item);
|
|
}
|
|
return item;
|
|
}
|
|
|
|
/// <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 panelControl9.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;
|
|
}
|
|
#endregion
|
|
|
|
#region 相关事件
|
|
/// <summary>
|
|
/// <para>说明:点击小类设置切换流转步骤加载数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </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>
|
|
/// <exception cref="System.NotImplementedException"></exception>
|
|
void OnBillFlowLabelObjClick(StepItem3 before, StepItem3 after)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
BaseflowTypeStepModel model = after.Tag as BaseflowTypeStepModel;
|
|
this.SetStepTypeFlowItem(model);
|
|
}
|
|
else
|
|
{
|
|
BillflowTypeStepModel model = after.Tag as BillflowTypeStepModel;
|
|
this.SetStepTypeFlowItem(model);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:点击小类设置切换流转步骤加载数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-21 </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>
|
|
/// <exception cref="System.NotImplementedException"></exception>
|
|
void OnBillFlowTypeLabelObjClick(StepTypeItem before, StepTypeItem after)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
BaseflowTypeModel model = after.Tag as BaseflowTypeModel;
|
|
this.SetStepTypeItem(model);
|
|
this.InitializeStepTypeFlow();
|
|
}
|
|
else
|
|
{
|
|
BillflowTypeModel model = after.Tag as BillflowTypeModel;
|
|
this.SetStepTypeItem(model);
|
|
this.InitializeStepTypeFlow();
|
|
}
|
|
}
|
|
|
|
/// <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)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
string depid = this.labelComboxEdit1.EditValue;
|
|
string mf = this.labelTextEdit1.EditText;
|
|
DataTable table = WorkFlowBaseImpl.GetWorkFlowUsers(depid, mf);
|
|
this.gridControl.DataSource = table;
|
|
}
|
|
else
|
|
{
|
|
string depid = this.labelComboxEdit1.EditValue;
|
|
string mf = this.labelTextEdit1.EditText;
|
|
DataTable table = 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>
|
|
/// <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"] + "&},";
|
|
}
|
|
}
|
|
|
|
this.memoEdit2.EditValue += userNames;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
MessageUtil.Show(ResourceKeys.OperFault);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 选中节点切换步骤
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
int str = comboBoxEdit1.SelectedIndex;
|
|
if (str >= 0)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
this.SetStepTypeItem(BaseModellist[str]);
|
|
}
|
|
else
|
|
{
|
|
this.SetStepTypeItem(BillModellist[str]);
|
|
}
|
|
|
|
this.InitializeStepTypeFlow();
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 颜色框选中事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void color_Click(object sender, EventArgs e)
|
|
{
|
|
ColorDialog colordialog = new ColorDialog();
|
|
if (colordialog.ShowDialog() == DialogResult.OK)
|
|
{
|
|
TextEdit txt = (sender as TextEdit);
|
|
txt.BackColor = colordialog.Color;
|
|
//获取所选择的颜色
|
|
Color colorChoosed = colordialog.Color;
|
|
string colorHtml = ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(colorChoosed.R, colorChoosed.G, colorChoosed.B));
|
|
txt.EditValue = colorHtml;
|
|
}
|
|
else
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 切换流程图与权限设置时触发
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void xtraTabControl1_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
if (xtraTabControl1.SelectedTabPage == xtraTabPage2)//进行tabpage位置判断
|
|
{
|
|
//ModuleWebView moduleWebView1 = new ModuleWebView();
|
|
//if (moduleWebView1 != null)
|
|
//{
|
|
// moduleWebView1.FDispose();
|
|
// moduleWebView1 = null;
|
|
//}
|
|
//this.xtraTabPage2.Controls.Clear();
|
|
//// 获取基本数据
|
|
//moduleWebView1 = new ModuleWebView();
|
|
//this.xtraTabPage2.Controls.Add(moduleWebView1);
|
|
//BaseflowTypeStepModel model = this.SelectBaseflowTypeStepModel;
|
|
|
|
//string url = SystemInfo.Instance.OAUrl + "/pages/flowchart/FlowChart.html?ModuleId=" + model.typeCode + "&ModuleType=" + "0" + "&billType=" + model.billType + "&T=" + DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
//moduleWebView1.Navigate(url);
|
|
|
|
this.xtraTabPage2.Controls.Clear();
|
|
BaseflowTypeStepModel model = this.SelectBaseflowTypeStepModel;
|
|
string url = SystemInfo.Instance.OAUrl + "/pages/flowchart/FlowChart.html?ModuleId=" + model.typeCode + "&ModuleType=" + "0" + "&billType=" + model.billType + "&T=" + DateTime.Now.ToString("yyyyMMddHHmmss");
|
|
if (SystemInfo.Instance.PrimitiveBrowser)
|
|
{
|
|
FrmMiniBlink webView = new FrmMiniBlink();
|
|
webView.AllowDownload = false;
|
|
webView.Dock = DockStyle.Fill;
|
|
webView.Tag = model;
|
|
|
|
this.xtraTabPage2.Controls.Add(webView);
|
|
webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
|
}
|
|
else
|
|
{
|
|
FrmWebBrowser webView = new FrmWebBrowser();
|
|
webView.Dock = DockStyle.Fill;
|
|
webView.Tag = model;
|
|
this.xtraTabPage2.Controls.Add(webView);
|
|
webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
|
}
|
|
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (xtraTabControl1.SelectedTabPage == xtraTabPage2)//进行tabpage位置判断
|
|
{
|
|
//this.xtraTabPage2.Controls.Clear();
|
|
//// 获取基本数据
|
|
//ModuleWebView moduleWebView1 = new ModuleWebView();
|
|
//this.xtraTabPage2.Controls.Add(moduleWebView1);
|
|
//// 获取单据数据
|
|
//BillflowTypeStepModel model = this.SelectBillflowTypeStepModel;
|
|
//string url = SystemInfo.Instance.OAUrl + "/pages/flowchart/FlowChart.html?ModuleId=" + model.typeCode + "&ModuleType=" + "1" + "&billType=" + model.billType;
|
|
//moduleWebView1.Navigate(url);
|
|
this.xtraTabPage2.Controls.Clear();
|
|
BillflowTypeStepModel model = this.SelectBillflowTypeStepModel;
|
|
string url = SystemInfo.Instance.OAUrl + "/pages/flowchart/FlowChart.html?ModuleId=" + model.typeCode + "&ModuleType=" + "1" + "&billType=" + model.billType;
|
|
if (SystemInfo.Instance.PrimitiveBrowser)
|
|
{
|
|
FrmMiniBlink webView = new FrmMiniBlink();
|
|
webView.AllowDownload = false;
|
|
webView.Dock = DockStyle.Fill;
|
|
webView.Tag = model;
|
|
|
|
this.xtraTabPage2.Controls.Add(webView);
|
|
webView.LoadUrl(ReplaceHelper.ReplaceUserInfo(url));
|
|
}
|
|
else
|
|
{
|
|
FrmWebBrowser webView = new FrmWebBrowser();
|
|
webView.Dock = DockStyle.Fill;
|
|
webView.Tag = model;
|
|
this.xtraTabPage2.Controls.Add(webView);
|
|
webView.FrmLoad(ReplaceHelper.ReplaceUserInfo(url));
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
|
|
private void OnDeletePabelObjClick(object sender, EventArgs e)
|
|
{
|
|
try
|
|
{
|
|
Panel deletePanel = sender as Panel;
|
|
if (deletePanel != null && deletePanel.Tag != null)
|
|
{
|
|
if (MessageUtil.Show("是否删除当前方案步骤?", MessageBoxButtons.YesNo) == DialogResult.Yes)
|
|
{
|
|
if (isBasis)
|
|
{
|
|
BaseflowTypeStepModel model = deletePanel.Tag as BaseflowTypeStepModel;
|
|
if (WorkFlowBaseImpl.DeleteSchemeSteps(model))
|
|
{
|
|
MessageUtil.Show("删除成功!");
|
|
InitializeStepTypeFlow();
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show("删除失败");
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
BillflowTypeStepModel model = deletePanel.Tag as BillflowTypeStepModel;
|
|
if (WorkFlowBillImpl.DeleteSchemeSteps(model))
|
|
{
|
|
MessageUtil.Show("删除成功!");
|
|
InitializeStepTypeFlow();
|
|
}
|
|
else
|
|
{
|
|
MessageUtil.Show("删除失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
string Message = ErrorMessage.PromptErrorMessage(ex);
|
|
MessageUtil.Show(Message, ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|