public JsonResult EditProExi(addProExiViewModel pro)
        {
            _productProvider.EditProExi(pro);
            string a = "修改成功";

            return(Json(a, JsonRequestBehavior.AllowGet));
        }
        public void EditProExi(addProExiViewModel pro)
        {
            PrinteryContext pr      = new PrinteryContext();
            var             exitPro = pr.ProductionExpense.FirstOrDefault(s => s.ProExId == pro.ProExId);

            if (exitPro != null)
            {
                pr.Set <ProductionExpense>().Attach(exitPro);
                pr.Entry(exitPro).State = EntityState.Modified;
                exitPro.ProductId       = pro.ProductId;
                exitPro.ProductName     = pro.ProductName;
                exitPro.InkId1          = pro.InkId1;
                exitPro.InkId2          = pro.InkId2;
                exitPro.InkId1Count     = pro.InkId1Count;
                exitPro.InkId2Count     = pro.InkId2Count;
                exitPro.PaperId1        = pro.PaperId1;
                exitPro.PaperId2        = pro.PaperId2;
                exitPro.PaperId2Count   = pro.PaperId2Count;
                pr.SaveChanges();
            }
        }
        public void AddProExis(addProExiViewModel pro)
        {
            PrinteryContext pr     = new PrinteryContext();
            var             ProExi = new ProductionExpense()
            {
                ProExId       = Guid.NewGuid().ToString(),
                ProductId     = pro.ProductId,
                ProductName   = pro.ProductName,
                InkId1        = pro.InkId1,
                InkId2        = pro.InkId2,
                InkId1Count   = pro.InkId1Count,
                InkId2Count   = pro.InkId2Count,
                PaperId1      = pro.PaperId1,
                PaperId2      = pro.PaperId2,
                PaperId1Count = pro.PaperId1Count,
                PaperId2Count = pro.PaperId2Count
            };

            pr.ProductionExpense.Add(ProExi);
            pr.SaveChanges();
        }
Beispiel #4
0
 public void EditProExi(addProExiViewModel pro)
 {
     _productRespository.EditProExi(pro);
 }
Beispiel #5
0
 public void AddProExis(addProExiViewModel pro)
 {
     _productRespository.AddProExis(pro);
 }