Exemplo n.º 1
0
        public Model.PurchaseOrderItem GetScalePOItem(int poId, Model.ScaleDetails scaleDetails)
        {
            if (scaleDetails == null || scaleDetails.Apply_To_Item == null)
            {
                return(null);
            }

            Model.PurchaseOrderItem item = (from poItem in _repository.GetQuery <Model.PurchaseOrderItem>()
                                            where poItem.PurchaseOrder.ID == poId &&
                                            poItem.Item.ID == scaleDetails.Item_Received.ID
                                            select poItem).FirstOrDefault();
            return(item);
        }
Exemplo n.º 2
0
        private decimal GetConvertedPOUOMNetWeight(VModel.Scale scale, int poID)
        {
            IEnumerable <Model.ScaleDetails> scaleDetails = _repository.Find <Model.ScaleDetails>(o => o.Scale.ID == scale.ID, new string[] { "Item_Received", "Apply_To_Item" });
            decimal UOMNetWeight = 0;

            foreach (var item in scaleDetails)
            {
                Model.PurchaseOrderItem poScaleItem = GetScalePOItem(poID, item);
                string uom = poScaleItem != null && !string.IsNullOrWhiteSpace(poScaleItem.Ordered_Qty_UOM) ? poScaleItem.Ordered_Qty_UOM : "LBS";
                UOMNetWeight += GetConvertedUOMWeight(item.NetWeight, uom);
            }
            return(UOMNetWeight);
        }