Exemple #1
0
        protected ScreenViewModel()
        {
            _policyService = new LocalServiceLocator().PolicyService;
            PostLoadTasks = new List<Task>();

            Loaded += OnLoaded;
            Unloaded += OnUnloaded;
            //Restart = new RelayCommand(RunRestart);
            /*
            DefaultElevate =
                new RelayCommand(
                    () =>
                    MessengerInstance.Send(new MetroDialogBoxMessage
                                               {
                                                   Title = "Restart CoApp Update",
                                                   Content =
                                                       "In order to complete your command, CoApp Update must restart. Would you like to restart CoApp Update?",
                                                   Buttons = new ObservableCollection<ButtonDescription>
                                                                 {
                                                                     new ElevateButtonDescription
                                                                         {Title = "Restart", Command = Restart},
                                                                     new ButtonDescription
                                                                         {Title = "Cancel", IsCancel = true}
                                                                 }
                                               }));*/
        }
Exemple #2
0
        public SetPasswordPageViewModel()
        {
            _deviceActionService       = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _apiService                = ServiceContainer.Resolve <IApiService>("apiService");
            _cryptoService             = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            _platformUtilsService      = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _userService               = ServiceContainer.Resolve <IUserService>("userService");
            _policyService             = ServiceContainer.Resolve <IPolicyService>("policyService");
            _passwordGenerationService =
                ServiceContainer.Resolve <IPasswordGenerationService>("passwordGenerationService");
            _i18nService = ServiceContainer.Resolve <II18nService>("i18nService");

            PageTitle                    = AppResources.SetMasterPassword;
            TogglePasswordCommand        = new Command(TogglePassword);
            ToggleConfirmPasswordCommand = new Command(ToggleConfirmPassword);
            SubmitCommand                = new Command(async() => await SubmitAsync());
        }
Exemple #3
0
        private static void SyncQuoteCreateAndUpdate(Submission s, Quote q, IPolicyService subsribeService)
        {
            var response = subsribeService.GetReference(new GetReferenceRequest
            {
                strPolId = q.SubscribeReference
            });

            var errorInfo = response.GetReferenceResult.ErrorInfo;
            var outputXml = response.GetReferenceResult.OutputXml;

            if (errorInfo == null)
            {
                var policyCon = Utility.XmlDeserializeFromString <PolicyContract>(outputXml);
                SynchroniseSubmission(s, policyCon);
                SynchroniseQuote(q, policyCon);
            }
        }
Exemple #4
0
 public CommissionErrorService(
     DataContext context,
     ICommissionService commissionService,
     IClientService clientService,
     ICommissionSplitService commissionSplitService,
     IPolicyService policyService,
     ICommissionSplitRulePolicyService commissionSplitRulePolicyService,
     IAuditService auditService)
 {
     _context                          = context;
     _commissionService                = commissionService;
     _clientService                    = clientService;
     _commissionSplitService           = commissionSplitService;
     _policyService                    = policyService;
     _commissionSplitRulePolicyService = commissionSplitRulePolicyService;
     _auditService                     = auditService;
 }
Exemple #5
0
        public SettingsPageViewModel()
        {
            _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _cryptoService        = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            _stateService         = ServiceContainer.Resolve <IStateService>("stateService");
            _deviceActionService  = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _environmentService   = ServiceContainer.Resolve <IEnvironmentService>("environmentService");
            _messagingService     = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _vaultTimeoutService  = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _syncService          = ServiceContainer.Resolve <ISyncService>("syncService");
            _biometricService     = ServiceContainer.Resolve <IBiometricService>("biometricService");
            _policyService        = ServiceContainer.Resolve <IPolicyService>("policyService");
            _localizeService      = ServiceContainer.Resolve <ILocalizeService>("localizeService");
            _keyConnectorService  = ServiceContainer.Resolve <IKeyConnectorService>("keyConnectorService");
            _clipboardService     = ServiceContainer.Resolve <IClipboardService>("clipboardService");

            GroupedItems = new ObservableRangeCollection <ISettingsPageListItem>();
            PageTitle    = AppResources.Settings;
        }
Exemple #6
0
        public InsuranceCompanyService(IPolicyService policy)
        {
            this.policyService = policy ?? throw new ArgumentNullException(nameof(policy));

            policies = new List <IPolicy>();
            policies.Add(new PolicyA()
            {
                NameOfInsuredObject = "Policy 1",
                ValidFrom           = DateTime.UtcNow,
                ValidTill           = DateTime.UtcNow.AddMonths(6),
                InsuredRisks        = new List <Risk>()
                {
                    new Risk()
                    {
                        Name        = "Risk 1",
                        YearlyPrice = 100
                    }
                }
            });
        }
 public PoliciesController(
     IPolicyRepository policyRepository,
     IPolicyService policyService,
     IOrganizationService organizationService,
     IOrganizationUserRepository organizationUserRepository,
     IUserService userService,
     CurrentContext currentContext,
     GlobalSettings globalSettings,
     IDataProtectionProvider dataProtectionProvider)
 {
     _policyRepository           = policyRepository;
     _policyService              = policyService;
     _organizationService        = organizationService;
     _organizationUserRepository = organizationUserRepository;
     _userService    = userService;
     _currentContext = currentContext;
     _globalSettings = globalSettings;
     _organizationServiceDataProtector = dataProtectionProvider.CreateProtector(
         "OrganizationServiceDataProtector");
 }
Exemple #8
0
        public ExportVaultPageViewModel()
        {
            _deviceActionService  = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _i18nService          = ServiceContainer.Resolve <II18nService>("i18nService");
            _cryptoService        = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            _exportService        = ServiceContainer.Resolve <IExportService>("exportService");
            _policyService        = ServiceContainer.Resolve <IPolicyService>("policyService");

            PageTitle             = AppResources.ExportVault;
            TogglePasswordCommand = new Command(TogglePassword);
            ExportVaultCommand    = new Command(async() => await ExportVaultAsync());

            FileFormatOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("json", ".json"),
                new KeyValuePair <string, string>("csv", ".csv"),
                new KeyValuePair <string, string>("encrypted_json", ".json (Encrypted)")
            };
        }
 public CommissionImportService(
     DataContext context,
     IBulkActions bulkActions,
     ICommissionStatementService commissionStatementService,
     IPolicyService policyService,
     IDirectoryLookupService lookupService,
     ICommissionLookupService commissionLookupService,
     ICommissionSplitService commissionSplitService,
     ICommissionSplitRulePolicyService commissionSplitRulePolicyService,
     IAuditService auditService)
 {
     _context       = context;
     _policyService = policyService;
     _lookupService = lookupService;
     _commissionStatementService = commissionStatementService;
     _bulkActions                      = bulkActions;
     _commissionLookupService          = commissionLookupService;
     _commissionSplitService           = commissionSplitService;
     _commissionSplitRulePolicyService = commissionSplitRulePolicyService;
     _auditService                     = auditService;
 }
        public PermissionsSettingsViewModel()
        {
            Title = "Permissions";
            MessengerInstance.Register<PoliciesUpdatedMessage>(this, GetPoliciesAgain);
            Updating = new PermissionViewModel();
            Installing = new PermissionViewModel();
            Remove = new PermissionViewModel();
            //Active = new PermissionViewModel();
            //Block = new PermissionViewModel();
            //Require = new PermissionViewModel();
            SetState = new PermissionViewModel();

            ChangeSystemFeed = new PermissionViewModel();
            Policy = new LocalServiceLocator().PolicyService;
            CoApp = new LocalServiceLocator().CoAppService;
            Save = new RelayCommand(ExecuteSave);
            ElevateSave = new RelayCommand(ExecuteElevateSave);

            Loaded += OnLoaded;

            UserName = Policy.UserName;
        }
        public void Setup()
        {
            PolicyDataProvder    = new PolicyDataProvider();
            RiskDataProvider     = new RiskDataProvider();
            PolicyRepository     = new PolicyRepository(PolicyDataProvder);
            RiskRepository       = new RiskRepository(RiskDataProvider);
            PolicySellService    = new PolicyService(PolicyRepository, RiskRepository, PremiumCalculator);
            RiskService          = new RiskService(PolicyRepository, RiskRepository);
            PremiumCalculator    = new PremiumCalculator(RiskRepository);
            AvailableRiskUpdater = new AvailableRiskUpdater(Company);
            DEFAULT_OBJECT_NAME  = "obj";

            Risk1 = new Risk
            {
                Name        = "Test risk 1",
                YearlyPrice = 500.0m
            };

            Risk2 = new Risk
            {
                Name        = "Test risk 2",
                YearlyPrice = 800.0m
            };

            Risk3 = new Risk
            {
                Name        = "Test risk 3",
                YearlyPrice = 400.0m
            };

            List <Risk> initialAvailableRisks = new List <Risk>();

            initialAvailableRisks.Add(Risk1);
            initialAvailableRisks.Add(Risk2);
            initialAvailableRisks.Add(Risk3);

            Company = new InsuranceCompany("If", initialAvailableRisks,
                                           PolicySellService, RiskService, PremiumCalculator);
        }
Exemple #12
0
        public SettingsPageViewModel()
        {
            _platformUtilsService = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _cryptoService        = ServiceContainer.Resolve <ICryptoService>("cryptoService");
            _stateService         = ServiceContainer.Resolve <IStateService>("stateService");
            _deviceActionService  = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _environmentService   = ServiceContainer.Resolve <IEnvironmentService>("environmentService");
            _messagingService     = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _vaultTimeoutService  = ServiceContainer.Resolve <IVaultTimeoutService>("vaultTimeoutService");
            _syncService          = ServiceContainer.Resolve <ISyncService>("syncService");
            _biometricService     = ServiceContainer.Resolve <IBiometricService>("biometricService");
            _policyService        = ServiceContainer.Resolve <IPolicyService>("policyService");
            _localizeService      = ServiceContainer.Resolve <ILocalizeService>("localizeService");
            _keyConnectorService  = ServiceContainer.Resolve <IKeyConnectorService>("keyConnectorService");
            _clipboardService     = ServiceContainer.Resolve <IClipboardService>("clipboardService");
            _loggerService        = ServiceContainer.Resolve <ILogger>("logger");

            GroupedItems = new ObservableRangeCollection <ISettingsPageListItem>();
            PageTitle    = AppResources.Settings;

            ExecuteSettingItemCommand = new AsyncCommand <SettingsPageListItem>(item => item.ExecuteAsync(), onException: _loggerService.Exception, allowsMultipleExecutions: false);
        }
Exemple #13
0
 public MobileApiController(IUserService us,
                            IPolicyInsuredService pis,
                            IAdditionalChargesService acs,
                            IPolicyService ps,
                            IFirstNoticeOfLossService fnls,
                            IHealthInsuranceService his,
                            ILuggageInsuranceService lis,
                            IOkSetupService oss,
                            IBankAccountService bas,
                            IInsuredsService iss,
                            IFirstNoticeOfLossService fis,
                            IPolicyTypeService pts,
                            IAdditionalInfoService ais,
                            ICountryService coun,
                            IExchangeRateService exch,
                            IFranchiseService fran,
                            ITravelNumberService tn,
                            IOkSetupService os)
 {
     _ps   = ps;
     _us   = us;
     _fnls = fnls;
     _lis  = lis;
     _oss  = oss;
     _his  = his;
     _bas  = bas;
     _iss  = iss;
     _fis  = fis;
     _pts  = pts;
     _ais  = ais;
     _pis  = pis;
     _acs  = acs;
     _coun = coun;
     _exch = exch;
     _fran = fran;
     _tn   = tn;
     _os   = os;
 }
Exemple #14
0
        public InsurancePolicyListViewModel(IPolicyService policyService, IUserDialogs userDialogs)
        {
            _policyService = policyService;
            _userDialogs   = userDialogs;

            CreatePolicy = new BitDelegateCommand(async() =>
            {
                INavigationParameters parameters = new NavigationParameters();
                parameters.Add("Method", EditMethod.Create);

                await NavigationService.NavigateAsync(nameof(CreateInsurancePolicyView));
            });

            ShowPolicy = new BitDelegateCommand <PolicyItemSource>(async(policy) =>
            {
                INavigationParameters parameters = new NavigationParameters();

                parameters.Add("Policy", policy);
                parameters.Add("Method", EditMethod.Update);

                await NavigationService.NavigateAsync(nameof(CreateInsurancePolicyView), parameters);
            });
        }
Exemple #15
0
        public PrimaryViewModel()
        {
            Title = "CoApp Update";
            MessengerInstance.Register<InstallationFailedMessage>(this, HandleInstallFailed);
            MessengerInstance.Register<InstallationFinishedMessage>(this, HandleInstallFinished);
            MessengerInstance.Register<SelectedProductsChangedMessage>(this, HandleChanged);

            Loaded += OnLoaded;
            var loc = new LocalServiceLocator();
            UpdateService = loc.UpdateService;
            PolicyService = loc.PolicyService;
            NavigationService = loc.NavigationService;
            AutomationService = loc.AutomationService;
            UpdateSettingsService = loc.UpdateSettingsService;

            SelectUpdates = new RelayCommand(() => NavigationService.GoTo(ViewModelLocator.SelectUpdatesViewModelStatic));
            Install = new RelayCommand(() => NavigationService.GoTo(ViewModelLocator.InstallingViewModelStatic, false));
            CheckForUpdates = new RelayCommand(() => NavigationService.GoTo(ViewModelLocator.UpdatingViewModelStatic));

            /*
            FeedWarning = new RelayCommand(() => MessengerInstance.Send(new MetroDialogBoxMessage
                                                                            {
                                                                                Title =
                                                                                    "The Following Feeds Could Not Be Reached",
                                                                                Content = Warnings,
                                                                                Buttons =
                                                                                    new ObservableCollection
                                                                                    <ButtonDescription>
                                                                                        {
                                                                                            new ButtonDescription
                                                                                                {
                                                                                                    Title = "Cancel",
                                                                                                    IsCancel = true
                                                                                                }
                                                                                        }
                                                                            }));*/
        }
 public FirstNoticeOfLossController(IUserService us,
                                    IPolicyService ps,
                                    IPolicyInsuredService pis,
                                    IInsuredsService iss,
                                    IFirstNoticeOfLossService fis,
                                    IBankAccountService bas,
                                    IPolicyTypeService pts,
                                    IAdditionalInfoService ais,
                                    IHealthInsuranceService his,
                                    ILuggageInsuranceService lis,
                                    IFirstNoticeOfLossArchiveService firstNoticeLossArchiveService)
 {
     _us  = us;
     _ps  = ps;
     _pis = pis;
     _iss = iss;
     _bas = bas;
     _pts = pts;
     _ais = ais;
     _fis = fis;
     _his = his;
     _lis = lis;
     _firstNoticeLossArchiveService = firstNoticeLossArchiveService;
 }
        public PolicyController(
            IReferenceService referenceService,
            IPolicyService policyService,
            IAuthenticationManager authenticationManager)
        {
            if (referenceService == null)
            {
                throw new ArgumentNullException("referenceService");
            }

            if (policyService == null)
            {
                throw new ArgumentNullException("policyService");
            }

            if (authenticationManager == null)
            {
                throw new ArgumentNullException("authenticationManager");
            }

            _referenceService      = referenceService;
            _policyService         = policyService;
            _authenticationManager = authenticationManager;
        }
 public ClientService(IRepository <Client> clientsRepository, IPolicyService policiesService)
 {
     _clientsRepository = clientsRepository;
     _policiesService   = policiesService;
 }
 protected PackageProductCommonViewModel()
 {
     Policy = new LocalServiceLocator().PolicyService;
     Loaded += OnLoaded;
 }
Exemple #20
0
 public PolicyController(IPolicyService policyService)
 {
     _policyService = policyService;
 }
        public AddEditPageViewModel()
        {
            _deviceActionService    = ServiceContainer.Resolve <IDeviceActionService>("deviceActionService");
            _cipherService          = ServiceContainer.Resolve <ICipherService>("cipherService");
            _folderService          = ServiceContainer.Resolve <IFolderService>("folderService");
            _userService            = ServiceContainer.Resolve <IUserService>("userService");
            _platformUtilsService   = ServiceContainer.Resolve <IPlatformUtilsService>("platformUtilsService");
            _auditService           = ServiceContainer.Resolve <IAuditService>("auditService");
            _messagingService       = ServiceContainer.Resolve <IMessagingService>("messagingService");
            _collectionService      = ServiceContainer.Resolve <ICollectionService>("collectionService");
            _eventService           = ServiceContainer.Resolve <IEventService>("eventService");
            _policyService          = ServiceContainer.Resolve <IPolicyService>("policyService");
            GeneratePasswordCommand = new Command(GeneratePassword);
            TogglePasswordCommand   = new Command(TogglePassword);
            ToggleCardCodeCommand   = new Command(ToggleCardCode);
            CheckPasswordCommand    = new Command(CheckPasswordAsync);
            UriOptionsCommand       = new Command <LoginUriView>(UriOptions);
            FieldOptionsCommand     = new Command <AddEditPageFieldViewModel>(FieldOptions);
            Uris          = new ExtendedObservableCollection <LoginUriView>();
            Fields        = new ExtendedObservableCollection <AddEditPageFieldViewModel>();
            Collections   = new ExtendedObservableCollection <CollectionViewModel>();
            AllowPersonal = true;

            TypeOptions = new List <KeyValuePair <string, CipherType> >
            {
                new KeyValuePair <string, CipherType>(AppResources.TypeLogin, CipherType.Login),
                new KeyValuePair <string, CipherType>(AppResources.TypeCard, CipherType.Card),
                new KeyValuePair <string, CipherType>(AppResources.TypeIdentity, CipherType.Identity),
                new KeyValuePair <string, CipherType>(AppResources.TypeSecureNote, CipherType.SecureNote),
            };
            CardBrandOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>($"-- {AppResources.Select} --", null),
                new KeyValuePair <string, string>("Visa", "Visa"),
                new KeyValuePair <string, string>("Mastercard", "Mastercard"),
                new KeyValuePair <string, string>("American Express", "Amex"),
                new KeyValuePair <string, string>("Discover", "Discover"),
                new KeyValuePair <string, string>("Diners Club", "Diners Club"),
                new KeyValuePair <string, string>("JCB", "JCB"),
                new KeyValuePair <string, string>("Maestro", "Maestro"),
                new KeyValuePair <string, string>("UnionPay", "UnionPay"),
                new KeyValuePair <string, string>(AppResources.Other, "Other")
            };
            CardExpMonthOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>($"-- {AppResources.Select} --", null),
                new KeyValuePair <string, string>($"01 - {AppResources.January}", "1"),
                new KeyValuePair <string, string>($"02 - {AppResources.February}", "2"),
                new KeyValuePair <string, string>($"03 - {AppResources.March}", "3"),
                new KeyValuePair <string, string>($"04 - {AppResources.April}", "4"),
                new KeyValuePair <string, string>($"05 - {AppResources.May}", "5"),
                new KeyValuePair <string, string>($"06 - {AppResources.June}", "6"),
                new KeyValuePair <string, string>($"07 - {AppResources.July}", "7"),
                new KeyValuePair <string, string>($"08 - {AppResources.August}", "8"),
                new KeyValuePair <string, string>($"09 - {AppResources.September}", "9"),
                new KeyValuePair <string, string>($"10 - {AppResources.October}", "10"),
                new KeyValuePair <string, string>($"11 - {AppResources.November}", "11"),
                new KeyValuePair <string, string>($"12 - {AppResources.December}", "12")
            };
            IdentityTitleOptions = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>($"-- {AppResources.Select} --", null),
                new KeyValuePair <string, string>(AppResources.Mr, AppResources.Mr),
                new KeyValuePair <string, string>(AppResources.Mrs, AppResources.Mrs),
                new KeyValuePair <string, string>(AppResources.Ms, AppResources.Ms),
                new KeyValuePair <string, string>(AppResources.Dr, AppResources.Dr),
            };
            FolderOptions    = new List <KeyValuePair <string, string> >();
            OwnershipOptions = new List <KeyValuePair <string, string> >();
        }
 public PolicyController(IPolicyService servicioPoliza)
 {
     _servicioPoliza = servicioPoliza;
 }
        private static void SyncQuoteCreateAndUpdate(Submission s, Quote q, IPolicyService subsribeService)
        {
            var response = subsribeService.GetReference(new GetReferenceRequest
                {
                    strPolId = q.SubscribeReference
                });

            var errorInfo = response.GetReferenceResult.ErrorInfo;
            var outputXml = response.GetReferenceResult.OutputXml;

            if (errorInfo == null)
            {
                var policyCon = Utility.XmlDeserializeFromString<PolicyContract>(outputXml);
                SynchroniseSubmission(s, policyCon);
                SynchroniseQuote(q, policyCon);
            }
        }
 public PolicyController(IResourceService resourceService, IPolicyService policyService)
 {
     _resourceService = resourceService;
     _policyService   = policyService;
 }
 public ApplyPoliciesModel(IPolicyService policyService, IWebHostEnvironment webHostEnvironment)
 {
     Title              = PoliciesManagementResources.ApplyPolicy_Title;
     PolicyService      = policyService;
     WebHostEnvironment = webHostEnvironment;
 }
        public static void GetMockSubscribeService()
        {
            var mockSubscribeService = new Mock<IPolicyService>();
            
            mockSubscribeService.Setup(s => s.CreateQuote(It.IsAny<CreateQuoteRequest>()))
                                 .Returns(new CreateQuoteResponse
                                 {
                                     CreateQuoteResult = new StandardOutput { OutputXml = CreateQuoteResponseXml() },
                                     objInfoCollection = new InfoCollection { PolId = "BAN165118A13" }
                                 });
            mockSubscribeService.Setup(s => s.GetReference(It.IsAny<GetReferenceRequest>()))
                                 .Returns(new GetReferenceResponse
                                 {
                                     GetReferenceResult =
                                         new StandardOutput { OutputXml = GetReferenceResponseXml() }
                                 });
            mockSubscribeService.Setup(s => s.UpdatePolicy(It.IsAny<UpdatePolicyRequest>()))
                .Returns(new UpdatePolicyResponse
                    {
                        UpdatePolicyResult = new StandardOutput { OutputXml = UpdatePolicyResponseXml() },
                        objInfoCollection = new InfoCollection { PolId = "BAN165118A13" }
                    });

            _mockSubscribeService = mockSubscribeService.Object;
        }
 public PoliciesApiController()
 {
     policyService = new PolicyService();
 }
        //private KexpertDb db = new KexpertDb();

        public QuoteController(IPolicyService service) : base(service)
        {
        }
 public ClaimsController()
 {
     policyService = new PolicyService();
     claimsService = new ClaimsService();
 }
 public HomeController(IPolicyService service) : base(service)
 {
 }
        public static CreateQuoteResponse CreateSubscribeRecord(Quote q, Submission s, ILogHandler logHandler, IPolicyService subsribeService)
        {
            var insuredList = new InsuredCollection();
            if (q.AdditionalInsuredList != null)
            {
                insuredList.AddRange(q.AdditionalInsuredList
                                      .Select(insured => new Insured
                                          {
                                              AddlInsdId = insured.InsuredId,
                                              AddlInsdNm = insured.InsuredId == 0 ? insured.InsuredName : null,
                                              AddlInsdTy = insured.InsuredType
                                          }));
            }

            var policyContract = new PolicyContract
                {
                    AccYr = q.AccountYear.ToString(),
                    BenchPrm = q.BenchmarkPremium,
                    BindSt = q.TechnicalPricingBindStatus,
                    BkrNo = "???", // TODO - not referenced in CreateQuote sp
                    BkrPsu = q.BrokerPseudonym, // No validation carried out in service validation sp
                    BkrSeqId = q.BrokerSequenceId,
                    Brokerage = q.Brokerage,
                    COB = q.COBId,
                    DeclineReason = q.DeclinatureReason,
                    DOM = q.Domicile,
                    EntSt = q.EntryStatus,
                    ExpyDt = (q.ExpiryDate.HasValue) ? q.ExpiryDate.Value.ToString("yyyyMMdd") : null,
                    ExsAmt = q.ExcessAmount,
                    FacyPolId = (String.IsNullOrEmpty(q.RenPolId) ? q.FacilityRef : String.Empty),
                    LdrNo = q.LeaderNo,
                    Ldr = q.Leader,
                    IncpDt = (q.InceptionDate.HasValue) ? q.InceptionDate.Value.ToString("yyyyMMdd") : null,
                    InsdId = q.InsuredId,
                    InsdNm = q.InsuredName,
                    AddlInsuredCollection = insuredList,
                    LmtAmt = q.LimitAmount,
                    LmtCcy = q.LimitCCY,
                    MOA = q.MOA,
                    OrigOff = q.OriginatingOfficeId,
                    PolTy = q.PolicyType,
                    PricingCcy = q.Currency,
                    RenPolId = q.RenPolId,
                    Status = q.SubmissionStatus,
                    TechPrm = q.TechnicalPremium,
                    UnitPsu = "AGY",
                    Uwr = q.UnderwriterCode,
                    ExsCcy = q.ExcessCCY,
                    Method = q.TechnicalPricingMethod,
                    NonLonBkr = q.NonLondonBrokerCode,
                    PctgAmt = q.TechnicalPricingPremiumPctgAmt,
                    
                    TechPmTy = "TechPm", // TODO - not referenced in CreateQuote sp
                    PolDsc = q.Description,

                    //  These are the fields required for edit only
                    TimeStamp = q.SubscribeTimestamp,
                    PolId = q.SubscribeReference,  

                    // PolAnlyCd
                    // TODO: Update this win value from form.
                    WordReqd = (string.IsNullOrEmpty(q.WordingRequired)) ? "" : q.WordingRequired,
                    AggsReqd = (string.IsNullOrEmpty(q.AggsRequired)) ? "" : q.AggsRequired,
                    FSA_Class = (string.IsNullOrEmpty(q.FSAClass)) ? "" : q.FSAClass,

					CtcNm = q.BrokerContact,
                    //CtcTelNo = q.BrokerContactPhone,
                    //CtcEmail = q.BrokerContactEmail
                };
            if (q.QuoteExpiryDate != null)
                policyContract.SettDueDt = SetSettlementDueDate(q.QuoteExpiryDate.Value, s.ExpiryDateOffset, q.InceptionDate);
            if (!string.IsNullOrEmpty(q.BrokerContactPhone)) policyContract.CtcTelNo = q.BrokerContactPhone;
            if (!string.IsNullOrEmpty(q.BrokerContactEmail)) policyContract.CtcEmail = q.BrokerContactEmail;

            if (q.RenewalRate.HasValue) policyContract.RenewalRate = q.RenewalRate;
            if (q.RenewalConditions.HasValue) policyContract.RenewalConditions = q.RenewalConditions;
            if (q.RenewalDeductibles.HasValue) policyContract.RenewalDeductibles = q.RenewalDeductibles;
            if (q.RenewalExposure.HasValue) policyContract.RenewalExposurePctg = q.RenewalExposure;
            if (q.RenewalBase.HasValue) policyContract.RenewalBase = q.RenewalBase;
            if (q.RenewalFull.HasValue) policyContract.RenewalFull = q.RenewalFull;

            var createQuoteResponse = subsribeService.CreateQuote(new CreateQuoteRequest
                {
                    objPolicyContract = policyContract
                });

            if (createQuoteResponse.CreateQuoteResult.ErrorInfo == null)
            {
                q.SubscribeReference = createQuoteResponse.objInfoCollection.PolId;

                var doc = new XmlDocument();

                doc.LoadXml(createQuoteResponse.CreateQuoteResult.OutputXml);
                
				var subscribeTimestamp = default(long);

	            q.SubscribeTimestamp = long.TryParse(doc.GetElementsByTagName("TimeStamp")[0].InnerText,
	                                                 out subscribeTimestamp)
		                                   ? subscribeTimestamp
		                                   : 0;

                SyncQuoteCreateAndUpdate(s, q, subsribeService);
            }
            else
            {
                logHandler.WriteLog(createQuoteResponse.CreateQuoteResult.ErrorInfo.ErrorXML, LogSeverity.Error,
                                     LogCategory.BusinessComponent);

	            throw new ApplicationException(
		            string.IsNullOrEmpty(createQuoteResponse.CreateQuoteResult.ErrorInfo.Description)
			            ? ParseDetailedError(createQuoteResponse.CreateQuoteResult.ErrorInfo.DetailedDescription)
			            : createQuoteResponse.CreateQuoteResult.ErrorInfo.Description);
            }

            return createQuoteResponse;
        }
 public PoliciesController(ILogger <PoliciesController> logger, IPolicyService policyService)
 {
     this._logger        = logger;
     this._policyService = policyService;
 }
Exemple #33
0
 public void TestInitialize()
 {
     policyService = Resolve <IPolicyService>();
 }
Exemple #34
0
 public PolicyController(ILogger <PolicyController> logger, IPolicyService policyService)
 {
     _logger        = logger;
     _policyService = policyService;
 }
Exemple #35
0
 public PolicyController(IPolicyService service, IMapper iMapper)
 {
     _service = service;
     _iMapper = iMapper;
 }
Exemple #36
0
 public GetPoliciesRequestHandler(IPolicyService policyService, IMapper mapper)
 {
     _policyService = policyService ?? throw new ArgumentNullException(nameof(policyService));
     _mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
 public PolicyController(IPolicyService service) 
 {
     if (service == null) throw new ArgumentNullException("IPolicyService");
     Service = service;
 }
Exemple #38
0
 public PolicyController(PolicyService pService)
 {
     this.iService = pService;
 }
        public static UpdatePolicyResponse UpdateSubscribeRecord(Quote q, Submission s, ILogHandler logHandler, IPolicyService subsribeService)
        {
            var insuredList = new InsuredCollection();
            if (s.AdditionalInsuredList != null)
            {
                insuredList.AddRange(s.AdditionalInsuredList
                                      .Select(insured => new Insured
                                      {
                                          AddlInsdId = insured.InsuredId,
                                          AddlInsdNm = insured.InsuredId == 0 ? insured.InsuredName : null,
                                          AddlInsdTy = insured.InsuredType
                                      }));
            }

            var policyContract = new PolicyContract
            {
                AccYr = q.AccountYear.ToString(),
                BenchPrm = q.BenchmarkPremium,
                BindSt = q.TechnicalPricingBindStatus,
                BkrNo = "???", // TODO - not referenced in CreateQuote sp
                BkrPsu = s.BrokerPseudonym, // No validation carried out in service validation sp
                BkrSeqId = s.BrokerSequenceId,
                Brokerage = s.Brokerage,
                COB = q.COBId,
                DeclineReason = q.DeclinatureReason,
                DOM = s.Domicile,
                EntSt = q.EntryStatus,
                ExpyDt = (q.ExpiryDate.HasValue) ? q.ExpiryDate.Value.ToString("yyyyMMdd") : null,
                ExsAmt = q.ExcessAmount,
                FacyPolId = q.FacilityRef,
                LdrNo = s.LeaderNo,
                Ldr = s.Leader,
                IncpDt = (q.InceptionDate.HasValue) ? q.InceptionDate.Value.ToString("yyyyMMdd") : null,
                InsdId = s.InsuredId,
                InsdNm = s.InsuredName,
                AddlInsuredCollection = insuredList,
                LmtAmt = q.LimitAmount,
                LmtCcy = q.LimitCCY,
                MOA = q.MOA,
                OrigOff = q.OriginatingOfficeId,
                PolTy = q.PolicyType,
                PricingCcy = q.Currency,
                RenPolId = q.RenPolId,
                Status = q.SubmissionStatus,
                TechPrm = q.TechnicalPremium,
                UnitPsu = "AGY",
                Uwr = s.UnderwriterCode,
                ExsCcy = q.ExcessCCY,
                Method = q.TechnicalPricingMethod,
                NonLonBkr = s.NonLondonBrokerCode,
                PctgAmt = q.TechnicalPricingPremiumPctgAmt,
                SettDueDt = q.QuoteExpiryDate.ToString("yyyyMMdd"),
                TechPmTy = "TechPm", // TODO - not referenced in CreateQuote sp
                PolDsc = q.Description,

                //  These are the fields required for edit only
                TimeStamp = q.SubscribeTimestamp,
                PolId = q.SubscribeReference,

                CtcNm = (string.IsNullOrEmpty(s.BrokerContact)) ? s.NewBrokerContactName : s.BrokerContact,
                CtcTelNo = s.NewBrokerContactPhoneNumber,
                CtcEmail = s.NewBrokerContactEmail
            };

            if (q.RenewalRate.HasValue) policyContract.RenewalRate = q.RenewalRate;
            if (q.RenewalConditions.HasValue) policyContract.RenewalConditions = q.RenewalConditions;
            if (q.RenewalDeductibles.HasValue) policyContract.RenewalDeductibles = q.RenewalDeductibles;
            if (q.RenewalExposure.HasValue) policyContract.RenewalExposurePctg = q.RenewalExposure;
            if (q.RenewalBase.HasValue) policyContract.RenewalBase = q.RenewalBase;
            if (q.RenewalFull.HasValue) policyContract.RenewalFull = q.RenewalFull;

            var updateResp = subsribeService.UpdatePolicy(new UpdatePolicyRequest
            {
                objPolicyContract = policyContract
            });
          
            if (updateResp.UpdatePolicyResult.ErrorInfo == null)
            {
                
                    var doc = new XmlDocument();

                    doc.LoadXml(updateResp.UpdatePolicyResult.OutputXml);

                    q.SubscribeTimestamp = long.Parse(doc.GetElementsByTagName("TimeStamp")[0].InnerText);

                    q.FacilityRef = string.IsNullOrEmpty(doc.GetElementsByTagName("NewFacyPolId")[0].InnerText)
                                        ? q.FacilityRef
                                        : doc.GetElementsByTagName("NewFacyPolId")[0].InnerText;
               
               
            }
            else
            {
                logHandler.WriteLog(updateResp.UpdatePolicyResult.ErrorInfo.ErrorXML, LogSeverity.Error,
                                     LogCategory.BusinessComponent);

                throw new ApplicationException(
                    string.IsNullOrEmpty(updateResp.UpdatePolicyResult.ErrorInfo.Description)
                        ? ParseDetailedError(updateResp.UpdatePolicyResult.ErrorInfo.DetailedDescription)
                        : updateResp.UpdatePolicyResult.ErrorInfo.Description);
            }

            return updateResp;
        }
        public IndexModel(IPolicyService policyService)
        {
            Title = PoliciesManagementResources.Index_Title;

            PolicyService = policyService;
        }
Exemple #41
0
 public LoginController(IPolicyService policyService)
 {
     this.PolicyService = policyService;
 }
 public InvokeController(IDatabaseService databaseService, IPolicyService policyService, ILogger <InvokeController> logger)
 {
     this.DatabaseService = databaseService;
     this.PolicyService   = policyService;
     this.Logger          = logger;
 }
 public HomeController(IPolicyService service) : base(service)
 {
 }