示例#1
0
 public DeviceConfig GetDevice(TcpDeviceCreateViewModel model)
 {
     return(new DeviceConfig()
     {
         ChannelId = model.ChannelId,
         Title = model.Title,
         Type = model.Type,
         Ip = model.Ip,
         Port = model.Port
     });
 }
示例#2
0
        public async Task <IActionResult> TcpDeviceCreate(TcpDeviceCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                await _modbusService.Create(_modbusFactory.GetDevice(model));

                return(_getDefaultForm());
            }

            return(PartialView("_TcpDeviceCreatePartial", model));
        }