Ejemplo n.º 1
0
 public void CreatePurchaseOrder4Produt(ProductGoodViewModel propurchase)
 {
     var storeProcedureName = "[dbo].[Create_Product_PurchaseOrder]";
     var Result             = _dbContext.Database.SqlQuery <PurchasingInkViewModel>(
         $"{storeProcedureName} @PurchasingID,@ProductName,@Count,@Price,@eachPrice,@CreatePersonId,@ProcessPersonId,@Status,@CreateDate,@ProcessDate",
         new SqlParameter("@PurchasingID", ModelItemIsNow(propurchase.PurchasingID)),
         new SqlParameter("@ProductName", ModelItemIsNow(propurchase.ProductName)),
         new SqlParameter("@Count", ModelItemIsNow(propurchase.Count)),
         new SqlParameter("@Price", ModelItemIsNow(propurchase.Price)),
         new SqlParameter("@eachPrice", ModelItemIsNow(propurchase.eachPrice)),
         new SqlParameter("@CreatePersonId", ModelItemIsNow(propurchase.CreatePersonId)),
         new SqlParameter("@ProcessPersonId", ModelItemIsNow(propurchase.ProcessPersonId)),
         new SqlParameter("@Status", ModelItemIsNow(propurchase.Status)),
         new SqlParameter("@CreateDate", ModelItemIsNow(propurchase.CreateDate)),
         new SqlParameter("@ProcessDate", ModelItemIsNow(propurchase.ProcessDate))
         ).SingleOrDefault();
 }
Ejemplo n.º 2
0
        public List <ProductGoodViewModel> GetPurchaseByName(string ProductName)
        {
            var productlist = from u in _db.ProductGoods
                              where (u.ProductName.Contains(ProductName))
                              select u;
            var list = new List <ProductGoodViewModel>();

            foreach (var item in productlist)
            {
                var pro = new ProductGoodViewModel();
                pro.ProductId       = item.ProductId;
                pro.ProductName     = item.ProductName;
                pro.eachPrice       = item.eachPrice;
                pro.CreatePersonId  = item.CreatePersonId;
                pro.ProcessPersonId = item.ProcessPersonId;
                pro.Count           = item.Count;
                pro.Status          = item.Status;
                list.Add(pro);
            }
            return(list);
        }
Ejemplo n.º 3
0
        public List <ProductGoodViewModel> GetPurchaseById(string purchaseid)
        {
            var PurchaseList = new List <ProductGoodViewModel>();
            var purchaselist = from u in _db.ProductGoods
                               where u.PurchasingID == purchaseid
                               select u;

            foreach (var item in purchaselist)
            {
                ProductGoodViewModel pro = new ProductGoodViewModel();
                pro.ProductId       = item.ProductId;
                pro.ProductName     = item.ProductName;
                pro.eachPrice       = item.eachPrice;
                pro.CreatePersonId  = item.CreatePersonId;
                pro.ProcessPersonId = item.ProcessPersonId;
                pro.Count           = item.Count;
                pro.Status          = item.Status;
                PurchaseList.Add(pro);
            }
            return(PurchaseList);
        }
Ejemplo n.º 4
0
        public async Task <List <ProductGoodViewModel> > GetAllProductPurchase()
        {
            var purchaseList = new List <ProductGoodViewModel>();
            var purchaselist = new List <ProductGoods>();

            purchaselist = await _db.ProductGoods.ToListAsync();

            foreach (var item in purchaselist)
            {
                ProductGoodViewModel pro = new ProductGoodViewModel();
                pro.PurchasingID    = item.PurchasingID;
                pro.ProductId       = item.ProductId;
                pro.ProductName     = item.ProductName;
                pro.Count           = item.Count;
                pro.Status          = item.Status;
                pro.eachPrice       = item.eachPrice;
                pro.CreateDate      = item.CreateDate;
                pro.ProcessDate     = item.ProcessDate;
                pro.ProcessPersonId = item.ProcessPersonId;
                purchaseList.Add(pro);
            }
            return(purchaseList);
        }
Ejemplo n.º 5
0
 public void CreatePurchaseOrder4Produt(ProductGoodViewModel propurchase)
 {
     _productRespository.CreatePurchaseOrder4Produt(propurchase);
 }