Example #1
0
 protected void CreateOrder_Click(object sender, EventArgs e)
 {
     var sqlProvider = new DataBaseProvider();
     var userName = Request.Cookies["userName"];
     sqlProvider.CreateOrderLines(Session["OrdersList"] as List<Product> ?? new List<Product>(), userName == null ? null : userName.Value);
     Response.Redirect("~/Order.aspx");
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var dataBaseProvider = new DataBaseProvider();
            var userName = Request.Cookies["userName"];

            List<Product> ordersList = dataBaseProvider.LoadOrdersList(userName == null ? "NULL" : userName.Value);
            foreach (var item in ordersList)
            {
                TableRow tableRow = new TableRow();
                tableRow.BorderWidth = 1;

                tableRow.Cells.Add(new TableCell() { Text = item.ProductName, BorderWidth = 1 });
                this.Table1.Rows.Add(tableRow);
            }
        }