public CustomerDTO(Customer C) { this.IsAdmin = C.IsAdmin(); this.Id = C.Id; this.Username = C.Username; this.Email = C.Email; this.Addresses = new List <AddressDTO>(); foreach (Address a in C.Addresses) { Addresses.Add(new AddressDTO(a)); } this.AdminComment = C.AdminComment; this.Phone = C.GetAttribute <String>(SystemCustomerAttributeNames.Phone); this.FullName = C.GetAttribute <String>(SystemCustomerAttributeNames.FirstName) + " " + C.GetAttribute <String>(SystemCustomerAttributeNames.LastName); this.Active = C.Active; this.Gender = C.GetAttribute <String>(SystemCustomerAttributeNames.Gender); this.Activity = C.LastActivityDateUtc; this.Birthday = C.GetAttribute <String>(SystemCustomerAttributeNames.DateOfBirth); this.Company = C.GetAttribute <String>(SystemCustomerAttributeNames.Company); ShoppingCart = new List <CartItemDTO>(); this.Wishlist = new List <CartItemDTO>(); foreach (ShoppingCartItem item in C.ShoppingCartItems) { if (item.ShoppingCartType.Equals(ShoppingCartType.ShoppingCart)) { ShoppingCart.Add(new CartItemDTO(item)); } else { Wishlist.Add(new CartItemDTO(item)); } } }
private async void LoadData() { var friends = await _dataService.GetFriends(); foreach (var friendModel in friends) { Friends.Add(friendModel); } var result = await _dataService.GetWishList(); foreach (var giftModel in result) { Wishlist.Add(giftModel); } }