public JsonResult PostData(Patient patient) { Patient dataPatient = new Patient(); dataPatient.Name = patient.Name; dataPatient.SpecieId = patient.SpecieId; dataPatient.BirthDate = patient.BirthDate; dataPatient.ClientId = patient.ClientId; dataPatient.Observation = patient.Observation; if (patient.Id > 0) { dataPatient.Id = patient.Id; db.Update(dataPatient); } else db.Add(dataPatient); return Json("success", JsonRequestBehavior.AllowGet); }
public AddPatientResponse add(AddPatientRequest request) { try { var response = new AddPatientResponse(); var bc = new PatientComponent(); response.Result = bc.Add(request.Patient); return(response); } catch (Exception ex) { var httpError = new HttpResponseMessage() { StatusCode = (HttpStatusCode)422, ReasonPhrase = ex.Message }; throw new HttpResponseException(httpError); } }
public Patient Add(Patient paciente) { var model = bs.Add(paciente); return(model); }