基线 SVN r240
SVN-Revision: r240
This commit is contained in:
@@ -0,0 +1,911 @@
|
||||
/******************************
|
||||
* 说明:小类流转类别设置
|
||||
* 创建人:龚宇超
|
||||
* 创建日期:2019-06-21
|
||||
* 修改人:
|
||||
* 修改日期:
|
||||
* 修改备注:
|
||||
* 版本:1.0.0.0
|
||||
******************************/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Lskj.Business;
|
||||
using Lskj.Model;
|
||||
using Lskj.Control;
|
||||
using Lskj.Control.Model;
|
||||
using Lskj.Util;
|
||||
using Lskj.Data;
|
||||
using DevExpress.XtraEditors;
|
||||
using System.Data.SqlClient;
|
||||
using Lskj.Business.Impl;
|
||||
|
||||
namespace Lskj.Workflow.Control
|
||||
{
|
||||
/// <summary>
|
||||
/// 小类流转类别设置
|
||||
/// </summary>
|
||||
public partial class StepPage3 : UserControl
|
||||
{
|
||||
private string mMenuCode;
|
||||
/// <summary>
|
||||
/// 当前选中小类对象
|
||||
/// </summary>
|
||||
private BillflowTypeModel SelectBillflowTypeModel;
|
||||
/// <summary>
|
||||
/// 当前选中的流转步骤对象
|
||||
/// </summary>
|
||||
public BillflowTypeStepModel SelectBillflowTypeStepModel;
|
||||
/// <summary>
|
||||
/// 缓存model
|
||||
/// </summary>
|
||||
public List<BillflowTypeModel> modellist = new List<BillflowTypeModel>();
|
||||
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.LeftFlowCharfillcolor.TextEdit.Click += new EventHandler(color_Click);
|
||||
this.fontColor.TextEdit.Click += new EventHandler(color_Click);
|
||||
this.LeftFontColor.TextEdit.Click += new EventHandler(color_Click);
|
||||
}
|
||||
|
||||
#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)
|
||||
{
|
||||
try
|
||||
{
|
||||
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();
|
||||
modellist.Clear();
|
||||
DataTable table = 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];
|
||||
BillflowTypeModel model = new BillflowTypeModel(rowItem);
|
||||
this.comboBoxEdit1.Properties.Items.Add(model.billTypeName);
|
||||
modellist.Add(model);
|
||||
if (i == 0)
|
||||
{
|
||||
this.SetStepTypeItem(model);
|
||||
this.InitializeStepTypeFlow();
|
||||
this.comboBoxEdit1.EditValue = model.billTypeName;//查询界面默认选中全部
|
||||
this.comboBoxEdit1.RefreshEditValue();
|
||||
}
|
||||
// this.panelControl8.Controls.Add(this.InitStepTypeItem(model, i));
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 一键设置所有流程图设置
|
||||
/// </summary>
|
||||
public void InitAllStepTypeFlow()
|
||||
{
|
||||
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 (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 (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 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.UpdateBillFlowTypeStep(model);
|
||||
if (result)
|
||||
{
|
||||
this.SelectBillflowTypeStepModel = model;
|
||||
}
|
||||
MessageUtil.Show(result ? "保存成功!" : "保存失败!");
|
||||
}
|
||||
}
|
||||
/// <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 (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 (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 = WorkFlowBillImpl.GetWorkFlowUsers("", "");
|
||||
DataTable Roletable = 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 = 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(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(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(BillflowTypeStepModel model, int pos)
|
||||
{
|
||||
StepItem3 item = new StepItem3();
|
||||
item.TitleLabelObj.Text = pos + "、" + model.stepName + " " + model.stepCode;
|
||||
item.DeletePabelObj.Visible = false;
|
||||
item.Dock = DockStyle.Top;
|
||||
item.Tag = item.TitleLabelObj.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(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)
|
||||
{
|
||||
try
|
||||
{
|
||||
BillflowTypeStepModel model = after.Tag as BillflowTypeStepModel;
|
||||
this.SetStepTypeFlowItem(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
}
|
||||
/// <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)
|
||||
{
|
||||
try
|
||||
{
|
||||
BillflowTypeModel model = after.Tag as BillflowTypeModel;
|
||||
|
||||
this.SetStepTypeItem(model);
|
||||
this.InitializeStepTypeFlow();
|
||||
}
|
||||
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>
|
||||
/// <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)
|
||||
{
|
||||
try
|
||||
{
|
||||
string depid = this.labelComboxEdit1.EditValue;
|
||||
string mf = this.labelTextEdit1.EditText;
|
||||
|
||||
DataTable table = WorkFlowBillImpl.GetWorkFlowUsers(depid, mf);
|
||||
|
||||
this.gridControl.DataSource = table;
|
||||
}
|
||||
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>
|
||||
/// <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)
|
||||
{
|
||||
try
|
||||
{
|
||||
string depid = this.labelComboxEdit1.EditValue;
|
||||
string mf = this.labelTextEdit1.EditText;
|
||||
|
||||
DataTable table = WorkFlowBillImpl.GetWorkFlowUsers(depid, mf);
|
||||
DataTable Roletable = WorkFlowBillImpl.GetWorkFlowRole(mf);
|
||||
this.gridControl.DataSource = table;
|
||||
this.gridControl1.DataSource = Roletable;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
}
|
||||
/// <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;
|
||||
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.memoEdit1.EditValue += userNames;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
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)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
LogHelper.Instance.WriteError(ex);
|
||||
//MessageUtil.Show(ResourceKeys.OperFault);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 颜色框选中事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void color_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
TextEdit txt = (sender as TextEdit);
|
||||
txt.BackColor = this.colorDialog.Color;
|
||||
//获取所选择的颜色
|
||||
Color colorChoosed = this.colorDialog.Color;
|
||||
string colorHtml = ColorTranslator.ToHtml(System.Drawing.Color.FromArgb(colorChoosed.R, colorChoosed.G, colorChoosed.B));
|
||||
txt.EditValue = colorHtml;
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
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 comboBoxEdit1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
int str = comboBoxEdit1.SelectedIndex;
|
||||
if (str >= 0)
|
||||
{
|
||||
this.SetStepTypeItem(modellist[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 xtraTabControl1_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
string Message = ErrorMessage.PromptErrorMessage(ex);
|
||||
MessageUtil.Show(Message,ex.Message);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user