📄 frmdispset.cs
字号:
/*
*author: l_dragon email:l_dragon2000@163.com
* last update:2003/04/03
* */
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace gdiFlow
{
/// <summary>
/// frmDispSet 的摘要说明。
/// </summary>
public class frmDispSet : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox TxtDealName;
private System.Windows.Forms.TextBox TxtPrompt;
private System.Windows.Forms.ComboBox CmbLimit;
private System.Windows.Forms.Button CmdOK;
private System.Windows.Forms.Button CmdQuit;
private FlowDisposal priDisp;
private ArrayList aryTempDisposal=new ArrayList();
private ArrayList aryTempStatus= new ArrayList();
private System.Windows.Forms.ComboBox ComPassState;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public frmDispSet()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.TxtDealName = new System.Windows.Forms.TextBox();
this.TxtPrompt = new System.Windows.Forms.TextBox();
this.ComPassState = new System.Windows.Forms.ComboBox();
this.CmbLimit = new System.Windows.Forms.ComboBox();
this.CmdOK = new System.Windows.Forms.Button();
this.CmdQuit = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(16, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 16);
this.label1.TabIndex = 0;
this.label1.Text = "处理名:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(16, 56);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 16);
this.label2.TabIndex = 1;
this.label2.Text = "处理提示:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(16, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 16);
this.label3.TabIndex = 2;
this.label3.Text = "经办状态:";
//
// label4
//
this.label4.Location = new System.Drawing.Point(16, 160);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 16);
this.label4.TabIndex = 3;
this.label4.Text = "组限制:";
//
// TxtDealName
//
this.TxtDealName.Location = new System.Drawing.Point(80, 11);
this.TxtDealName.Name = "TxtDealName";
this.TxtDealName.Size = new System.Drawing.Size(184, 21);
this.TxtDealName.TabIndex = 4;
this.TxtDealName.Text = "";
//
// TxtPrompt
//
this.TxtPrompt.Location = new System.Drawing.Point(80, 51);
this.TxtPrompt.Name = "TxtPrompt";
this.TxtPrompt.Size = new System.Drawing.Size(184, 21);
this.TxtPrompt.TabIndex = 5;
this.TxtPrompt.Text = "";
//
// ComPassState
//
this.ComPassState.Location = new System.Drawing.Point(80, 100);
this.ComPassState.Name = "ComPassState";
this.ComPassState.Size = new System.Drawing.Size(184, 20);
this.ComPassState.TabIndex = 6;
this.ComPassState.Text = "ComPassState";
//
// CmbLimit
//
this.CmbLimit.Location = new System.Drawing.Point(80, 156);
this.CmbLimit.Name = "CmbLimit";
this.CmbLimit.Size = new System.Drawing.Size(184, 20);
this.CmbLimit.TabIndex = 7;
this.CmbLimit.Text = "CmbLimit";
//
// CmdOK
//
this.CmdOK.Location = new System.Drawing.Point(80, 200);
this.CmdOK.Name = "CmdOK";
this.CmdOK.Size = new System.Drawing.Size(56, 24);
this.CmdOK.TabIndex = 8;
this.CmdOK.Text = "确认";
this.CmdOK.Click += new System.EventHandler(this.CmdOK_Click);
//
// CmdQuit
//
this.CmdQuit.Location = new System.Drawing.Point(192, 200);
this.CmdQuit.Name = "CmdQuit";
this.CmdQuit.Size = new System.Drawing.Size(56, 24);
this.CmdQuit.TabIndex = 8;
this.CmdQuit.Text = "取消";
this.CmdQuit.Click += new System.EventHandler(this.CmdQuit_Click);
//
// frmDispSet
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(288, 245);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.CmdOK,
this.CmbLimit,
this.ComPassState,
this.TxtPrompt,
this.TxtDealName,
this.label4,
this.label3,
this.label2,
this.label1,
this.CmdQuit});
this.Name = "frmDispSet";
this.Text = "frmDispSet";
this.Load += new System.EventHandler(this.frmDispSet_Load);
this.ResumeLayout(false);
}
#endregion
public void setThisDisposal(FlowDisposal objDisposal)//将选中的处理对象传递给属性设置form
{
this.priDisp=objDisposal;
}
public void setAryStatus(ArrayList arytemp)//将状态对象列表传递给属性设置form,用来设置经办状态
{
this.aryTempStatus=arytemp;
}
public void setAryDisposal(ArrayList arytemp2)//将处理对象列表传递给属性设置form,用来设置经办状态
{
this.aryTempDisposal=arytemp2;
}
private void frmDispSet_Load(object sender, System.EventArgs e)
{
string StrPassState="";
if(this.priDisp!=null)
{
TxtDealName.Text=priDisp.strDisposalName;
TxtPrompt.Text = priDisp.strDisposalHint;
}
//列出组限制
CmbLimit.Items.Add("显示所有角色用户");
CmbLimit.Items.Add("只显示同组角色用户");
//组限制----0:显示所有角色用户;1:只显示同组角色用户
if(priDisp.intGroupLimit==0)
{
CmbLimit.SelectedIndex=0;
}
else
{
CmbLimit.SelectedIndex=1;
}
//列出所有的经办状态
this.ComPassState.Items.Add("(无)");
if(this.aryTempStatus!=null)
{
foreach(FlowStatus item in this.aryTempStatus)
{
if(item.blDisplay)//状态对象没有被删除
{
if(item.intStatusTypeId==0||item.intStatusTypeId==2)//状态类型为开始状态或者普通状态;
{
this.ComPassState.Items.Add(item.strStatusName);
}
}
}
}
// 显示现有的经办状态
if(this.priDisp.transactStatus==null)
{
this.ComPassState.Text="(无)";
}
else
{
StrPassState = this.priDisp.transactStatus.strStatusName;
this.ComPassState.Text =StrPassState;
}
}
private void CmdQuit_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void CmdOK_Click(object sender, System.EventArgs e)
{
string strDispName=this.TxtDealName.Text.Trim();
if(strDispName=="")
{
MessageBox.Show("处理名称不能为空!");
return;
}
foreach(FlowDisposal item in this.aryTempDisposal)
{
if((item.dblDisposalId!=this.priDisp.dblDisposalId)&& strDispName.Equals(item.strDisposalName))
{
MessageBox.Show("处理名重复!");
return;
}
}
this.priDisp.strDisposalName=strDispName;
this.priDisp.strDisposalHint=this.TxtPrompt.Text.Trim();
if(this.ComPassState.Text.Trim().Equals("(无)")||this.ComPassState.Text.Trim().Equals(""))
{
this.priDisp.transactStatus=null;
}
else// 找到该状态,再将该状态作为经办状态赋值
{
string strTxtTemp=this.ComPassState.Text.Trim();
foreach(FlowStatus item in this.aryTempStatus) {
if(item.strStatusName.Equals(strTxtTemp))
{
this.priDisp.transactStatus=item;
}
}
}
this.priDisp.intGroupLimit=this.CmbLimit.SelectedIndex;
this.Close();
}//end Method
}//end class
}//end nameSpace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -