Exemplo n.º 1
0
        public ActionResult PlaceOrder(FormCollection frm)
        {

            //OrderDetails order = new OrderDetails();
            if (Session["CustomerName"] != null && Session["CustomerMobileNo"] != null)
            {
                string Name = Convert.ToString(frm["name"]);

                string mobileNo = Convert.ToString(frm["mobileNo"]);

                string deliveryAddress = Convert.ToString(frm["deliveryAddress"]);

                List<Item> items = Session["cart"] as List<Item>;

                OrdersBLL bll = new OrdersBLL();
                int res = bll.PlaceOrder(Name, mobileNo, deliveryAddress, items);

                if (res > 0)
                {
                    Session["cart"] = null;

                    return RedirectToAction("OrderConfirmation", "Customer", new { orderId = res });

                }
                else
                {

                }
            }
            else
            {
                return RedirectToAction("DoLogin", "Login");
            }


            return View();
        }