Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        public Patient Add(Patient paciente)
        {
            var model = bs.Add(paciente);

            return(model);
        }