Exemple #1
0
        private void AddAddress()
        {
            if (AddAddressPhoneEmailInteractioNRequest != null)
            {
                var countries = CountryRepository.Countries.Expand(c => c.Regions).ToArray();

                var parameters = new List <KeyValuePair <string, object> >
                {
                    new KeyValuePair <string, object>("item", new Address()),
                    new KeyValuePair <string, object>("countries", countries)
                };

                var itemVm = _addressVmFactory.GetViewModelInstance(parameters.ToArray());

                var confirmation = new ConditionalConfirmation {
                    Title = "Enter address details".Localize(), Content = itemVm
                };

                AddAddressPhoneEmailInteractioNRequest.Raise(confirmation,
                                                             (x) =>
                {
                    if (x.Confirmed)
                    {
                        var itemToAdd =
                            (x.Content as IAddressDialogViewModel)
                            .InnerItem;
                        itemToAdd.MemberId = InnerItem.MemberId;

                        ContactAddresses.Add(itemToAdd);
                    }
                });
            }
        }
 private void CreateContactAddress(Guid contactId)
 {
     ContactAddresses.Add(
         new ContactAddress
     {
         Id         = _faker.Random.Guid(),
         Address    = _faker.Address.FullAddress(),
         PostalCode = _faker.Address.ZipCode(),
         Country    = "Belgium",
         ContactId  = contactId
     });
 }