public ActionResult DeleteConfirmed(int id) { var p = new TipoServicioApiProcess(); TipoServicio tipoServicio = p.ReadBy(id); p.Delete(tipoServicio); return(RedirectToAction("Index")); }
public ActionResult Edit(TipoServicio tipoServicio) { if (ModelState.IsValid) { var p = new TipoServicioApiProcess(); p.Update(tipoServicio); return(RedirectToAction("Index")); } return(View(tipoServicio)); }
public ActionResult Create(TipoServicio tipoServicio) { try { var p = new TipoServicioApiProcess(); p.Add(tipoServicio); return(RedirectToAction("Index")); } catch { return(View()); } }
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)); }
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()); }
public ActionResult Index() { var p = new TipoServicioApiProcess(); return(View(p.ToList())); }