// GET: Admin/ManagerOrder
        public ActionResult Index(int page = 1, int pageSize = 10)
        {
            var orderBLL = new HOADONBLL();
            var model    = orderBLL.ListALL(page, pageSize);

            return(View(model));
        }
        public ActionResult UpdateOrder(int id)
        {
            var hdBLL = new HOADONBLL();

            hdBLL.UpdateStatus("true", id);
            return(Redirect("/Admin/ManagerOrder/Index"));
        }
Пример #3
0
        public ActionResult Payment(string ShipName, string ShipMobile, string ShipAddress, string ShipEmail)
        {
            var session = (WebThietBiMang.Common.UserLogin)Session[WebThietBiMang.Common.CommonConstants.USER_SESSION];
            var order   = new HOADON();

            order.UserID      = session.UserID;
            order.ShipName    = ShipName;
            order.ShipMobile  = ShipMobile;
            order.ShipAddress = ShipAddress;
            order.ShipEmail   = ShipEmail;
            order.CreateAt    = DateTime.Now;
            order.Status      = "false";
            var id     = new HOADONBLL().Insert(order);
            var cart   = (List <CartItem>)Session[CartSession];
            var detail = new CHITIETHOADONBLL();

            foreach (var item in cart)
            {
                var chitiethoadon = new CHITIETHOADON();
                chitiethoadon.ProductID = item.Product.Id;
                chitiethoadon.OrderID   = id;
                chitiethoadon.Quantity  = item.Quantity;
                chitiethoadon.Price     = Convert.ToInt32(item.Product.Price * item.Quantity);
                chitiethoadon.UserID    = session.UserID;
                detail.Insert(chitiethoadon);
            }
            foreach (var item in cart)
            {
                if (cart.Count > 0)
                {
                    cart.RemoveRange(cart.IndexOf(item), cart.Count);
                }
                if (cart.Count == 0)
                {
                    break;
                }
            }
            return(Redirect("/hoan-thanh"));
        }