Example #1
0
        // GET: DataShow
        public ActionResult Index(string Order_ID)
        {
            int Total = 0;

            Model.CustomerData         Customer_Data  = new Model.CustomerData();
            List <Model.CustomerOrder> Customer_Order = new List <Model.CustomerOrder>();
            List <Model.ShowBook>      Book_Data      = new List <Model.ShowBook>();

            Service.SQLCustomerData     SCD  = new Service.SQLCustomerData();
            Service.SQLGetCustomerOrder SGCO = new Service.SQLGetCustomerOrder();
            Service.SQLGetShowBook      SGSB = new Service.SQLGetShowBook();

            Customer_Data          = SCD.getData(Request.Cookies["cookie"]["Account"].ToString());
            Customer_Order         = SGCO.Get_Customer_Order(Order_ID, Customer_Data.Customer_Email);
            Book_Data              = SGSB.ShowBook(Customer_Order[0].Order_ID.ToString());
            ViewBag.Customer_Data  = Customer_Data;
            ViewBag.Customer_Order = Customer_Order;
            for (int i = 0; i < Book_Data.Count; i++)
            {
                Total += int.Parse(Book_Data[i].Book_Price) * int.Parse(Book_Data[i].Order_Quantity);
            }
            ViewBag.Book_Data   = Book_Data;
            ViewBag.Price_Total = Total;
            Service.SQLDeleteShoppingCart SDSC = new Service.SQLDeleteShoppingCart();
            SDSC.Delete_Cart();
            return(View());
        }
Example #2
0
        public ActionResult Insert(Model.CustomerOrder Data, string Order_ID)
        {
            Service.SQLCheckOut SCO = new Service.SQLCheckOut();
            Data.Customer_Email = Request.Cookies["cookie"]["Account"].ToString();
            SCO.InsertCustomer_Order(Data);
            Service.SQLGetShoppingCart SGSC  = new Service.SQLGetShoppingCart();
            List <Model.ShippingCar>   Data2 = new List <Model.ShippingCar>();

            Data2 = SGSC.Find(Data.Customer_Email);
            SCO.InsertOrder_Books(Data, Data2);
            Service.SQLDeleteShoppingCart SDSC = new Service.SQLDeleteShoppingCart();
            SDSC.Delete_Cart();
            return(RedirectToAction("Index", "DataShow", new { Order_ID = Order_ID }));
        }