コード例 #1
0
        public JsonResult CheckRef(string ID)
        {
            ResponseMsg response = new ResponseMsg();

            response.IsSuccess = PackingLogic.CheckReference(ID);
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
コード例 #2
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));
     }
 }
 public PackingFacade(IServiceProvider serviceProvider, ProductionDbContext dbContext)
 {
     ServiceProvider   = serviceProvider;
     this.dbContext    = dbContext;
     this.dbSet        = dbContext.Set <PackingModel>();
     this.packingLogic = serviceProvider.GetService <PackingLogic>();
 }
コード例 #4
0
        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");
            }
        }
コード例 #5
0
 public JsonResult StartPacking(int ID)
 {
     return(Json(new ResponseMsg()
     {
         IsSuccess = PackingLogic.Start(ID)
     }, JsonRequestBehavior.AllowGet));
 }
コード例 #6
0
        public JsonResult GetByProductID(int ProductID)
        {
            ResponseMsg response = new ResponseMsg();

            response.ResponseValue = PackingLogic.GetPackingByProductID(ProductID);
            response.IsSuccess     = true;
            return(Json(response, JsonRequestBehavior.AllowGet));
        }
コード例 #7
0
        public ActionResult Add(Packing packing)
        {
            ResponseMsg response = new ResponseMsg();

            PackingLogic.AddPacking(packing);
            response.IsSuccess = true;
            return(Json(response));
        }
コード例 #8
0
        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));
        }
コード例 #9
0
        //
        // 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()));
            }
        }
コード例 #10
0
        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));
        }
コード例 #11
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));
        }
コード例 #12
0
        //
        // 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()));
            }
        }
コード例 #13
0
 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);
         }
     }
 }
コード例 #14
0
 public ActionResult GetAll()
 {
     return(PartialView("GetAll", PackingLogic.GetPackingByID(0)));
 }