Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ProductsPersistency           persistency = new ProductsPersistency();
            IReadOnlyCollection <Product> products    = persistency.GetAll();

            items.DataSource = products;
            items.DataBind();
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ProductsPersistency           prodPersis = new ProductsPersistency();
            IReadOnlyCollection <Product> products   = prodPersis.GetAll();

            overviewContent.DataSource = products;
            overviewContent.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["prodId"]))
            {
                var p = new ProductsPersistency();
                prod = p.GetById(Request.QueryString["prodId"]);

                DetailPicture.ImageUrl = "assets/img/" + prod.ImageName;
            }
        }
Exemple #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ProductsPersistency prodPersis = new ProductsPersistency();

            string idParam = Request.Params.Get("id");

            if (!string.IsNullOrEmpty(idParam))
            {
                CurrentProduct        = prodPersis.GetById(idParam);
                productImage.ImageUrl = "~/img/" + CurrentProduct.ImageName;
                productName.Text      = CurrentProduct.Name;
            }
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var allp = new ProductsPersistency();
            IEnumerable <Product> AllProducts = allp.GetAll();

            BasketTable.CssClass = "table-basket";

            TableRow r = new TableRow();

            r.CssClass = "titlerow-basket";

            TableCell tc1 = new TableCell();

            tc1.Text = "Produkt";
            r.Cells.Add(tc1);

            TableCell tc2 = new TableCell();

            tc2.Text = "Preis";
            r.Cells.Add(tc2);

            BasketTable.Rows.Add(r);

            foreach (string pid in this.Session)
            {
                foreach (Product p in AllProducts)
                {
                    if (p.Id == this.Session[pid].ToString())
                    {
                        TableRow row = new TableRow();

                        TableCell c1 = new TableCell();
                        c1.Text = p.Name;
                        row.Cells.Add(c1);

                        TableCell c2 = new TableCell();
                        c2.Text = DecimalExtensionMethods.AsChf(p.SpecialOffer);
                        row.Cells.Add(c2);

                        BasketTable.Rows.Add(row);

                        Total += (double)p.SpecialOffer;
                    }
                }
            }

            TotalPrice.Text = "Total: " + Total.ToString() + " CHF";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }

            if (
                !string.IsNullOrEmpty(Request.QueryString["productId"])
                )
            {
                var F**k = new ProductsPersistency();
                Product = F**k.GetById(Request.QueryString["productId"]);
            }
            else
            {
                Response.Redirect("/");
            }
        }
Exemple #7
0
        public IEnumerable <Product> GetProducts()
        {
            var iHateMyswlf = new ProductsPersistency();

            return(iHateMyswlf.GetAll());
        }
        public IEnumerable <Product> GetProducts()
        {
            var allproducts = new ProductsPersistency();

            return(allproducts.GetAll());
        }