public JsonResult CheckRef(string ID) { ResponseMsg response = new ResponseMsg(); response.IsSuccess = PackingLogic.CheckReference(ID); return(Json(response, JsonRequestBehavior.AllowGet)); }
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)); } }
public PackingFacade(IServiceProvider serviceProvider, ProductionDbContext dbContext) { ServiceProvider = serviceProvider; this.dbContext = dbContext; this.dbSet = dbContext.Set <PackingModel>(); this.packingLogic = serviceProvider.GetService <PackingLogic>(); }
public string CheckDuplicateName(string Name, string ID) { var packings = PackingLogic.GetPackingByID(0); if (packings != null && packings.Count() > 0) { if (Convert.ToInt32(ID) > 0) { packings = packings.Where(x => x.Name == Name && x.ID != Convert.ToInt32(ID)); } else { packings = packings.Where(x => x.Name == Name); } if (packings.Count() > 0) { return("false"); } else { return("true"); } } else { return("true"); } }
public JsonResult StartPacking(int ID) { return(Json(new ResponseMsg() { IsSuccess = PackingLogic.Start(ID) }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetByProductID(int ProductID) { ResponseMsg response = new ResponseMsg(); response.ResponseValue = PackingLogic.GetPackingByProductID(ProductID); response.IsSuccess = true; return(Json(response, JsonRequestBehavior.AllowGet)); }
public ActionResult Add(Packing packing) { ResponseMsg response = new ResponseMsg(); PackingLogic.AddPacking(packing); response.IsSuccess = true; return(Json(response)); }
public JsonResult Delete(string ID) { ResponseMsg response = new ResponseMsg(); if (Convert.ToInt32(ID) > 0) { PackingLogic.DeletePackingByID(ID); response.IsSuccess = true; response.ResponseValue = ""; } return(Json(response, JsonRequestBehavior.AllowGet)); }
// // GET: /Packing/ public ActionResult Add(string ID) { if (Convert.ToInt32(ID) > 0) { var packing = PackingLogic.GetPackingByID(Convert.ToInt32(ID)).FirstOrDefault(); return(View(packing)); } else { return(View(new Packing())); } }
public JsonResult GetStock(string ProductID, string ShadeID, string PackingID) { var responseValue = new { StockData = StockLogic.GetStockReport(null, null, ProductID, ShadeID, PackingID), Factor = PackingLogic.GetPackingByID(Convert.ToInt32(PackingID)) }; return(Json(new ResponseMsg { IsSuccess = true, ResponseValue = responseValue }, JsonRequestBehavior.AllowGet)); }
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)); }
// // GET: /Product/ public ActionResult Add(string ID) { ViewBag.Shades = ShadeLogic.GetShadeByID(0); ViewBag.Packings = PackingLogic.GetPackingByID(0); ViewBag.ProductGroups = ProductGroupLogic.GetProductGroupByID(0); ViewBag.ProductUnits = ProductUnitLogic.GetProductUnitByID(0); ViewBag.Parties = PartyLogic.GetPartyByID(0).Select(x => new { x.ID, x.Name }); ViewBag.RawMaterialTypes = RawMaterialTypeLogic.RawMaterialTypeByID(0); if (Convert.ToInt32(ID) > 0) { var product = ProductLogic.GetProductByID(Convert.ToInt32(ID)).FirstOrDefault(); return(View(product)); } else { return(View(new Product())); } }
public bool CheckPackingInUse(int ProductID, int PackingID) { if (PackingLogic.CheckReference(ProductID, PackingID)) { return(false); } else { if (PackingID > 0 && ProductID > 0) { return(true); } else { return(false); } } }
public ActionResult GetAll() { return(PartialView("GetAll", PackingLogic.GetPackingByID(0))); }