public int AddDriverRating(DriverRatingModel model) { Hashtable HT = new Hashtable(); HT.Add("DriverRatingID", model.DriverRatingID); HT.Add("DriverID", model.DriverID); HT.Add("MemberID", model.MemberID); HT.Add("Rating", model.Rating); HT.Add("CrDate", model.CrDate); int i= dbContext.ExecuteSP("udp_DriverRating_ups", HT); return i; }
//insert customer public HttpResponseMessage Post(DriverRatingModel driverRating) { if (ModelState.IsValid) { db.AddDriverRating(driverRating); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, driverRating); response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = driverRating.DriverRatingID })); return response; } else { return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState); } }