📄 finish_orderform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace test007
{
/// <summary>
/// finish_orderForm 的摘要说明。
/// </summary>
public class finish_orderForm : System.Windows.Forms.Form
{
private DataSet ds = new DataSet();
private LinkDataBase link = new LinkDataBase();
private string sendTableName = "ordertran";
private string sendStrSQL = "SELECT * FROM ordertran where 订单状态='1'";
public static string ordernum11;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public finish_orderForm()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.ds= link.SelectDataBase(sendStrSQL,sendTableName);//创建数据库连接
dataGrid1.DataSource = ds.Tables[0];
DataBingingsFunction();
//
// 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.dataGrid1 = new System.Windows.Forms.DataGrid();
this.label2 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.Location = new System.Drawing.Point(32, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(120, 24);
this.label1.TabIndex = 0;
this.label1.Text = "历史订单列表:";
//
// dataGrid1
//
this.dataGrid1.CaptionVisible = false;
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(32, 64);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.Size = new System.Drawing.Size(664, 208);
this.dataGrid1.TabIndex = 1;
//
// label2
//
this.label2.Location = new System.Drawing.Point(216, 296);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 16);
this.label2.TabIndex = 3;
this.label2.Text = "订单编号:";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(296, 296);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(168, 21);
this.textBox1.TabIndex = 4;
this.textBox1.Text = "";
//
// button1
//
this.button1.Location = new System.Drawing.Point(184, 344);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(360, 32);
this.button1.TabIndex = 5;
this.button1.Text = "查看此订单的回执信息";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// finish_orderForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(720, 445);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.textBox1,
this.label2,
this.dataGrid1,
this.label1});
this.Name = "finish_orderForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "已完成订单管理";
this.Load += new System.EventHandler(this.finish_orderForm_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private void DataBingingsFunction()
{
this.textBox1.DataBindings.Add("Text",ds.Tables[0],"订单编号");
}
private void finish_orderForm_Load(object sender, System.EventArgs e)
{
}
private void button1_Click(object sender, System.EventArgs e)
{
ordernum11=this.textBox1.Text.Trim();
the_return_orderForm trm=new the_return_orderForm();
trm.Show();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -