Ejemplo n.º 1
0
 private Boolean updateStockOnHand(Location stkLocation,Product stkProduct,string LotNo,double Qty,decimal TotalCost)
 {   var blnResult = false;
     var queryStock = (from stock in StockOnHands
                       where stock.Location.Id == stkLocation.Id && stock.Product.Id == stkProduct.Id && stock.LotNo == LotNo
                      select stock).FirstOrDefault();
     if(queryStock != null){
         queryStock.QuantityOnHand = queryStock.QuantityOnHand + Qty;
         queryStock.CostPrice = queryStock.CostPrice + TotalCost;
         queryStock.IsAvailableForSale = false;
         blnResult = true;
     }
     else{
         StockOnHand newStock = new StockOnHand();
         newStock.Location = stkLocation;
         newStock.Product = stkProduct;
         newStock.LotNo = LotNo;
         newStock.CostPrice = TotalCost;
         newStock.IsAvailableForSale = false;
         newStock.QuantityOnHand = Qty;
         newStock.SellingPrice = 0;
         blnResult = true;
     }
     return blnResult;
 }
Ejemplo n.º 2
0
 partial void StockOnHands_Updated(StockOnHand entity)
 {
     
 }