Exemplo n.º 1
0
        // Create Methods
        public static Customer CreateCustomer(Customer instance)
        {
            List<Customer> companies = GetCustomerList();

            // Set ID's
            string ID = (companies.Max(a => Convert.ToInt32(a.ID)) + 1).ToString();
            instance.ID = ID;
            instance.PrimaryAddress.ID = string.Format("{0}-a1", ID);

            companies.Add(instance);
            SaveCustomers(companies);
            return instance;
        }
Exemplo n.º 2
0
 public Customer CreateCustomer(Customer instance)
 {
     return XmlDataStore.CreateCustomer(instance);
 }
Exemplo n.º 3
0
 public Customer UpdateCompanyJson(Customer instance)
 {
     return XmlDataStore.UpdateCustomer(instance);
 }
Exemplo n.º 4
0
 // Update Methods
 public static Customer UpdateCustomer(Customer instance)
 {
     List<Customer> companies = GetCustomerList();
     if (companies.Where(obj => obj.ID == instance.ID).Count() != 0)
         companies.Remove(companies.First(obj => obj.ID == instance.ID));
     companies.Add(instance);
     SaveCustomers(companies);
     return instance;
 }