Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var p = new PacienteApiProcess();

            Paciente paciente = p.ReadBy(id);

            p.Delete(paciente);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit(Paciente paciente)
 {
     if (ModelState.IsValid)
     {
         var p = new PacienteApiProcess();
         p.Update(paciente);
         return(RedirectToAction("Index"));
     }
     return(View(paciente));
 }
Ejemplo n.º 3
0
        public ActionResult Create(Paciente paciente)
        {
            try
            {
                var p = new PacienteApiProcess();
                p.Add(paciente);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var      p        = new PacienteApiProcess();
            Paciente paciente = p.ReadBy(id.Value);

            if (paciente == null)
            {
                return(HttpNotFound());
            }
            return(View(paciente));
        }
Ejemplo n.º 5
0
        public ActionResult Create()
        {
            //estados
            var        cita = new Cita();
            SelectList list = new SelectList(cita.TipoEstado);

            ViewData["ListaEstados"] = list;

            //medicos
            MedicoApiProcess map = new MedicoApiProcess();

            var medicos     = map.ToList();
            var listMedicos = new SelectList(medicos, "Id", "Nombre");

            ViewData["Medicos"] = listMedicos;

            //pacientes
            PacienteApiProcess pp = new PacienteApiProcess();

            var pacientes     = pp.ToList();
            var listPacientes = new SelectList(pacientes, "Id", "Nombre");

            ViewData["Pacientes"] = listPacientes;


            //salas
            SalaApiProcess sp = new SalaApiProcess();

            var salas     = sp.ToList();
            var listSalas = new SelectList(salas, "Id", "Nombre");

            ViewData["Salas"] = listSalas;

            //tipo servicios
            TipoServicioApiProcess tsp = new TipoServicioApiProcess();

            var tipoS  = tsp.ToList();
            var listTS = new SelectList(tipoS, "Id", "Nombre");

            ViewData["TS"] = listTS;


            return(View());
        }
Ejemplo n.º 6
0
        public ActionResult AgregarMascota(Paciente collection)
        {
            try
            {
                //HttpPostedFileBase FileBase = Request.Files[0];
                //WebImage image = new WebImage(FileBase.InputStream);

                //collection.ImagePet = image.GetBytes();

                var pp = new PacienteApiProcess();

                pp.Add(collection);
                return(RedirectToAction("Index"));
            }

            catch (DataException ex)
            {
                return(View());
            }
        }
Ejemplo n.º 7
0
        public JsonResult GetEvents(DateTime start, DateTime end)
        {
            //var viewModel = new CitaViewModel();
            var events = new List <object>();

            var citas = new CitaApiProcess().ToList();

            foreach (var c in citas)
            {
                var paciente = new PacienteApiProcess().ReadBy(c.PacienteId);
                var cliente  = new ClienteApiProcess().ReadBy(paciente.ClienteId);

                events.Add(new CitaViewModel()
                {
                    id    = c.Id,
                    title = cliente.Apellido.ToString(),
                    start = c.Fecha.AddDays(1).AddHours(-5).ToString("yyyy-MM-dd hh:mm "),
                    //end = c.Fecha.AddHours(-5).AddMinutes(30).ToString("yyyy-MM-dd hh:mm"),
                    allDay = false
                });
            }

            return(Json(events.ToArray(), JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 8
0
        public ActionResult Index()
        {
            var p = new PacienteApiProcess();

            return(View(p.ToList()));
        }