// GET: Addresses
 public ActionResult Index()
 {
     try
     {
         var addresses = _addressManager.GetAll();
         return(View(addresses.ToList()));
     }
     catch (Exception ex)
     {
         return(View("Error", new HandleErrorInfo(ex, "Addresses", "Index")));
     }
 }
示例#2
0
        public IHttpActionResult GetAll()
        {
            try
            {
                var addresses    = _addressManager.GetAll <Address>();
                var addressesDTO = _addressFactory.CreateAddressDTO(addresses);

                return(Content(HttpStatusCode.OK, addressesDTO));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
        public IHttpActionResult GetAll()
        {
            try
            {
                var patients          = _patientManager.GetAll <Patient>();
                var addresses         = _addressManager.GetAll <Address>();
                var emergencyContacts = _emergencyContactManager.GetAll <EmergencyContact>();
                var consultations     = _consultationManager.GetAll <Consultation>();
                var appointments      = _appointmentManager.GetAll <Appointment>();

                var patientsDTO = _patientFactory.CreatePatientDTO(patients, addresses, emergencyContacts, consultations, appointments);

                return(Content(HttpStatusCode.OK, patientsDTO));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.InternalServerError, ex.Message));
            }
        }