Esempio n. 1
0
 // POST Auctions
 public int Post(Auction Auction)
 {
     return DataSource<Auction>
         .Command("AddAuction")
         .Parameter(new SqlParameter("Name", Auction.Name))
         .ExecuteAndReturnId();
 }
Esempio n. 2
0
 // PUT Auctions/7
 public void Put(Auction Auction)
 {
     DataSource<Auction>
         .Command("UpdateAuction")
         .Parameter(new SqlParameter("Id", Auction.Id))
         .Parameter(new SqlParameter("Name", Auction.Name))
         .Execute();
 }
Esempio n. 3
0
 private Auction DbToModel(IDataReader reader)
 {
     Auction obj = new Auction();
     obj.Id = Convert.ToInt32(reader["Id"]);
     obj.OrganizationId = Convert.ToInt32(reader["OrgId"]);
     obj.Name = Convert.ToString(reader["Name"]);
     obj.AuctionDate = Convert.ToDateTime(reader["AuctionDate"]);
     return obj;
 }