Ejemplo n.º 1
0
        public ActionResult AddCarton(DimensionsViewModel dimensions)
        {
            CartonizationService service = new CartonizationService();

            int cartonId = service.GetAvailableCartons().Count > 0 ? service.GetAvailableCartons().Last().Id + 1 : 1;

            Carton p = new Carton(cartonId, dimensions.Height, dimensions.Length, dimensions.Width);

            service.AddCarton(p);

            return(Json(p));
        }
Ejemplo n.º 2
0
        public ActionResult AddProduct(DimensionsViewModel dimensions)
        {
            CartonizationService service = new CartonizationService();

            int productId = service.GetProducts().Count > 0 ? service.GetProducts().Last().ProductId + 1 : 1;

            Product p = new Product(productId, dimensions.Height, dimensions.Length, dimensions.Width);

            service.AddProduct(p);

            return(Json(p));
        }