예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["ProductID"] != null)
                {
                    string productId = Request.QueryString["ProductID"];
                    if (!String.IsNullOrEmpty(productId))
                    {
                        var product = businessHelper.GetProduct(int.Parse(productId));

                        txtName.Text       = product.Name;
                        txtDesc.Text       = product.Description;
                        txtSKU.Text        = product.SKU;
                        txtVendor.Text     = product.Vendor;
                        hdnProductId.Value = product.ProductId.ToString();
                    }
                }
            }


            grdProducts.DataSource = businessHelper.GetProducts();
            grdProducts.DataBind();
        }