Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var p = new TipoServicioApiProcess();

            TipoServicio tipoServicio = p.ReadBy(id);

            p.Delete(tipoServicio);
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit(TipoServicio tipoServicio)
 {
     if (ModelState.IsValid)
     {
         var p = new TipoServicioApiProcess();
         p.Update(tipoServicio);
         return(RedirectToAction("Index"));
     }
     return(View(tipoServicio));
 }
Example #3
0
        public ActionResult Create(TipoServicio tipoServicio)
        {
            try
            {
                var p = new TipoServicioApiProcess();
                p.Add(tipoServicio);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var          p            = new TipoServicioApiProcess();
            TipoServicio tipoServicio = p.ReadBy(id.Value);

            if (tipoServicio == null)
            {
                return(HttpNotFound());
            }
            return(View(tipoServicio));
        }
Example #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());
        }
Example #6
0
        public ActionResult Index()
        {
            var p = new TipoServicioApiProcess();

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