public IServiceResultWrap SaveElectronicChannel([FromBody] VmElectronicChannel model)
 {
     return serviceManager.CallService(
         () => new ServiceResultWrap
         {
             Data = GetElectronicChannelData(model)
         }
         ,
         new Dictionary<Type, string>()
         {
             { typeof(string), EntityMessageSaved },
             { typeof(PtvArgumentException), MessageArgumentException },
             { typeof(RoleActionException), model.Id.HasValue ? MessageSaveChannelRole : MessageAddChannelRole }
         }
     );
 }
 private IVmBase GetElectronicChannelData(VmElectronicChannel model)
 {
     VmElectronicChannel result = null;
     switch (model.Action)
     {
         case ActionTypeEnum.Save:
             result = channelService.SaveElectronicChannel(model);
             break;
         case ActionTypeEnum.SaveAndValidate:
             result = channelService.SaveElectronicChannel(model);
             break;
         default:
             result = channelService.SaveElectronicChannel(model);
             break;
     }
     channelService.UnLockChannel(result.Id.Value);
     return result;
 }
Beispiel #3
0
 public void PrefilterViewModel(VmElectronicChannel vm)
 {
     PrefilterViewModel(vm.Step1Form);
     PrefilterViewModel(vm.Step2Form);
 }