using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

namespace yn165.admin
{
	/// <summary>
	/// ad_editorder 的摘要说明。
	/// </summary>
	public class ad_editorder : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.TextBox way;
		protected System.Web.UI.WebControls.TextBox explain;
		protected System.Web.UI.WebControls.TextBox domain;
		protected System.Web.UI.WebControls.TextBox ftpname;
		protected System.Web.UI.WebControls.TextBox ftppass;
		protected System.Web.UI.WebControls.Label order_number;
		protected System.Web.UI.WebControls.Label order_date;
		protected System.Web.UI.WebControls.Label account;
		protected System.Web.UI.WebControls.ImageButton ImageButton1;
		protected System.Web.UI.WebControls.TextBox state;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if(!IsPostBack)
			{
				SqlConnection conn = new SqlConnection("server=211.155.254.117;database=yn165;uid=yn165;pwd=159753");
				conn.Open();
				string sql ="select * from ordersheet where order_number='" + Request["order_number"] + "'";
				SqlCommand cmd = new SqlCommand(sql,conn);
				SqlDataReader reader = cmd.ExecuteReader();
				if(reader.Read())
				{
					
					this.order_number.Text=reader.GetValue(1).ToString();
					this.order_date.Text=reader.GetValue(3).ToString();
					this.account.Text=reader.GetValue(2).ToString();
					this.state.Text=reader.GetValue(4).ToString();
					this.way.Text=reader.GetValue(6).ToString();
					this.explain.Text=reader.GetValue(7).ToString();
					this.domain.Text=reader.GetValue(8).ToString();
					this.ftpname.Text=reader.GetValue(9).ToString();
					this.ftppass.Text=reader.GetValue(10).ToString();
				}
		

			}
			// 在此处放置用户代码以初始化页面
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN：该调用是 ASP.NET Web 窗体设计器所必需的。
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		private void InitializeComponent()
		{    
			this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
		{
		
			SqlConnection conn = new SqlConnection("server=211.155.254.117;database=yn165;uid=yn165;pwd=159753");
			conn.Open();
			string sql ="update ordersheet set state='" + this.state.Text + "', way='" + this.way.Text + "',explain='" + 
				this.explain.Text + "', bdomain='" + this.domain.Text + "',ftpname='" + this.ftpname.Text + "',ftppass='" + 
				this.ftppass.Text + "' where order_number='" + Request["order_number"] + "'";
			SqlCommand cmd = new SqlCommand(sql,conn);
			cmd.ExecuteNonQuery();
			cmd.Dispose();
			conn.Close();
			this.Response.Redirect("003.aspx");
		}
	}
}
