Example #1
0
 public ChannelConfig GetChannel(TcpChannelCreateViewModel model)
 {
     return(new ChannelConfig()
     {
         Title = model.Title,
         Type = model.Type
     });
 }
Example #2
0
        public async Task <IActionResult> TcpChannelCreate(TcpChannelCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                await _modbusService.Create(_modbusFactory.GetChannel(model));

                model = _modbusFactory.GetTcpChannelCreateViewModel();
                //RedirectToAction(nameof(Index));
            }

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