Пример #1
0
 public void PrefilterViewModel(VmElectronicChannelStep1 vm)
 {
     if (vm.UrlAttachments != null)
     {
         vm.UrlAttachments = attachmentLogic.PrefilterModel(vm.UrlAttachments).ToList();
     }
 }
Пример #2
0
 public IServiceResultWrap SaveElectronicChannelStep1Changes([FromBody] VmElectronicChannelStep1 model)
 {
     return(serviceManager.CallService(
                () => new ServiceLocalizedResultWrap(model)
     {
         Data = channelService.SaveElectronicChannelStep1(model)
     },
                new Dictionary <Type, string>()
     {
         { typeof(string), MessageChannelStepSave },
         { typeof(PtvArgumentException), MessageArgumentException },
         { typeof(LockException), MessageLockedChannel },
         { typeof(RoleActionException), MessageSaveChannelRole }
     }
                ));
 }
Пример #3
0
        public static VmElectronicChannel CreateVmElectronicChannelModel()
        {
            var step1 = new VmElectronicChannelStep1()
            {
                IsOnLineAuthentication = true,
                IsOnLineSign           = true,
                NumberOfSigns          = 10,
                Emails = new List <VmEmailData> {
                    CreateVmEmailDataModel()
                },
                PhoneNumbers = new List <VmPhone> {
                    CreateVmPhoneModel()
                }
            };

            SetupVmChannelDescriptionModel(step1);
            return(new VmElectronicChannel()
            {
                PublishingStatusId = Guid.NewGuid(),
                Step1Form = step1,
                Step2Form = new VmOpeningHoursStep
                {
                    ExceptionHours = new List <VmExceptionalHours>
                    {
                        CreateVmHoursModel <VmExceptionalHours>(ServiceHoursTypeEnum.Exception)
                    },
                    StandardHours = new List <VmNormalHours>
                    {
                        CreateVmHoursModel <VmNormalHours>(ServiceHoursTypeEnum.Standard)
                    },
                    SpecialHours = new List <VmSpecialHours>
                    {
                        CreateVmHoursModel <VmSpecialHours>(ServiceHoursTypeEnum.Special)
                    }
                },
                UrlAttachments = new List <VmChannelAttachment>()
                {
                    CreateVmChannelUrlModel(),
                    CreateVmChannelAttachmentModel()
                }
            });
        }