You are a helpful assistant. private string GetNewValue(Deal deal,…
- User
You are a helpful assistant. private string GetNewValue(Deal deal, KaskoModificationsInBasket modification) { if ((KaskoModificationCodes)modification.ModificationListForKaskoCode == KaskoModificationCodes.PersonNameOrBirthDateChange && modification.ChangePath == "Driver.Subject.IndividualEntity.Person.LastName") { var driversNames = deal.AutoDeal.Drivers.Select(d => d.Subject.IndividualEntity.Person.GetFullName()).ToList(); return string.Join(", ", driversNames); }
if ((KaskoModificationCodes)modification.ModificationListForKaskoCode == KaskoModificationCodes.PersonNameOrBirthDateChange && modification.ChangePath == "Insurant.Subject.IndividualEntity.Person.LastName") { var insurant = deal.GetInsurantPerson(); return insurant.GetFullName(); } if ((KaskoModificationCodes)modification.ModificationListForKaskoCode == KaskoModificationCodes.PersonNameOrBirthDateChange && modification.ChangePath == "Owner.Subject.IndividualEntity.Person.LastName") { var owner = deal.GetOwner(); return owner.GetPerson().GetFullName(); } if ((KaskoModificationCodes)modification.ModificationListForKaskoCode == KaskoModificationCodes.InsurantOwnerIdentityDocumentChange) { var identityDocument = modification.ChangePath.Contains(nameof(deal.Insurant)) ? deal.Insurant.IdentityDocument : deal.GetOwner().IdentityDocument; return $"Серия: {identityDocument?.Series} №: {identityDocument?.Number} дата выдачи: {identityDocument?.DateIssue?.ToString("dd.MM.yyyy")}"; } if ((KaskoModificationCodes)modification.ModificationListForKaskoCode == KaskoModificationCodes.AutoTsIdentityCardChange) { var tsIdentityCard = deal.AutoDeal.TsIdentityCard; return $"Серия: {tsIdentityCard?.Series} №: {tsIdentityCard?.Number}{(tsIdentityCard?.DateOfIssued != null ? $" дата выдачи: {tsIdentityCard.DateOfIssued.Value.ToString("dd.MM.yyyy")}" : string.Empty)}"; } return _pathManager.GetValueByPath(deal, ModifyPath(modification.ChangePath)).ToString(); }У меня все водители в одну строку прописываются почему то
- Assistant