public ExampleCustomerViewModel()
     : base(null)
 {
     Customer = new Customer()
         {
             CompanyName = "MI6",
             FirstName = "James",
             LastName = "Bond",
             IsIndividual = false,
             CurrentBalance = 125.27m
         };
     CompanyFile = new CompanyFile() {Name = "Sample Company"};
 }
Example #2
0
        private static MYOBCustomerContact MakeMyobCustomerContact(MYOBCustomer myobCustomer)
        {
            var myobContact = new MYOBCustomerContact
            {
                CompanyName  = myobCustomer.CompanyName,
                IsIndividual = myobCustomer.IsIndividual,
                FirstName    = myobCustomer.FirstName,
                LastName     = myobCustomer.LastName,
                UID          = myobCustomer.Uid
            };

            return(myobContact);
        }
Example #3
0
        private MYOBCustomer MakeMyobCustomer(MYOBCustomerContact myobCust)
        {
            var myobCustomer = new MYOBCustomer
            {
                CompanyName  = myobCust.CompanyName,
                IsIndividual = myobCust.IsIndividual,
                FirstName    = myobCust.FirstName,
                LastName     = myobCust.LastName,
                Uid          = myobCust.UID
            };

            return(myobCustomer);
        }
Example #4
0
        public PelicanCustomer(Customer item, Guid companyFileId)
        {
            PartitionKey = companyFileId.ToString("D");
            RowKey = item.UID.ToString("D");
            Timestamp = DateTime.UtcNow;

            Id = item.UID.ToString("D");
            Name = String.IsNullOrWhiteSpace(item.CompanyName)
                       ? String.Format("{0}, {1}",
                                       item.LastName,
                                       item.FirstName)
                       : item.CompanyName;
            if (item.Addresses.Any())
            {
                var addressData = item.Addresses.First();
                Address = string.Format("{0}, {1}, {2}",
                                        addressData.Street,
                                        addressData.City,
                                        addressData.PostCode);
            }
            PictureUrl = item.Notes;
            Balance = item.CurrentBalance;
        }
 public void DisplayCustomers(Customer[] collection)
 {
     Customers.Clear();
     RawCustomers.Clear();
     RawCustomers.AddRange(collection);
     foreach (var contact in collection.Maybe(_ => _, new Contact[0]))
     {
         var customer = new CustomerViewModel(_keyService)
             {
                 Customer = contact,
                 CompanyFile = _companyFileModel.CompanyFile,
                 Credentials = new CompanyFileCredentials(CompanyFile.Authentication[0].Username, CompanyFile.Authentication[0].Password)
             };
         Customers.Add(customer);
         customer.FetchPicture();
     }
 }