// GET: TipoServicio/Delete/5 public ActionResult Delete(int id) { var biz = new TipoServicioProcess(); var tiposervicio = biz.GetByID(id); return(View(tiposervicio)); }
// GET: Precio public ActionResult Index() { var biz = new PrecioProcess(); var lista = biz.ListarTodos(); var tiposervicioprocess = new TipoServicioProcess(); foreach (var item in lista) { item.TipoServicio = tiposervicioprocess.GetByID(item.TipoServicioId); } return(View(lista)); }
public ActionResult Index() { var biz = new CitaProcess(); var lista = biz.ListarTodosAuditor(); foreach (var item in lista) { item.Medico = medicoprocess.GetByID(item.MedicoId); item.Paciente = pacienteprocess.GetByID(item.PacienteId); item.Sala = SalaProcess.GetByID(item.SalaId); item.TipoServicio = TipoServicioProcess.GetByID(item.TipoServicioId); } return(View(lista)); }
public ActionResult Index(string sortOrder, string currentFilter, string searchString, int?page) { idusuario = User.Identity.Name; var biz = new CitaProcess(); var lista = biz.ListarTodosAuditor(); var listafiltrada = new List <Cita>(); foreach (var item in lista) { if (item.Deleted == false) { item.Medico = medicoprocess.GetByID(item.MedicoId); item.Paciente = pacienteprocess.GetByID(item.PacienteId); item.Sala = SalaProcess.GetByID(item.SalaId); item.TipoServicio = TipoServicioProcess.GetByID(item.TipoServicioId); listafiltrada.Add(item); } } ViewBag.CurrentSort = sortOrder; ViewBag.NameSortParm = string.IsNullOrEmpty(sortOrder) ? "name_desc" : ""; ViewBag.DateSortParm = sortOrder == "Date" ? "date_desc" : "Date"; if (searchString != null) { page = 1; } else { searchString = currentFilter; } ViewBag.CurrentFilter = searchString; IEnumerable <Cita> citaelegida = listafiltrada; if (!string.IsNullOrEmpty(searchString)) { citaelegida = citaelegida.Where(s => s.Paciente.Nombre.Contains(searchString)); } switch (sortOrder) { case "name_desc": citaelegida = citaelegida.OrderByDescending(s => s.Paciente.Nombre); break; case "Date": citaelegida = citaelegida.OrderBy(s => s.Fecha); break; default: citaelegida = citaelegida.OrderBy(s => s.Paciente.Nombre); break; } //return View(clientes.ToList()); int pageSize = 10; int pageNumber = (page ?? 1); return(View(citaelegida.ToPagedList(pageNumber, pageSize))); //return View(listafiltrada); }