Beispiel #1
0
 private decimal GetConvertedUOMWeight(decimal itemUOMWeight, string uom)
 {
     if (!string.IsNullOrEmpty(uom) && uom.ToLower() != "lbs")
     {
         UOMConversionLibrary uomConvLib = new UOMConversionLibrary(_dbContextConnectionString);
         VModel.UOMConversion uomConv    = uomConvLib.GetByUOM(uom, "LBS");
         if (uomConv != null)
         {
             itemUOMWeight = itemUOMWeight / (decimal)uomConv.Factor;
         }
     }
     itemUOMWeight = decimal.Round(itemUOMWeight, 3, MidpointRounding.AwayFromZero);
     return(itemUOMWeight);
 }
Beispiel #2
0
        private decimal GetSOItemUOMWeight(Model.Container container, string uom)
        {
            decimal soItemUOMWeight = container.Net_Weight;

            if (uom != null && uom.ToLower() != "lbs")
            {
                UOMConversionLibrary uomConvLib = new UOMConversionLibrary(_dbContextConnectionString);
                VModel.UOMConversion uomConv    = uomConvLib.GetByUOM(uom, "LBS");
                if (uomConv != null)
                {
                    soItemUOMWeight = soItemUOMWeight / (decimal)uomConv.Factor;
                }
            }
            soItemUOMWeight = decimal.Round(soItemUOMWeight, 3, MidpointRounding.AwayFromZero);
            return(soItemUOMWeight);
        }