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"); } }
// // 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)); }
// // 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 ActionResult GetAll() { return(PartialView("GetAll", PackingLogic.GetPackingByID(0))); }