private HttpResponseMessage ProcessExistingO2Record(HttpRequestMessage request, O2ReadingDTO cqDto, int contactId, string key, int companyId, int UserId) { var o2r = new O2ReadingRepository(); var o2 = new O2Reading(); o2 = o2r.GetById(contactId); // is the Pond eligible to update the prospect? var validationErrors = GetO2ValidationErrors(o2r, o2, cqDto, companyId, UserId); if (validationErrors.Any()) { return(ProcessValidationErrors(request, validationErrors, key)); } // no validation errors... o2r.Save(o2); UpdatePondHealthStatusByLevel(o2.PondId, o2.O2Level); cqDto.Key = key; return(request.CreateResponse(HttpStatusCode.Accepted, cqDto)); }
private HttpResponseMessage ProcessExistingO2Record(HttpRequestMessage request, O2ReadingDTO cqDto, int contactId, string key, int companyId, int UserId) { var o2r = new O2ReadingRepository(); var o2 = new O2Reading(); o2 = o2r.GetById(contactId); // is the Pond eligible to update the prospect? var validationErrors = GetO2ValidationErrors(o2r, o2, cqDto, companyId, UserId); if (validationErrors.Any()) { return ProcessValidationErrors(request, validationErrors, key); } // no validation errors... o2r.Save(o2); UpdatePondHealthStatusByLevel(o2.PondId, o2.O2Level); cqDto.Key = key; return request.CreateResponse(HttpStatusCode.Accepted, cqDto); }