Ejemplo n.º 1
0
        // GET : DeviceType/Add
        public ActionResult Add(string deviceId)
        {
            DeviceTypeViewModel deviceVM = new DeviceTypeViewModel();

            if (string.IsNullOrWhiteSpace(deviceId))
            {
                deviceVM.DeviceTypeId = Guid.Empty;
            }
            else
            {
                var        dealerGuid = Guid.Parse(deviceId);
                DeviceType deviceType = devicetypeService.GetDeviceType(dealerGuid);
                deviceVM = Mapper.Map <DeviceType, DeviceTypeViewModel>(deviceType);
            }
            return(PartialView("_Add", deviceVM));
        }
Ejemplo n.º 2
0
 public DeviceService(ILogger logger, IConfiguration configuration, ITransactions transactions, IAssetServices assetServices, IMapper mapper, IDeviceTypeService deviceTypeService)
 {
     this.logger        = logger;
     this.configuration = configuration;
     this.transactions  = transactions;
     this.assetServices = assetServices;
     this.mapper        = mapper;
     topicSuffix        = this.configuration["topicSuffix"];
     kafkaTopicNames    = configuration["KafkaTopicNames"].Split(',').Select(x => x = x + topicSuffix).ToList();
     kafkaTopicNamesV2  = configuration["KafkaTopicNamesV2"].Split(',').Select(x => x = x + topicSuffix).ToList();
     deviceTypesCache   = deviceTypeService.GetDeviceType();
 }
Ejemplo n.º 3
0
 /// <param name="deviceService"></param>
 /// <param name="logger"></param>
 /// <param name="deviceTypeService"></param>
 public DeviceV1Controller(IDeviceService deviceService, ILogger logger, IDeviceTypeService deviceTypeService)
 {
     this.deviceService    = deviceService;
     this.logger           = logger;
     this.deviceTypesCache = deviceTypeService.GetDeviceType();
 }