예제 #1
0
        private void SelectedProductGet()
        {
            try
            {
                if (string.IsNullOrEmpty(Request.QueryString["pID"]))
                {
                    Response.Redirect("Products.aspx");
                    return;
                }

                ProductORM prodORM = new ProductORM();

                selectedProduct = prodORM.SingleProduct(int.Parse(Request.QueryString["pID"]));
            }
            catch
            {
                Response.Redirect("Products.aspx");
            }
        }
 private void ProductUpdateItem()
 {
     if (Session["ProductID"] != null)
     {
         ProductORM      prodORM = new ProductORM();
         Entity.Products prod    = prodORM.SingleProduct(Convert.ToInt32(Session["ProductID"]));
         txtProductName.Value         = prod.ProductName;
         txtProductAciklama.Value     = prod.Description;
         txtProductPrice.Value        = prod.UnitPrice.ToString();
         txtProductUnitsInStock.Value = prod.UnitsInStock.ToString();
         for (int i = 0; i < drpCategory.Items.Count; i++)
         {
             if (drpCategory.Items[i].Value == prod.CategoryID.ToString())
             {
                 drpCategory.Items[i].Selected = true;
             }
         }
         btnProductInsert.Text = "Güncelle";
     }
 }