예제 #1
0
        public static Contact CreateContact(string customer, Contact instance)
        {
            List<Contact> contacts = GetContacts(customer);

            // Set ID
            string ID = (contacts.Count + 1).ToString();
            instance.ID = string.Format("{0}-c{1}", customer, ID);

            contacts.Add(instance);
            SaveContacts(customer, contacts);
            return instance;
        }
예제 #2
0
 public Contact CreateContactJson(string customer, Contact instance)
 {
     return XmlDataStore.CreateContact(customer, instance);
 }
예제 #3
0
 public Contact UpdateContact(string customer, Contact instance)
 {
     return XmlDataStore.UpdateContact(customer, instance);
 }
예제 #4
0
 public static Contact UpdateContact(string customer, Contact instance)
 {
     List<Contact> contacts = GetContacts(customer);
     contacts.Remove(contacts.First(obj => obj.ID == instance.ID));
     contacts.Add(instance);
     SaveContacts(customer, contacts);
     return instance;
 }