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 System.Text;
namespace KuGo.Web.Admin
{
        public partial class ProductsRead : Page
        {
            
            protected void Page_Load(object sender, EventArgs e){
            if (!Page.IsPostBack){
              if (Request.Params["id"] != null && Request.Params["id"].Trim() != ""){
                string strId = Request.Params["id"];
                
                int id = Convert.ToInt32(strId);
                                   
                ShowInfo(id);
              }
            }
        }

        /// <summary>
        /// 显示一条 数据
        /// </summary>
        /// <param name="ProductID">主键</param>
        private void ShowInfo(int ProductID){      
            KuGo.Model.Products model = new KuGo.BLL.ProductsBLL().GetModel(ProductID);
            if(model!=null){
              this.ProductIDLabel.Text = model.ProductID.ToString();               
              this.ProductNameLabel.Text = model.ProductName.ToString();               
              this.SupplierIDLabel.Text = model.SupplierID.ToString();               
              this.CategoryIDLabel.Text = model.CategoryID.ToString();               
              this.QuantityPerUnitLabel.Text = model.QuantityPerUnit.ToString();               
              this.UnitPriceLabel.Text = model.UnitPrice.ToString();               
              this.UnitsInStockLabel.Text = model.UnitsInStock.ToString();               
              this.UnitsOnOrderLabel.Text = model.UnitsOnOrder.ToString();               
              this.ReorderLevelLabel.Text = model.ReorderLevel.ToString();               
              this.DiscontinuedLabel.Text = model.Discontinued.ToString();               
              
            }
        }
    }
  }