Beispiel #1
0
 // POST Contacts
 public int Post(Contact Contact)
 {
     return DataSource<Contact>
         .Command("AddContact")
         .Parameter(new SqlParameter("Name", Contact.Name))
         .ExecuteAndReturnId();
 }
Beispiel #2
0
 // PUT Contacts/7
 public void Put(Contact Contact)
 {
     DataSource<Contact>
         .Command("UpdateContact")
         .Parameter(new SqlParameter("Id", Contact.Id))
         .Parameter(new SqlParameter("Name", Contact.Name))
         .Execute();
 }
Beispiel #3
0
 private Contact DbToModel(IDataReader reader)
 {
     Contact obj = new Contact();
     obj.Id = Utility.GetInt(reader, "Id");
     obj.SourceId = Utility.GetInt(reader, "SourceId");
     obj.SourceType = Utility.GetString(reader, "SourceType");
     obj.ContactTypeId = Utility.GetInt(reader, "ContactTypeId");
     obj.ContactType = Utility.GetString(reader, "ContactType");
     obj.Name = Utility.GetString(reader, "Name");
     obj.FirstName = Utility.GetString(reader,"FirstName");
     obj.LastName = Utility.GetString(reader, "LastName");
     obj.Email = Utility.GetString(reader, "Email");
     obj.Email2 = Utility.GetString(reader, "Email2");
     obj.Phone = Utility.GetString(reader, "Phone");
     obj.Phone2 = Utility.GetString(reader, "Phone2");
     obj.Street = Utility.GetString(reader, "Street");
     obj.Street2 = Utility.GetString(reader, "Street2");
     obj.City = Utility.GetString(reader, "City");
     obj.StateId = Utility.GetInt(reader, "StateId");
     obj.Zip = Utility.GetString(reader, "Zip");
     return obj;
 }
Beispiel #4
0
 //public ICollection<Contact> Members { get; set; }
 //public ICollection<Auction> Auctions { get; set; }
 public Organization()
 {
     BillingContact = new Contact();
     //Members = new List<Contact>();
     //Auctions = new List<Auction>();
 }