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

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

            overviewContent.DataSource = products;
            overviewContent.DataBind();
        }
Example #3
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";
        }
Example #4
0
        public IEnumerable <Product> GetProducts()
        {
            var iHateMyswlf = new ProductsPersistency();

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

            return(allproducts.GetAll());
        }