Exemplo n.º 1
0
 public ActionResult Conversion(int ID)
 {
     ViewBag.Products = ProductLogic.GetFinishedProducts();
     if (ID > 0)
     {
         var conversion = ProductLogic.GetConversionByID(ID).FirstOrDefault();
         ViewBag.FromShades   = ShadeLogic.GetShadeByProductID(conversion.FromProductId);
         ViewBag.FromPackings = PackingLogic.GetPackingByProductID(Convert.ToInt32(conversion.FromProductId));
         if (conversion.FromProductId == conversion.ToProductId)
         {
             ViewBag.ToShades = ViewBag.FromShades;
         }
         else
         {
             ViewBag.ToShades = ShadeLogic.GetShadeByProductID(conversion.ToProductId);
         }
         ViewBag.ToPackings = ViewBag.FromPackings;
         return(View(conversion));
     }
     else
     {
         var conversion = new ProductConversion();
         conversion.DocNo = ProductLogic.GetNewConverstionDocNo();
         return(View(conversion));
     }
 }
Exemplo n.º 2
0
        public JsonResult GetByProductID(int ProductID)
        {
            ResponseMsg response = new ResponseMsg();

            response.ResponseValue = PackingLogic.GetPackingByProductID(ProductID);
            response.IsSuccess     = true;
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public ActionResult GetProductShadesAndPackings(string ID)
        {
            ResponseMsg response = new ResponseMsg();

            if (!string.IsNullOrEmpty(ID) && Convert.ToInt32(ID) > 0)
            {
                response.IsSuccess     = true;
                response.ResponseValue = new
                {
                    Shades   = ShadeLogic.GetShadeByProductID(Convert.ToInt32(ID)),
                    Packings = PackingLogic.GetPackingByProductID(Convert.ToInt32(ID))
                };
            }
            return(Json(response, JsonRequestBehavior.AllowGet));
        }