常见的C#窗体间的传值(一)
2015-11-10 11:07
661 查看
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;
using XM.OA.Model;
namespace XM.OA.Office.Report
{
public partial class FormOrdersPrintSearch : Form
{
private FormRushSuitsOrdersPrint formRushSuitsOrdersPrint = null;
private FormRushCoatOrdersPrint formRushCoatOrdersPrint = null;
private FormRushShirtOrdersPrint formRushShirtOrdersPrint = null;
private FormRushVestOrdersPrint formRushVestOrdersPrint = null;
private FormRushPantOrdersPrint formRushPantOrdersPrint = null;
private FormSuitDeliveryOrdersPrint formSuitDeliveryOrdersPrint = null;
private FormCoatDeliveryOrdersPrint formCoatDeliveryOrdersPrint = null;
private FormShirtDeliveryOrdersPrint formShirtDeliveryOrdersPrint = null;
private FormVestDeliveryOrdersPrint formVestDeliveryOrdersPrint = null;
private FormPantDeliveryOrdersPrint formPantDeliveryOrdersPrint = null;
private FormCoatEmbroideryOrdersPrint formCoatEmbroideryOrdersPrint = null;
private FormShirtEmbroideryPrint formShirtEmbroideryPrint = null;
private FormPantEmbroideryOrdersPrint formPantEmbroideryOrdersPrint = null;
private OrdersPrintSearchModel printSearchModel = null;
public const string RushSuitsOrdersPrint = "西装催货单";
public const string RushCoatOrdersPrint = "上衣催货单";
public const string RushShirtOrdersPrint = "衬衫催货单";
public const string RushVestOrdersPrint = "马甲催货单";
public const string RushPantOrdersPrint = "裤子催货单";
public const string SuitDeliveryOrdersPrint = "西装出货单";
public const string CoatDeliveryOrdersPrint = "上衣出货单";
public const string ShirtDeliveryOrdersPrint = "衬衫出货单";
public const string VestDeliveryOrdersPrint = "马甲出货单";
public const string PantDeliveryOrdersPrint = "裤子出货单";
public const string CoatEmbroideryOrdersPrint = "上衣绣字单";
public const string ShirtEmbroideryPrint = "衬衫绣字单";
public const string PantEmbroideryOrdersPrint = "裤子绣字单";
public FormOrdersPrintSearch()
{
InitializeComponent();
}
public FormOrdersPrintSearch(FormRushSuitsOrdersPrint _formRushSuitsOrdersPrint, FormRushCoatOrdersPrint _formRushCoatOrdersPrint, FormRushShirtOrdersPrint _formRushShirtOrdersPrint, FormRushVestOrdersPrint _formRushVestOrdersPrint, FormRushPantOrdersPrint
_formRushPantOrdersPrint, FormSuitDeliveryOrdersPrint _formSuitDeliveryOrdersPrint, FormCoatDeliveryOrdersPrint _formCoatDeliveryOrdersPrint, FormShirtDeliveryOrdersPrint _formShirtDeliveryOrdersPrint, FormVestDeliveryOrdersPrint _formVestDeliveryOrdersPrint,
FormPantDeliveryOrdersPrint _formPantDeliveryOrdersPrint, FormCoatEmbroideryOrdersPrint _formCoatEmbroideryOrdersPrint, FormShirtEmbroideryPrint _formShirtEmbroideryPrint,FormPantEmbroideryOrdersPrint _formPantEmbroideryOrdersPrint)
{
InitializeComponent();
this.formRushSuitsOrdersPrint = _formRushSuitsOrdersPrint;
this.formRushCoatOrdersPrint = _formRushCoatOrdersPrint;
this.formRushShirtOrdersPrint = _formRushShirtOrdersPrint;
this.formRushVestOrdersPrint = _formRushVestOrdersPrint;
this.formRushPantOrdersPrint = _formRushPantOrdersPrint;
this.formSuitDeliveryOrdersPrint = _formSuitDeliveryOrdersPrint;
this.formCoatDeliveryOrdersPrint = _formCoatDeliveryOrdersPrint;
this.formShirtDeliveryOrdersPrint = _formShirtDeliveryOrdersPrint;
this.formVestDeliveryOrdersPrint = _formVestDeliveryOrdersPrint;
this.formPantDeliveryOrdersPrint = _formPantDeliveryOrdersPrint;
this.formCoatEmbroideryOrdersPrint = _formCoatEmbroideryOrdersPrint;
this.formShirtEmbroideryPrint = _formShirtEmbroideryPrint;
this.formPantEmbroideryOrdersPrint = _formPantEmbroideryOrdersPrint;
}
public FormOrdersPrintSearch(FormRushSuitsOrdersPrint _formRushSuitsOrdersPrint, FormRushCoatOrdersPrint _formRushCoatOrdersPrint, FormRushShirtOrdersPrint _formRushShirtOrdersPrint, FormRushVestOrdersPrint _formRushVestOrdersPrint, FormRushPantOrdersPrint
_formRushPantOrdersPrint, FormSuitDeliveryOrdersPrint _formSuitDeliveryOrdersPrint, FormCoatDeliveryOrdersPrint _formCoatDeliveryOrdersPrint, FormShirtDeliveryOrdersPrint _formShirtDeliveryOrdersPrint, FormVestDeliveryOrdersPrint _formVestDeliveryOrdersPrint,
FormPantDeliveryOrdersPrint _formPantDeliveryOrdersPrint, FormCoatEmbroideryOrdersPrint _formCoatEmbroideryOrdersPrint, FormShirtEmbroideryPrint _formShirtEmbroideryPrint,FormPantEmbroideryOrdersPrint _formPantEmbroideryOrdersPrint,OrdersPrintSearchModel _printSearchModel)
{
InitializeComponent();
this.formRushSuitsOrdersPrint = _formRushSuitsOrdersPrint;
this.formRushCoatOrdersPrint = _formRushCoatOrdersPrint;
this.formRushShirtOrdersPrint = _formRushShirtOrdersPrint;
this.formRushVestOrdersPrint = _formRushVestOrdersPrint;
this.formRushPantOrdersPrint = _formRushPantOrdersPrint;
this.formSuitDeliveryOrdersPrint = _formSuitDeliveryOrdersPrint;
this.formCoatDeliveryOrdersPrint = _formCoatDeliveryOrdersPrint;
this.formShirtDeliveryOrdersPrint = _formShirtDeliveryOrdersPrint;
this.formVestDeliveryOrdersPrint = _formVestDeliveryOrdersPrint;
this.formPantDeliveryOrdersPrint = _formPantDeliveryOrdersPrint;
this.formCoatEmbroideryOrdersPrint = _formCoatEmbroideryOrdersPrint;
this.formShirtEmbroideryPrint = _formShirtEmbroideryPrint;
this.formPantEmbroideryOrdersPrint = _formPantEmbroideryOrdersPrint; ;
this.printSearchModel = _printSearchModel;
}
private void FormOrdersPrintSearch_Load(object sender, EventArgs e)
{
if (printSearchModel != null)
{
dtpBeginOrderDate.Value = printSearchModel.BeginOrderDate;
dtpEndOrderDate.Value = printSearchModel.EndOrderDate;
txtTranNo.Text = printSearchModel.TranNo;
txtOrderNo.Text = printSearchModel.OrderNo;
}
}
private void btnSearch_Click(object sender, EventArgs e)
{
string BeginOrderDate = dtpBeginOrderDate.Value.ToString();
string EndOrderDate = dtpEndOrderDate.Value.ToString();
string TranNo = txtTranNo.Text.Trim();
string OrderNo = txtOrderNo.Text.Trim();
if (this.cboSearch.Text.Equals(RushCoatOrdersPrint))
{
FormRushCoatOrdersPrint OrdersPrint = new FormRushCoatOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushSuitsOrdersPrint))
{
FormRushSuitsOrdersPrint OrdersPrint = new FormRushSuitsOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushShirtOrdersPrint))
{
FormRushShirtOrdersPrint OrdersPrint = new FormRushShirtOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushVestOrdersPrint))
{
FormRushVestOrdersPrint OrdersPrint = new FormRushVestOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushPantOrdersPrint))
{
FormRushPantOrdersPrint OrdersPrint = new FormRushPantOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(SuitDeliveryOrdersPrint))
{
FormSuitDeliveryOrdersPrint OrdersPrint = new FormSuitDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(CoatDeliveryOrdersPrint))
{
FormCoatDeliveryOrdersPrint OrdersPrint = new FormCoatDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(ShirtDeliveryOrdersPrint))
{
FormShirtDeliveryOrdersPrint OrdersPrint = new FormShirtDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(VestDeliveryOrdersPrint))
{
FormVestDeliveryOrdersPrint OrdersPrint = new FormVestDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(PantDeliveryOrdersPrint))
{
FormPantDeliveryOrdersPrint OrdersPrint = new FormPantDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(CoatEmbroideryOrdersPrint))
{
FormCoatEmbroideryOrdersPrint OrdersPrint = new FormCoatEmbroideryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(ShirtEmbroideryPrint))
{
FormShirtEmbroideryPrint OrdersPrint = new FormShirtEmbroideryPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(PantEmbroideryOrdersPrint))
{
FormPantEmbroideryOrdersPrint OrdersPrint = new FormPantEmbroideryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
}
private void btnClose_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("确定关闭?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
this.Close();
}
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using XM.OA.Model;
namespace XM.OA.Office.Report
{
public partial class FormOrdersPrintSearch : Form
{
private FormRushSuitsOrdersPrint formRushSuitsOrdersPrint = null;
private FormRushCoatOrdersPrint formRushCoatOrdersPrint = null;
private FormRushShirtOrdersPrint formRushShirtOrdersPrint = null;
private FormRushVestOrdersPrint formRushVestOrdersPrint = null;
private FormRushPantOrdersPrint formRushPantOrdersPrint = null;
private FormSuitDeliveryOrdersPrint formSuitDeliveryOrdersPrint = null;
private FormCoatDeliveryOrdersPrint formCoatDeliveryOrdersPrint = null;
private FormShirtDeliveryOrdersPrint formShirtDeliveryOrdersPrint = null;
private FormVestDeliveryOrdersPrint formVestDeliveryOrdersPrint = null;
private FormPantDeliveryOrdersPrint formPantDeliveryOrdersPrint = null;
private FormCoatEmbroideryOrdersPrint formCoatEmbroideryOrdersPrint = null;
private FormShirtEmbroideryPrint formShirtEmbroideryPrint = null;
private FormPantEmbroideryOrdersPrint formPantEmbroideryOrdersPrint = null;
private OrdersPrintSearchModel printSearchModel = null;
public const string RushSuitsOrdersPrint = "西装催货单";
public const string RushCoatOrdersPrint = "上衣催货单";
public const string RushShirtOrdersPrint = "衬衫催货单";
public const string RushVestOrdersPrint = "马甲催货单";
public const string RushPantOrdersPrint = "裤子催货单";
public const string SuitDeliveryOrdersPrint = "西装出货单";
public const string CoatDeliveryOrdersPrint = "上衣出货单";
public const string ShirtDeliveryOrdersPrint = "衬衫出货单";
public const string VestDeliveryOrdersPrint = "马甲出货单";
public const string PantDeliveryOrdersPrint = "裤子出货单";
public const string CoatEmbroideryOrdersPrint = "上衣绣字单";
public const string ShirtEmbroideryPrint = "衬衫绣字单";
public const string PantEmbroideryOrdersPrint = "裤子绣字单";
public FormOrdersPrintSearch()
{
InitializeComponent();
}
public FormOrdersPrintSearch(FormRushSuitsOrdersPrint _formRushSuitsOrdersPrint, FormRushCoatOrdersPrint _formRushCoatOrdersPrint, FormRushShirtOrdersPrint _formRushShirtOrdersPrint, FormRushVestOrdersPrint _formRushVestOrdersPrint, FormRushPantOrdersPrint
_formRushPantOrdersPrint, FormSuitDeliveryOrdersPrint _formSuitDeliveryOrdersPrint, FormCoatDeliveryOrdersPrint _formCoatDeliveryOrdersPrint, FormShirtDeliveryOrdersPrint _formShirtDeliveryOrdersPrint, FormVestDeliveryOrdersPrint _formVestDeliveryOrdersPrint,
FormPantDeliveryOrdersPrint _formPantDeliveryOrdersPrint, FormCoatEmbroideryOrdersPrint _formCoatEmbroideryOrdersPrint, FormShirtEmbroideryPrint _formShirtEmbroideryPrint,FormPantEmbroideryOrdersPrint _formPantEmbroideryOrdersPrint)
{
InitializeComponent();
this.formRushSuitsOrdersPrint = _formRushSuitsOrdersPrint;
this.formRushCoatOrdersPrint = _formRushCoatOrdersPrint;
this.formRushShirtOrdersPrint = _formRushShirtOrdersPrint;
this.formRushVestOrdersPrint = _formRushVestOrdersPrint;
this.formRushPantOrdersPrint = _formRushPantOrdersPrint;
this.formSuitDeliveryOrdersPrint = _formSuitDeliveryOrdersPrint;
this.formCoatDeliveryOrdersPrint = _formCoatDeliveryOrdersPrint;
this.formShirtDeliveryOrdersPrint = _formShirtDeliveryOrdersPrint;
this.formVestDeliveryOrdersPrint = _formVestDeliveryOrdersPrint;
this.formPantDeliveryOrdersPrint = _formPantDeliveryOrdersPrint;
this.formCoatEmbroideryOrdersPrint = _formCoatEmbroideryOrdersPrint;
this.formShirtEmbroideryPrint = _formShirtEmbroideryPrint;
this.formPantEmbroideryOrdersPrint = _formPantEmbroideryOrdersPrint;
}
public FormOrdersPrintSearch(FormRushSuitsOrdersPrint _formRushSuitsOrdersPrint, FormRushCoatOrdersPrint _formRushCoatOrdersPrint, FormRushShirtOrdersPrint _formRushShirtOrdersPrint, FormRushVestOrdersPrint _formRushVestOrdersPrint, FormRushPantOrdersPrint
_formRushPantOrdersPrint, FormSuitDeliveryOrdersPrint _formSuitDeliveryOrdersPrint, FormCoatDeliveryOrdersPrint _formCoatDeliveryOrdersPrint, FormShirtDeliveryOrdersPrint _formShirtDeliveryOrdersPrint, FormVestDeliveryOrdersPrint _formVestDeliveryOrdersPrint,
FormPantDeliveryOrdersPrint _formPantDeliveryOrdersPrint, FormCoatEmbroideryOrdersPrint _formCoatEmbroideryOrdersPrint, FormShirtEmbroideryPrint _formShirtEmbroideryPrint,FormPantEmbroideryOrdersPrint _formPantEmbroideryOrdersPrint,OrdersPrintSearchModel _printSearchModel)
{
InitializeComponent();
this.formRushSuitsOrdersPrint = _formRushSuitsOrdersPrint;
this.formRushCoatOrdersPrint = _formRushCoatOrdersPrint;
this.formRushShirtOrdersPrint = _formRushShirtOrdersPrint;
this.formRushVestOrdersPrint = _formRushVestOrdersPrint;
this.formRushPantOrdersPrint = _formRushPantOrdersPrint;
this.formSuitDeliveryOrdersPrint = _formSuitDeliveryOrdersPrint;
this.formCoatDeliveryOrdersPrint = _formCoatDeliveryOrdersPrint;
this.formShirtDeliveryOrdersPrint = _formShirtDeliveryOrdersPrint;
this.formVestDeliveryOrdersPrint = _formVestDeliveryOrdersPrint;
this.formPantDeliveryOrdersPrint = _formPantDeliveryOrdersPrint;
this.formCoatEmbroideryOrdersPrint = _formCoatEmbroideryOrdersPrint;
this.formShirtEmbroideryPrint = _formShirtEmbroideryPrint;
this.formPantEmbroideryOrdersPrint = _formPantEmbroideryOrdersPrint; ;
this.printSearchModel = _printSearchModel;
}
private void FormOrdersPrintSearch_Load(object sender, EventArgs e)
{
if (printSearchModel != null)
{
dtpBeginOrderDate.Value = printSearchModel.BeginOrderDate;
dtpEndOrderDate.Value = printSearchModel.EndOrderDate;
txtTranNo.Text = printSearchModel.TranNo;
txtOrderNo.Text = printSearchModel.OrderNo;
}
}
private void btnSearch_Click(object sender, EventArgs e)
{
string BeginOrderDate = dtpBeginOrderDate.Value.ToString();
string EndOrderDate = dtpEndOrderDate.Value.ToString();
string TranNo = txtTranNo.Text.Trim();
string OrderNo = txtOrderNo.Text.Trim();
if (this.cboSearch.Text.Equals(RushCoatOrdersPrint))
{
FormRushCoatOrdersPrint OrdersPrint = new FormRushCoatOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushSuitsOrdersPrint))
{
FormRushSuitsOrdersPrint OrdersPrint = new FormRushSuitsOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushShirtOrdersPrint))
{
FormRushShirtOrdersPrint OrdersPrint = new FormRushShirtOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushVestOrdersPrint))
{
FormRushVestOrdersPrint OrdersPrint = new FormRushVestOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(RushPantOrdersPrint))
{
FormRushPantOrdersPrint OrdersPrint = new FormRushPantOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(SuitDeliveryOrdersPrint))
{
FormSuitDeliveryOrdersPrint OrdersPrint = new FormSuitDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(CoatDeliveryOrdersPrint))
{
FormCoatDeliveryOrdersPrint OrdersPrint = new FormCoatDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(ShirtDeliveryOrdersPrint))
{
FormShirtDeliveryOrdersPrint OrdersPrint = new FormShirtDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(VestDeliveryOrdersPrint))
{
FormVestDeliveryOrdersPrint OrdersPrint = new FormVestDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(PantDeliveryOrdersPrint))
{
FormPantDeliveryOrdersPrint OrdersPrint = new FormPantDeliveryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(CoatEmbroideryOrdersPrint))
{
FormCoatEmbroideryOrdersPrint OrdersPrint = new FormCoatEmbroideryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(ShirtEmbroideryPrint))
{
FormShirtEmbroideryPrint OrdersPrint = new FormShirtEmbroideryPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
if (this.cboSearch.Text.Equals(PantEmbroideryOrdersPrint))
{
FormPantEmbroideryOrdersPrint OrdersPrint = new FormPantEmbroideryOrdersPrint(BeginOrderDate, EndOrderDate, TranNo, OrderNo);
OrdersPrint.Show();
}
}
private void btnClose_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("确定关闭?", "操作提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
this.Close();
}
}
}
}
相关文章推荐
- C# 设置word文档页面大小
- C# ListView 列宽随窗体的宽度改变
- 【工具】C# DataTable导出到Excel
- c# webBrowser下载图片
- 初次接触C#
- C# 的三种序列化方法
- C# 序列化数据保存在本地
- c# 更改表格字段
- C#调用Excel的宏
- C# Brushes
- C#语言 ArrayList集合
- C# XML读写示例
- c#??操作符
- 【Head-First设计模式】C#版-学习笔记-开篇及文章目录
- .NET Nancy 详解(二) 简易路由实现
- NFA-DFA(c++实现代码c#实现画图)
- C#中通过三边长判断三角形类型
- C# 序列化(总)
- C# 序列化(总)
- C# Protobuf-Net 序列化