using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Bll;

public partial class OrdersManage_OrderStatus4 : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		if (Convert.ToString(Session["username"]) == "")
		{
			Response.Write("<script language=javascript>alert('请登录');location='../login.aspx'</script>");
		}
		if (!IsPostBack)
		{
			this.Bind();
		}
	}

	/// <summary>
	/// 页面初始化
	/// </summary>
	public void Bind()
	{
		DataSet ds = new DataSet();
		OrdersBll ob = new OrdersBll();
		ds = ob.GetOrdersInfo(Constext.Orders_Delivery_Bottle,Constext.Orders_Finish);
		GridView1.DataSource = ds.Tables["Orders"];
		GridView1.DataBind();
	}

	protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
	{
		GridView1.PageIndex = e.NewPageIndex;
		this.Bind();
	}

	protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
	{
		OrdersBll ob = new OrdersBll();
		string id = GridView1.Rows[e.NewEditIndex].Cells[0].Text.ToString();
		ob.EiditOrder(Constext.Orders_Finish, id);
		this.Bind();
	}
}
