Ejemplo n.º 1
0
 /// <summary>
 /// Adds a Ticket Amount.  This changes the Ticket Amount for all future Tickets.
 /// </summary>
 /// <param name="ticketAmount">Decimal.  Amount of all tickets going forward</param>
 /// <returns>TicketAmount</returns>
 public HttpResponseMessage PostTicketAmount(TicketAmount ticketAmount)
 {
     if (ModelState.IsValid)
     {
         using (BowlingJackpotRepository rep = new BowlingJackpotRepository())
         {
             rep.AddTicketAmount(ticketAmount);
         }
         return this.Request.CreateResponse<TicketAmount>(HttpStatusCode.Created, ticketAmount);
     }
     else
         return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
 }
 public TicketAmount AddTicketAmount(TicketAmount ticketAmount)
 {
     context.TicketAmounts.Add(ticketAmount);
     Save();
     return ticketAmount;
 }