private UnitOfMeasureModel GetUnitOfMeasure(int uomId)
        {
            UnitOfMeasureModel uom = null;

            using (UnitOfMeasureService service = new UnitOfMeasureService())
            {
                var dto = service.Get(uomId);
                uom = Mapper.Map <UnitOfMeasureDto, UnitOfMeasureModel>(dto);
            }
            return(uom);
        }
Ejemplo n.º 2
0
 private UnitOfMeasureModel GetUnitOfMeasure(string code)
 {
     //if (!_uomsByCode.ContainsKey(code))
     {
         UnitOfMeasureModel uom = null;
         using (UnitOfMeasureService service = new UnitOfMeasureService())
         {
             var dto = service.GetByCode(code);
             uom = Mapper.Map <UnitOfMeasureDto, UnitOfMeasureModel>(dto);
             //_uomsById.Add(uom.ID, uom);
             //_uomsByCode.Add(uom.Code, uom);
         }
         return(uom);
     }
     //return _uomsByCode[code];
 }
Ejemplo n.º 3
0
 //private Dictionary<int, UnitOfMeasureModel> _uomsById = new Dictionary<int, UnitOfMeasureModel>();
 //private Dictionary<string, UnitOfMeasureModel> _uomsByCode = new Dictionary<string, UnitOfMeasureModel>();
 private UnitOfMeasureModel GetUnitOfMeasure(int uomId)
 {
     //if (!_uomsById.ContainsKey(uomId))
     {
         UnitOfMeasureModel uom = null;
         using (UnitOfMeasureService service = new UnitOfMeasureService())
         {
             var dto = service.Get(uomId);
             uom = Mapper.Map <UnitOfMeasureDto, UnitOfMeasureModel>(dto);
             //_uomsById.Add(uomId, uom);
             //_uomsByCode.Add(uom.Code, uom);
         }
         return(uom);
     }
     //return _uomsById[uomId];
 }