예제 #1
0
        private void StartGraph(GlobalSearchControllerArgs args, ClaimHeaderData claimHeaderData)
        {
            args.SetProperty("ClientReference", claimHeaderData.CustomReference01);
            args.SetProperty("OutsourceReference", claimHeaderData.CustomReference02);

            // For Search Tab Title
            args.SetProperty("ClaimTitle", claimHeaderData.ClaimTitle);
            args.SetProperty("ProductCode", this.claimModel.ProductCode);
            args.SetProperty("ClaimReference", claimHeaderData.ClaimReference);

            TaskArgumentsHolder argsHolder = new TaskArgumentsHolder(null, args);
            NavigationManager manager = this.Container.Resolve<NavigationManager>();

            // Starting the search graph.
            manager.Start("DuplicateClaimSearchGraph", argsHolder);
        }
예제 #2
0
 private SearchContext LoadSearchContext(GlobalSearchControllerArgs args)
 {
     SearchContext context = new SearchContext();
     context.ChannelCriteria = args.SearchCriteria.GetChannelCriteria();
     context.RegisterSearchChannel = this.RegisterChannel;
     // Set the task arguments in the serach request.
     this.ClaimSearchModel.SearchCriteria = args;
     return context;
 }
예제 #3
0
 private void SetDriver(GlobalSearchControllerArgs args, string driver, ClaimHeaderDto claimHeaderDto)
 {
     args.SetProperty("DriverSurname", driver);
 }
예제 #4
0
        private void SetRegistrationNbr(GlobalSearchControllerArgs args, List<ClaimIOVehicleDto> vehicleDtoHeavyDataList)
        {
            StringBuilder DclRegistrationNbr = new StringBuilder();
            vehicleDtoHeavyDataList.ForEach(ioVehicleData =>
                    {
                        if (ioVehicleData.ClaimIOVehicleData != null)
                        {
                            if (DclRegistrationNbr.Length == 0)
                            {
                                DclRegistrationNbr.Append(ioVehicleData.ClaimIOVehicleData.RegistrationNumber);
                            }
                            else
                            {
                                DclRegistrationNbr.Append("," + ioVehicleData.ClaimIOVehicleData.RegistrationNumber);
                            }
                        }
                    });

            if (DclRegistrationNbr.Length == 0)
            {
                args.SetProperty("DclRegistrationNbr", null);
            }
            else
            {
                args.SetProperty("DclRegistrationNbr", DclRegistrationNbr.ToString());
            }
        }
예제 #5
0
 private void SetClaimant(GlobalSearchControllerArgs args, string claimaint)
 {
     args.SetProperty("ClaimantSurname", claimaint);
 }
예제 #6
0
        private void StartDuplicateClaimSearch(ClaimHeaderDto claimHeaderDto)
        {
            GlobalSearchControllerArgs args = new GlobalSearchControllerArgs();
            args.SearchCriteria = new XIAP.FrontendModules.Infrastructure.Search.UiSearchCriteria();

            this.SetGlobalSearchControllerArgs(claimHeaderDto, 
		 args, 
		 (returnArg) =>
            {
                ClaimHeaderData claimHeaderData = claimHeaderDto.Data as ClaimHeaderData;
                returnArg.SetProperty("DateOfLoss", DateTime.Parse(claimHeaderData.DateOfLossFrom.Value.Date.ToShortDateString()));
                this.StartGraph(returnArg, claimHeaderData);
            });
        }
예제 #7
0
        private void SetGlobalSearchControllerArgs(ClaimHeaderDto claimHeaderDto, GlobalSearchControllerArgs args, Action<GlobalSearchControllerArgs> callbackArgs = null)
        {
            ObservableCollection<long> listOfNameIDs = new ObservableCollection<long>();
            var nameIdandNameNameInvolvementTypeCollection = new List<Tuple<long, short>>(); 

            // Get ClientID
            ClaimNameInvolvementData claimNameInvolvementData = this.GetClaimNameInvolvementByType(claimHeaderDto.ClaimInvolvements, (short)StaticValues.NameInvolvementType.MajorInsured);

            if (claimNameInvolvementData != null && claimNameInvolvementData.NameID != null)
            {
                args.SetProperty("ClientID", claimNameInvolvementData.NameID.Value);
            }

            // Get Driver
            claimNameInvolvementData = this.GetClaimNameInvolvementByType(claimHeaderDto.ClaimInvolvements, (short)StaticValues.NameInvolvementType.Driver);

            if (claimNameInvolvementData != null && claimNameInvolvementData.NameID != null)
            {
                listOfNameIDs.Add(claimNameInvolvementData.NameID.Value);
                nameIdandNameNameInvolvementTypeCollection.Add(new Tuple<long, short>(claimNameInvolvementData.NameID.Value, claimNameInvolvementData.NameInvolvementType.Value));
            }

            // Get All Additional claimant.
            var claimNameInvolvementDataList = this.GetAllClaimNameInvolvementDtoByType(claimHeaderDto.ClaimInvolvements, (short)StaticValues.NameInvolvementType.AdditionalClaimant);
            foreach (ClaimNameInvolvementData claimantNameInvolvementData in claimNameInvolvementDataList)
            {
                if (claimantNameInvolvementData.NameID.HasValue)
                {
                    listOfNameIDs.Add(claimantNameInvolvementData.NameID.Value);
                    nameIdandNameNameInvolvementTypeCollection.Add(new Tuple<long, short>(claimantNameInvolvementData.NameID.Value, claimantNameInvolvementData.NameInvolvementType.Value));
                }
            }

            if (listOfNameIDs.Count > 0)
            {
                string name = string.Empty;

                this._nameService.QueryNameDetails(listOfNameIDs, (data) =>
                {
                    if (data != null)
                    {
                        StringBuilder claimantsSurname = new StringBuilder();
                        data.ForEach(nameData =>
                            {
                                if (nameData.NameType == (int)XIAP.FrontendModules.Common.InsuranceDirectoryService.NameType.Company)
                                {
                                    name = nameData.CompanyDetailVersions.FirstOrDefault(c => c.IsLatestVersion == true).ListName;
                                }
                                else
                                {
                                    name = nameData.PersonDetailVersions.FirstOrDefault(c => c.IsLatestVersion == true).Surname;
                                }

                                List<short> nameInvolvementTypes = nameIdandNameNameInvolvementTypeCollection.Where(a => a.Item1 == nameData.NameID).Select(a => a.Item2).ToList();
                                foreach (var involvementType in nameInvolvementTypes)
                                {
                                    if (involvementType == (short)StaticValues.NameInvolvementType.AdditionalClaimant)
                                    {
                                        if (claimantsSurname.Length == 0)
                                        {
                                            claimantsSurname.Append(name);
                                        }
                                        else
                                        {
                                            claimantsSurname.Append("," + name);
                                        }
                                    }

                                    if (involvementType == (short)StaticValues.NameInvolvementType.Driver)
                                    {
                                        this.SetDriver(args, name, claimHeaderDto);
                                    }
                                }
                            });

                        if (claimantsSurname.Length == 0)
                        {
                            this.SetClaimant(args, null);
                        }
                        else
                        {
                            this.SetClaimant(args, claimantsSurname.ToString());
                        }
                    }

                    if (args.ContainsProperty("DriverSurname"))
                    {
                        List<ClaimIOVehicleDto> ioVehicleDtoLiteDataList = new List<ClaimIOVehicleDto>();
                        List<ClaimIOVehicleDto> ioVehicleDtoHeavyDataList = new List<ClaimIOVehicleDto>();
                        if (claimHeaderDto.ClaimIOInvolvements.IsNullOrEmpty() == false)
                        {
                            claimHeaderDto.ClaimIOInvolvements.ForEach(ioInv =>
                            {
                                if (ioInv.ClaimInsuredObject != null && ioInv.ClaimInsuredObject.ClaimIOVehicles.IsNullOrEmpty() == false)
                                {
                                    ioInv.ClaimInsuredObject.ClaimIOVehicles.ForEach(ioVehicle =>
                                    {
                                        if (ioVehicle.IsFull)
                                        {
                                            ioVehicleDtoHeavyDataList.Add(ioVehicle);
                                        }
                                        else
                                        {
                                            ioVehicleDtoLiteDataList.Add(ioVehicle);
                                        }
                                    });
                                }
                            });

                            if (ioVehicleDtoLiteDataList.IsNullOrEmpty())
                            {
                                this.SetRegistrationNbr(args, ioVehicleDtoHeavyDataList);
                                if (callbackArgs != null)
                                {
                                    callbackArgs(args);
                                }
                            }
                            else
                            {
                                int count = ioVehicleDtoLiteDataList.Count;
                                this.ValidateAndLoadHeavy(Guid.Empty,
                                    ioVehicleDtoLiteDataList,
                                    RetrievalType.Component,
                                    BusinessDataVariant.Full,
                                    (DtoBase response) =>
                                    {
                                        ioVehicleDtoHeavyDataList.Add((ClaimIOVehicleDto)response);
                                        count--;
                                        ioVehicleDtoLiteDataList.RemoveAt(count);
                                        if (ioVehicleDtoLiteDataList.IsNullOrEmpty())
                                        {
                                            this.SetRegistrationNbr(args, ioVehicleDtoHeavyDataList);
                                            if (callbackArgs != null)
                                            {
                                                callbackArgs(args);
                                            }
                                        }
                                    });
                            }
                        }
			else if (callbackArgs != null)
                        {
                            callbackArgs(args);
                        }
                    }
                    else if (callbackArgs != null)
                    {
                        callbackArgs(args);
                    }
                });
            }
            else
            {
                if (callbackArgs != null)
                {
                    callbackArgs(args);
                }
            }
        }