public int ApplyForBooking(BookingApplyModel model) { Hashtable HT = new Hashtable(); HT.Add("BookingID", model.BookingID); HT.Add("DriverID", model.DriverID); HT.Add("ApplyTime", model.ApplyTime); int i = dbContext.ExecuteSP("udp_BookingApply_ups", HT); return i; }
//insert BookingApply public HttpResponseMessage Post(BookingApplyModel bookingApply) { if (ModelState.IsValid) { db.ApplyForBooking(bookingApply); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, bookingApply); response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = bookingApply.BookingID })); return response; } else { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } }