Created
April 21, 2017 08:13
-
-
Save anonymous/380c94902c543d8c402cbe0430c99fe0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected ClientAddress[] LoadClientAddresses() | |
| { | |
| // SessionData.System может быть не заданым? | |
| if (SessionData.System.Client == null) return new ClientAddress[0]; | |
| List<ClientAddress> clientAddressList = new List<ClientAddress>(); | |
| // _readOnlyDeliveryService, SessionData.System.Client или SessionData.System.Locality | |
| ClientAddress[] clientAddresses = _readOnlyDeliveryService.GetClientAddressesByDeliveryLocality(SessionData.System.Client.PhoneNumber, SessionData.System.Locality.Id); | |
| foreach (ClientAddress address in clientAddresses) | |
| { | |
| DeliveryUnit[] deliveryUnits = _readOnlyDeliveryService.GetDeliveryUnitsByStreetOrCache(address.StreetId); | |
| // Pizzerias - мне кажется здесь высокая вероятность! Это property | |
| // Вот так выглядит property: protected Pizzeria[] Pizzerias { get { if (SessionData.System.Locality == null) return new Pizzeria[0]; return _departmentsStructureService.GetPizzeriasByLocalityOrCache(SessionData.System.Locality.Id); } } | |
| if (_readOnlyDeliveryService.IsValidAddress(address, deliveryUnits, Pizzerias)) | |
| { | |
| clientAddressList.Add(address); | |
| } | |
| } | |
| return clientAddressList.ToArray(); | |
| } | |
| // Итого, кандидаты: | |
| // SessionData.System | |
| // _readOnlyDeliveryService | |
| // SessionData.System.Client | |
| // SessionData.System.Locality | |
| // Pizzerias |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment