Example #1
0
 private void SetDriver(GlobalSearchControllerArgs args, string driver, ClaimHeaderDto claimHeaderDto)
 {
     args.SetProperty("DriverSurname", driver);
 }
Example #2
0
 protected void DisplayClaimHeader(ClaimHeaderDto claimHeaderDto)
 {
     this.Model.TreeModel.SetSelectedTreeNode(NavigationNodeNames.ClaimHeader, claimHeaderDto.Data.DataId);
     ActionKey key = this.claimModel.ClaimTreeModel.TreeLookup.Keys.Where(k => k.Identifier == this.Model.HeaderDto.Data.DataId && k.NodeName == this.Navigator.CurrentNode.NodeName).FirstOrDefault();
     if (key != null && key.NodeInfo != null)
     {
         key.NodeInfo.Sync(key.NodeInfo.Context);
     }
 }
Example #3
0
        private void PrepareDuplicateClaimSearch(ClaimHeaderDto claimHeaderDto)
        {
            List<ClaimInvolvementDto> claimNIList = new List<ClaimInvolvementDto>();

            claimHeaderDto.ClaimInvolvements.ForEach(d =>
            {
                if (!d.IsFull)
                {
                    claimNIList.Add(d);
                }
            });

            if (claimNIList.Count > 0)
            {
                this.LoadNameInvolvementHeavyData(claimNIList, claimHeaderDto);
            }
            else
            {
                this.StartDuplicateClaimSearch(claimHeaderDto);
            }
        }
Example #4
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);
            });
        }
Example #5
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);
                }
            }
        }
Example #6
0
 private void LoadNameInvolvementHeavyData(List<ClaimInvolvementDto> dtoList, ClaimHeaderDto claimHeaderDto)
 {
     int count = 0;
     this.ValidateAndLoadHeavy<ClaimInvolvementDto>(Guid.Empty,
         dtoList,
                 RetrievalType.WithChildHierarchy,
                 BusinessDataVariant.Full,
                 (DtoBase value) =>
                 {
                     count++;
                     if (count == dtoList.Count)
                     {
                         StartDuplicateClaimSearch(claimHeaderDto);
                     }
                 });
 }
Example #7
0
 protected override void OnCoverageVerification(ClaimHeaderDto claimHeaderDto, Action complete)
 {
     this._payloadManager.VirtualProcess = VirtualProcessRequestBuilder.BuildComponentVirtualProcessRequest(this._payloadManager, claimHeaderDto.Data.DataId, "CoverageVerificationPolicyAttachmentValidation");
     this.Model.IsBusy = true;
     this._payloadManager.SynchroniseData(claimHeaderDto,
         this.Model.TransactionId,
         (Response r) =>
     {
             this.Model.IsBusy = false;
             if (r.Status == BusinessTransactionStatus.Valid && r.Messages.IsNullOrEmpty())
         {
                 base.OnCoverageVerification(claimHeaderDto, complete);
         }
         });
     }
Example #8
0
 private bool CanSearch(ClaimHeaderDto header)
 {
     return this._canExecute;
 }
Example #9
0
 private void OnSearchClick(ClaimHeaderDto header)
 {
     this.InvokeEvent(this.DuplicateClaimCheckClick, new CommandEventArgs<ClaimHeaderDto>(header));
 }
Example #10
0
 private Dictionary<Guid, ClaimNameInvolvementDto> GetClaimHeaderNameInvolvement(ClaimHeaderDto claimHeader)
 {
     //// This Method provide us all the ClaimNameInvolvements 
     IEnumerable<ClaimNameInvolvementDto> ni = claimHeader.ClaimInvolvements
         .Where(c => c.Data != null && ((IClaimInvolvementData)c.Data).ClaimInvolvementType == (short)StaticValues.LinkableComponentType.NameInvolvement).Where(a => a.ClaimNameInvolvements != null)
         .SelectMany(b => b.ClaimNameInvolvements).Where(a => a.Data != null && ((IClaimNameInvolvementData)a.Data).NameID != null && ((IClaimNameInvolvementData)a.Data).NameInvolvementMaintenanceStatus == (short)StaticValues.ClaimNameInvolvementMaintenanceStatus.Latest);
     return ni.ToDictionary(n => n.Data.DataId, n => n);
 }
        private string GetRegistationNumber(ClaimHeaderDto claimHeader, List<Guid> dataID, Dictionary<Guid, DtoBase> dtos)
        {
            string registrationNumber = null;
            if (claimHeader.ClaimInvolvementLinks != null)
            {
                foreach (Guid guidId in dataID)
                {
                    // ClaimInvolvementLinks that has ClaimInvolvementFromDataID equals to NameInvolvementDataID
                    var fromClaimInvolvementDataLinks = claimHeader.ClaimInvolvementLinks.Where((cil => (cil.Data as IClaimInvolvementLinkData).ClaimInvolvementFromDataId != null && (cil.Data as IClaimInvolvementLinkData).ClaimInvolvementFromDataId == guidId));

                    if (fromClaimInvolvementDataLinks != null && fromClaimInvolvementDataLinks.Count() > 0)
                    {
                        List<Guid> toClaimInvolvementDataIDs = fromClaimInvolvementDataLinks.Select(clml => (clml.Data as IClaimInvolvementLinkData).ClaimInvolvementToDataId).ToList();
                        registrationNumber = this.GetRegistrationNumerOfLinkedVehicleObject(toClaimInvolvementDataIDs, dtos);
                    }
                    else
                    {
                        registrationNumber = string.Empty;
                    }
                }
            }

            return registrationNumber;
        }