87056b7953
SVN-Revision: r934
245 lines
8.6 KiB
C#
245 lines
8.6 KiB
C#
using Lskj.Business;
|
|
using Lskj.Business.Impl;
|
|
using Lskj.Control;
|
|
using Lskj.Control.Model;
|
|
using Lskj.Data;
|
|
using Lskj.Model;
|
|
using Lskj.Util;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Lskj.Workflow.Control
|
|
{
|
|
public partial class StepPage4 : UserControl
|
|
{
|
|
/// <summary>
|
|
/// 模块编号
|
|
/// </summary>
|
|
private string mMenuCode;
|
|
/// <summary>
|
|
/// 基础对象
|
|
/// </summary>
|
|
public ModuleModel moduleModel;
|
|
/// <summary>
|
|
/// 主页转过来的操作权限
|
|
/// </summary>
|
|
public bool SerpPagePower;
|
|
|
|
public StepPage4()
|
|
{
|
|
InitializeComponent();
|
|
this.labelTextEdit1.TextEdit.EditValueChanged += new EventHandler(OnUserEditValueChanged);
|
|
this.labelComboxEdit1.TextEdit.EditValueChanged += new EventHandler(OnDepEditValueChanged);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:部门下拉框值改变后</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
|
|
void OnDepEditValueChanged(object sender, EventArgs e)
|
|
{
|
|
string depid = this.labelComboxEdit1.EditValue;
|
|
string mf = this.labelTextEdit1.EditText;
|
|
|
|
DataTable table = 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 = WorkFlowBillImpl.GetWorkFlowUsers(depid, mf);
|
|
DataTable Roletable = WorkFlowBillImpl.GetWorkFlowRole(mf);
|
|
this.gridControl.DataSource = table;
|
|
this.gridControl1.DataSource = Roletable;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 初始化
|
|
/// </summary>
|
|
/// <param name="menuCode"></param>
|
|
public void InitializeControl(string menuCode)
|
|
{
|
|
this.mMenuCode = menuCode;
|
|
this.InitializeUsers();
|
|
this.InitializeDeps();
|
|
this.initialLoad();
|
|
}
|
|
|
|
|
|
/// <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 dragGrid2 = new GridDragMemo(this.gridView, this.memoEdit2);
|
|
dragGrid2.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
|
|
GridDragMemo dragGrid4 = new GridDragMemo(this.gridView2, this.memoEdit2);
|
|
dragGrid4.OnDragComplete += new GridFragMemoEditCompleteEventHandler(OnDragGridCompleted2);
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:初始化部门数据</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2019-06-24 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
private void InitializeDeps()
|
|
{
|
|
DataTable table = WorkFlowBillImpl.GetDeps();
|
|
|
|
this.labelComboxEdit1.ValueMember = "departmentid";
|
|
this.labelComboxEdit1.ValueField = "departmentid";
|
|
this.labelComboxEdit1.TextField = "departmentname";
|
|
this.labelComboxEdit1.SetDataSource(table);
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <para>说明:表格拖拽完成</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-14 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <param name="sender">The sender.</param>
|
|
/// <param name="e">The e.</param>
|
|
void OnDragGridCompleted2(object sender, GridDragMemoArgs e)
|
|
{
|
|
if (e.GridViewSelectRows == null || e.GridViewSelectRows.Length == 0) return;
|
|
|
|
try
|
|
{
|
|
string userNames = string.Empty;
|
|
string RoleNames = string.Empty;
|
|
if (e.SourceGridViewObj.Name == "gridView")
|
|
{
|
|
foreach (DataRow item in e.GridViewSelectRows)
|
|
{
|
|
userNames += item["employeename"] + ",";
|
|
}
|
|
|
|
}
|
|
else if (e.SourceGridViewObj.Name == "gridView2")
|
|
{
|
|
foreach (DataRow item in e.GridViewSelectRows)
|
|
{
|
|
userNames += "{&" + item["roleName"] + "&},";
|
|
}
|
|
//userNames = PowerImpl.getAllPersonnel(userNames);
|
|
//if (userNames.Equals(",")) userNames = "";
|
|
}
|
|
|
|
//List<System.String> namesList = new List<System.String>((this.memoEdit2.EditValue + "").Split(','));
|
|
//foreach (string item in userNames.Split(','))
|
|
//{
|
|
// if (!namesList.Exists(t => t.Equals(item)))
|
|
// {
|
|
// this.memoEdit2.EditValue += item + ",";
|
|
// }
|
|
|
|
//}
|
|
|
|
this.memoEdit2.EditValue += userNames;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Instance.WriteError(ex);
|
|
MessageUtil.Show(ResourceKeys.OperFault);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// <para>说明:验证数据合法性</para>
|
|
/// <para>创建人:龚宇超</para>
|
|
/// <para>创建日期:2017-11-06 </para>
|
|
/// <para>修改人:</para>
|
|
/// <para>修改日期:</para>
|
|
/// <para>修改备注:</para>
|
|
/// <para>版本:1.0</para>
|
|
/// </summary>
|
|
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
public bool VerifyNull()
|
|
{
|
|
foreach (System.Windows.Forms.Control item in groupBox1.Controls)
|
|
{
|
|
if (item is LabelTextEdit)
|
|
{
|
|
LabelTextEdit textEdit = item as LabelTextEdit;
|
|
if (string.IsNullOrEmpty(textEdit.EditText) && textEdit.Required)
|
|
{
|
|
textEdit.Focus();
|
|
MessageUtil.Show(textEdit.LabelText + "不能为空!");
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public void UpdateFinalReturnSettings()
|
|
{
|
|
if (this.VerifyNull())
|
|
{
|
|
string sql = this.memoEdit1.EditValue + "";
|
|
string name = this.memoEdit2.EditValue + "";
|
|
bool result = WorkFlowBillImpl.UpdateFinalReturnSettings(sql, name, mMenuCode);
|
|
|
|
MessageUtil.Show(result ? "保存成功!" : "保存失败!");
|
|
}
|
|
}
|
|
|
|
//初始加载终审回退sql和终审回退人员信息
|
|
public void initialLoad()
|
|
{
|
|
DataTable dataTable = WorkFlowBillImpl.getFinalBack(mMenuCode);
|
|
if (dataTable.Rows.Count > 0)
|
|
{
|
|
this.memoEdit1.Text = dataTable.Rows[0]["OverBackSql"] + "";
|
|
|