public ActionResult ViewPurchaseHistory(int?NewOrderId, int Id, string sessionId)
        {
            List <Order> Orders = OrdersData.GetOrders(Id);

            List <Order> OrderSummary = (List <Order>)Session[sessionId + "_Orders"];

            OrderSummary.Clear();

            //send back to view
            ViewData["PurchaseHistory"] = Orders;
            ViewData["sessionId"]       = sessionId;
            ViewData["Id"] = Id;

            //Return View Purchase History View
            return(View());
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // Don't forget to create the 'rewards' database and execute the sql ..\SQLScripts\CreateTablesAndPopulate.sql script
            // to make the initial migration and seeding



            string yolo = Request.QueryString["yolo"];

            if (yolo == "hi")
            {
                throw new Exception();
            }

            var cid = -1;

            if (Page.IsPostBack)
            {
                cid = int.Parse(CustomerId.Value);
            }

            var orders = OrdersData.GetOrders(5);

            orderList.DataSource = orders;
            orderList.DataBind();

            if (cid == -1)
            {
                var defaultCustomer = CustomerData.GetDefaultCustomer();
                MapCustomer(defaultCustomer);
            }
            else
            {
                var customer = CustomerData.GetCustomerById(cid);
                MapCustomer(customer);
            }


            lblCheckbox.Attributes.Add("for", EnrollCheckbox.ClientID);
        }