예제 #1
0
        public EditProduct()
        {
            storeProductRep = new StoreProductRepository();
            storeAnimeRep   = new StoreAnimeRepository();
            storeColorRep   = new StoreColorRepository();

            long productID = 0;

            if (!string.IsNullOrEmpty(HttpContext.Current.Request["ProductID"]))
            {
                productID = MyCommon.ToLong(HttpContext.Current.Request["ProductID"]);
            }
            if (productID > 0)
            {
                _product = storeProductRep.GetProductByID(productID);
                if (_product == null)
                {
                    HttpContext.Current.Response.Redirect("ProductList.aspx");
                }
            }
        }
예제 #2
0
 protected void _OnPageLoad(int productID)
 {
     this.lbl_ProductName.Text  = _StoreProduct.GetProductByID(productID).Name;
     this.lbl_ProductName1.Text = this.lbl_ProductName.Text;
     //Vaiant1
     ddl_Vaiant1.DataSource     = _StoreVariantTypes.GetAllStoreVariantType();
     ddl_Vaiant1.DataTextField  = "GroupName";
     ddl_Vaiant1.DataValueField = "VariantTypeID";
     ddl_Vaiant1.DataBind();
     this.ddl_Vaiant1.Items.Insert(0, new ListItem("--请选择--", "0"));
     //Vaiant2
     ddl_Vaiant2.DataSource     = _StoreVariantTypes.GetAllStoreVariantType();
     ddl_Vaiant2.DataTextField  = "GroupName";
     ddl_Vaiant2.DataValueField = "VariantTypeID";
     ddl_Vaiant2.DataBind();
     this.ddl_Vaiant2.Items.Insert(0, new ListItem("--请选择--", "0"));
 }