コード例 #1
0
ファイル: ContactsController.cs プロジェクト: DougLeary/spork
 // POST Contacts
 public int Post(Contact Contact)
 {
     return DataSource<Contact>
         .Command("AddContact")
         .Parameter(new SqlParameter("Name", Contact.Name))
         .ExecuteAndReturnId();
 }
コード例 #2
0
ファイル: ContactsController.cs プロジェクト: DougLeary/spork
 // 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();
 }
コード例 #3
0
ファイル: ContactsController.cs プロジェクト: DougLeary/spork
 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;
 }
コード例 #4
0
ファイル: Organization.cs プロジェクト: DougLeary/spork
 //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>();
 }