Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var p = new SalaApiProcess();

            Sala sala = p.ReadBy(id);

            p.Delete(sala);
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit(Sala sala)
 {
     if (ModelState.IsValid)
     {
         var p = new SalaApiProcess();
         p.Update(sala);
         return(RedirectToAction("Index"));
     }
     return(View(sala));
 }
Esempio n. 3
0
        public ActionResult Create(Sala sala)
        {
            try
            {
                var p = new SalaApiProcess();
                p.Add(sala);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Esempio n. 4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var  p    = new SalaApiProcess();
            Sala sala = p.ReadBy(id.Value);

            if (sala == null)
            {
                return(HttpNotFound());
            }
            return(View(sala));
        }
Esempio 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());
        }
Esempio n. 6
0
        public ActionResult Index()
        {
            var p = new SalaApiProcess();

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