/******************************
* 说明:小类流转类别设置
* 创建人:龚宇超
* 创建日期: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
{
///
/// 小类流转类别设置
///
public partial class StepPage3 : UserControl
{
private string mMenuCode;
///
/// 当前选中小类对象
///
private BillflowTypeModel SelectBillflowTypeModel;
///
/// 当前选中的流转步骤对象
///
public BillflowTypeStepModel SelectBillflowTypeStepModel;
///
/// 缓存model
///
public List modellist = new List();
///
/// 主页转过来的操作权限
///
public bool SerpPage3Power;
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);
if (SystemInfo.Instance.HideFlowchartTab) this.xtraTabControl1.TabPages[1].PageVisible = false;
}
#region 公共方法
///
/// 设置下拉框值
///
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);
}
///
/// 说明:初始化界面控件
/// 创建人:龚宇超
/// 创建日期:2019-06-21
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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);
}
}
///
/// 说明:初始化小类
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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));
}
}
///
/// 一键设置所有流程图设置
///
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;
}
}
}
///
/// 说明:初始化流转步骤
/// 创建人:龚宇超
/// 创建日期:2019-06-21
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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;
}
}
///
/// 执行生成时候的存储过程
///
///
///
///
///
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());
}
///
/// 说明:生成流转步骤
/// 创建人:龚宇超
/// 创建日期:2019-06-26
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
public void CreateFlowTypeStep()
{
if (this.SelectBillflowTypeModel != null)
{
if (createFlow(1, mMenuCode, this.SelectBillflowTypeModel.id) == 0)
{
// 重排控件
this.InitializeStepTypeFlow();
}
}
}
///
/// 说明:更新小类流转步骤数据
/// 创建人:龚宇超
/// 创建日期:2019-06-25
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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 ? "保存成功!" : "保存失败!");
}
}
///
/// 说明:一键更新所有小类流程图设置
/// 创建人:王一帆
/// 创建日期:2019-10-12
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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);
}
}
///
/// 说明:重置权限
/// 创建人:龚宇超
/// 创建日期:2019-06-28
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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);
}
}
///
/// 说明:初始化权限
/// 创建人:龚宇超
/// 创建日期:2019-06-28
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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);
}
}
///
/// 说明:生成流程图
/// 创建人:龚宇超
/// 创建日期:2019-06-28
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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 私有方法
///
/// 说明:
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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);
}
///
/// 说明:初始化部门数据
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
private void InitializeDeps()
{
DataTable table = WorkFlowBillImpl.GetDeps();
this.labelComboxEdit1.ValueMember = "departmentid";
this.labelComboxEdit1.ValueField = "departmentid";
this.labelComboxEdit1.TextField = "departmentname";
this.labelComboxEdit1.SetDataSource(table);
}
///
/// 说明:设置面板值
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The model.
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;
}
}
///
/// 说明:设置面板值
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The model.
private void SetStepTypeItem(BillflowTypeModel model)
{
if (model != null)
{
this.SelectBillflowTypeModel = model;
}
}
///
/// 说明:
/// 创建人:龚宇超
/// 创建日期:2019-06-21
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// Name of the flow.
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;
}
///
/// 说明:初始化小类设置
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
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;
}
///
/// 说明:验证数据合法性
/// 创建人:龚宇超
/// 创建日期:2017-11-06
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// true if XXXX, false otherwise.
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 相关事件
///
/// 说明:点击小类设置切换流转步骤加载数据
/// 创建人:龚宇超
/// 创建日期:2019-06-21
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The instance containing the event data.
///
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);
}
}
///
/// 说明:点击小类设置切换流转步骤加载数据
/// 创建人:龚宇超
/// 创建日期:2019-06-21
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The instance containing the event data.
///
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);
}
}
///
/// 说明:部门下拉框值改变后
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The instance containing the event data.
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);
}
}
///
/// 说明:用户值改变后
/// 创建人:龚宇超
/// 创建日期:2019-06-24
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The instance containing the event data.
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);
}
}
///
/// 说明:表格拖拽完成
/// 创建人:龚宇超
/// 创建日期:2017-11-14
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The e.
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);
}
}
///
/// 说明:表格拖拽完成
/// 创建人:龚宇超
/// 创建日期:2017-11-14
/// 修改人:
/// 修改日期:
/// 修改备注:
/// 版本:1.0
///
/// The sender.
/// The e.
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);
}
}
///
/// 颜色框选中事件
///
///
///
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);
}
}
///
/// 选中节点切换步骤
///
///
///
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);
}
}
///
/// 切换流程图预览或权限时触发
///
///
///
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);
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));
}
}
}
catch (Exception ex)
{
string Message = ErrorMessage.PromptErrorMessage(ex);
MessageUtil.Show(Message, ex.Message);
}
}
#endregion
private void OnDeletePabelObjClick(object sender, EventArgs e)
{
try
{
Panel de