private string GetUoMCode(int uoMID)
 {
     using (UnitOfMeasureService service = new UnitOfMeasureService())
     {
         return(service.Get(uoMID).Code);
     }
 }
        private UnitOfMeasureModel GetUomModel(int uomId)
        {
            UnitOfMeasureModel uomModel;

            using (var uomService = new UnitOfMeasureService())
            {
                var uomDto = uomService.Get(uomId);
                uomModel = Mapper.Map <UnitOfMeasureDto, UnitOfMeasureModel>(uomDto);
            }
            return(uomModel);
        }
        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.º 4
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];
 }
        protected void CalcArea()
        {
            int areaUoMId = 0;

            using (ScrimTypeService service = new ScrimTypeService())
            {
                _area = 0.0;
                ScrimTypeDto dto = service.Get(TypeID);
                _area     = (double)Length * dto.Width;
                areaUoMId = dto.AreaUoMID;
            }
            using (UnitOfMeasureService service = new UnitOfMeasureService())
            {
                _areaUom = service.Get(areaUoMId).Code;
            }
        }