public ActionResult CreateOrderDetail(int OrderID)
        {
            Order_DetailsService order_DetailsService = new Order_DetailsService();
            ProductService       productService       = new ProductService();

            ViewBag.OrderID  = OrderID;
            ViewBag.Products = productService.GetProductsOfCreateStock();
            return(View());
        }
        public ActionResult DeleteOrderDetail(int Order_Details_ID)
        {
            Order_DetailsService order_DetailsService = new Order_DetailsService();

            if (order_DetailsService.DeleteOrderDetail(Order_Details_ID))
            {
                TempData["DeleteOrderDetail"] = 1;
            }
            else
            {
                TempData["DeleteOrderDetail"] = 0;
            }
            return(Redirect(Request.UrlReferrer.ToString()));
        }
        public ActionResult UpdateOrderDetail(Person_OrderDetail person_OrderDetail)
        {
            Order_DetailsService order_DetailsService = new Order_DetailsService();

            if (order_DetailsService.UpdateOrderDetail(person_OrderDetail))
            {
                TempData["UpdateOrderDetail"] = 1;
            }
            else
            {
                TempData["UpdateOrderDetail"] = 0;
            }
            return(Redirect(Request.UrlReferrer.ToString()));
        }
        public ActionResult CreateOrderDetail(Order_Details order_Details)
        {
            Order_DetailsService order_DetailsService = new Order_DetailsService();

            if (order_DetailsService.CreateOrderDetail(order_Details))
            {
                TempData["CreateOrderDetail"] = 1;
            }
            else
            {
                TempData["CreateOrderDetail"] = 0;
            }
            return(Redirect(Request.UrlReferrer.ToString()));
        }
        public ActionResult UpdateOrderDetail(int Order_Details_ID, int?Product_ID)
        {
            Order_DetailsService order_DetailsService = new Order_DetailsService();
            ProductService       productService       = new ProductService();
            var orderDetail = order_DetailsService.GetByOrderDetail_ID(Order_Details_ID);

            ViewBag.Products = productService.GetProductsOfCreateStock();

            if (Product_ID == null)
            {
                TempData["ProductDetail"] = productService.GetProductDetail(orderDetail.Product_ID);
            }
            else
            {
                var temp = productService.GetProductDetail((int)Product_ID);
                TempData["ProductDetail"] = temp;
                orderDetail.Product_ID    = (int)Product_ID;
                orderDetail.Color         = temp.ColorSize.Keys.ToList()[0];
                orderDetail.size          = "";
                orderDetail.Quantity      = 1;
            }
            return(View(orderDetail));
        }