Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SimplicityCommLib.DataSets.Common.ProductsTableAdapters.ProductsTableAdapter prodTA = new SimplicityCommLib.DataSets.Common.ProductsTableAdapters.ProductsTableAdapter();
     //IEnumerator<SimplicityCommLib.DataSets.Common.Products.ProductsRow> ieProducts = .GetEnumerator();
     rptProds.DataSource = prodTA.GetAllProducts();
     rptProds.DataBind();
     if (Request[WebConstants.Request.PRODUCT_ID] != null)
     {
         int productId = int.Parse(Request[WebConstants.Request.PRODUCT_ID]);
         ProductsTableAdapters.ProductVideoTableAdapter videoTA = new ProductsTableAdapters.ProductVideoTableAdapter();
         rptVideos.DataSource = videoTA.GetVideosByProduct(productId);
         rptVideos.DataBind();
         lblContent.Visible = false;
         SimplicityCommLib.DataSets.Common.Products.ProductsRow product = DatabaseUtility.Instance.GetProduct(productId);
         if(product != null)
         {
             lblProdName.Text = product.Name;
             lblProdName.Visible = true;
         }
     }
     else
     {
         lblContent.Visible = true;
         lblProdName.Visible = false;
     }
 }