/// <summary> /// insert (anyone) /// </summary> /// <param name="sponsorRequestResult"></param> /// <returns></returns> // public HttpResponseMessage Post(SponsorRequestResult sponsorRequestResult) { sponsorRequestResult.SvccEnteredInSystem = false; sponsorRequestResult.SvccRespondedTo = false; sponsorRequestResult.SvccNotes = ""; sponsorRequestResult.CreateDate = DateTime.Now.Subtract(new TimeSpan(3, 0, 0, 0)); // PST SponsorRequestManager.I.Insert(sponsorRequestResult); SendMailConfirmation(sponsorRequestResult.ContactEmail, sponsorRequestResult.Company, sponsorRequestResult.Id); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, new { success = true, data = new List<SponsorRequestResult> { sponsorRequestResult } }); //HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, new //{ // message = "problem here!", // success = false // // data = new List<SponsorRequestResult> { sponsorRequestResult } //}); //HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, sponsorRequestResult); return response; }
public HttpResponseMessage Put(SponsorRequestResult sponsorRequestResult) { if (sponsorRequestResult == null) throw new ArgumentNullException("sponsorRequestResult"); //return Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, "error here!!! in tags"); var rec = SponsorRequestManager.I.Get(new SponsorRequestQuery() { Id = sponsorRequestResult.Id }).FirstOrDefault(); if (rec != null) { SponsorRequestManager.I.Update(sponsorRequestResult); } HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, new { success = true, data = new List<SponsorRequestResult> { sponsorRequestResult } }); //HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, sponsorRequestResult); return response; }