private bool IsChildAllowedForClaimDetail(TreeStructureStore child, DtoBase parent) { IClaimDetailData claimDetailData = null; claimDetailData = parent.Data as ClaimDetailData; switch (child.Node) { case "ClaimDetailMainDetails": if (claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_AD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPVD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPPD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPI || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_LIA) { return true; } break ; case "CurrentReserve": if (claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_AD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPVD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPPD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPI || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_LIA) { return claimDetailData.HasHistoricalReserves.GetValueOrDefault(false) ? true : false; } break ; case "CurrentRecoveryReserve": if (claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_AD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPVD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPPD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPI || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_LIA) { return claimDetailData.HasHistoricalRecoveryReserves.GetValueOrDefault(false) ? true : false; } break; case "ClaimDetailExtendedInfo": if (claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_AD || claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPVD) { child.Label.DefaultValue = "Repair Information"; return true; } else if (claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_TPI) { child.Label.DefaultValue = "Medical Reports"; return true; } else if (claimDetailData.ClaimDetailTypeCode == AXAClaimConstants.CLAIMDETAILTYPE_LIA) { child.Label.DefaultValue = "Exposure / Medical"; return true; } break; } return false; }
/// <summary> /// Method to check whether the node will be available on screen or not. /// </summary> /// <param name="transactionController">Object of ITransactionController</param> /// <param name="definition">Tree Structure Store</param> /// <param name="parentDto">Dto base</param> /// <returns>bool value</returns> public bool IsAvailable(ITransactionController transactionController, TreeStructureStore definition, DtoBase parentDto) { bool result = true; if (this._appModel.ShellConfiguration.ConfigurationSettings["NameFinancialAccountMaintenancePermissionToken"] != null && !this._appModel.ShellConfiguration.ConfigurationSettings["NameFinancialAccountMaintenancePermissionToken"].SettingParmeters.IsNullOrEmpty()) { string tokenName = this._appModel.ShellConfiguration.ConfigurationSettings["NameFinancialAccountMaintenancePermissionToken"].SettingParmeters[0].SettingValue; if (!string.IsNullOrEmpty(tokenName) && !this._appModel.UserProfile.HasPermission(tokenName)) { result = false; } } return result; }
private ObservableCollection<TreeNodeData<ActionKey>> CreateNodesForDefinition(ITransactionController transactionController, TreeStructureStore definition, DtoBase dto) { AXAClaimModel model = (AXAClaimModel)transactionController.Model; ObservableCollection<TreeNodeData<ActionKey>> nodes = new ObservableCollection<TreeNodeData<ActionKey>>(); INodeAvailabilityBehaviour nodeAvailabilityBehavior = transactionController.Container.Resolve<INodeAvailabilityBehaviour>(definition.AvailabilityBehaviour); if (nodeAvailabilityBehavior.IsAvailable(transactionController, definition, dto)) { var groupDefinition = definition.Clone(); groupDefinition.Parent = definition.Parent; var groupingNode = transactionController.CreateNavigationData(groupDefinition, dto); groupingNode.Context = transactionController.Model; model.RefreshProperty(); nodes.Add(groupingNode); } return nodes; }
public IEnumerable<TreeNodeData<ActionKey>> CreateNodes(ITransactionController transactionController, TreeStructureStore definition, DtoBase parentDto) { return this.CreateNodesForDefinition(transactionController, definition, parentDto); }
public bool IsAvailable(XIAP.Frontend.Infrastructure.ITransactionController transactionController, TreeStructureStore definition, DtoBase parentDto) { return this.IsChildAllowedForClaimDetail(definition,parentDto); }