using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace OrdersControl
{
	/// <summary>
	/// Summary description for UserControl1.
	/// </summary>
	public class UserControl1 : System.Windows.Forms.UserControl
	{
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.TextBox textBox1;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public UserControl1()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitComponent call

		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if( components != null )
					components.Dispose();
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.button1 = new System.Windows.Forms.Button();
			this.label1 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(16, 112);
			this.button1.Name = "button1";
			this.button1.TabIndex = 0;
			this.button1.Text = "购买";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(8, 24);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(56, 23);
			this.label1.TabIndex = 1;
			this.label1.Text = "订单号：";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(88, 24);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(72, 23);
			this.label2.TabIndex = 2;
			// 
			// textBox1
			// 
			this.textBox1.Location = new System.Drawing.Point(88, 56);
			this.textBox1.Name = "textBox1";
			this.textBox1.Size = new System.Drawing.Size(72, 21);
			this.textBox1.TabIndex = 3;
			this.textBox1.Text = "数量";
			// 
			// UserControl1
			// 
			this.Controls.Add(this.textBox1);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.label1);
			this.Controls.Add(this.button1);
			this.Name = "UserControl1";
			this.Size = new System.Drawing.Size(168, 160);
			this.ResumeLayout(false);

		}
		#endregion

		 OrderWS.OrderDetails OD;
		private void button1_Click(object sender, System.EventArgs e)
		{
			try
			{
				OrderWS.InstantOrder IOrder=new OrdersControl.OrderWS.InstantOrder();
				this.OD=IOrder.OrderItem("cjx@lager.com.cn","windows",355,int.Parse(this.textBox1.Text));
				this.label2.Text=this.OD.oderID;
			}
			catch(System.Exception ea)
			{
				MessageBox.Show(ea.Message);
			}
		}
/// <summary>
/// 订单细节属性
/// </summary>
		public OrderWS.OrderDetails OrderDetail
		{
			get
			{
				return this.OD ;
			}
		}

	}
}
