public ActionResult Create() { List <Empleado> listaEmpleados = EmpleadoBLL.SelectAll(); ViewBag.EmpleadoPk = new SelectList(listaEmpleados, "pkEmpleado", "fullName"); return(View()); }
public ActionResult Edit(int id) { Departamento departamento = DepartamentoBLL.GetEmpleadoById(id); List <Empleado> listaEmpleados = EmpleadoBLL.SelectAll(); ViewBag.EmpleadoPk = new SelectList(listaEmpleados, "pkEmpleado", "fullName"); return(View(departamento)); }
public ActionResult AutoCompleteEmpleados(string term) { IEnumerable <Empleado> listaEmpleado = EmpleadoBLL.SelectAll(); var empleados = from s in listaEmpleado select s; if (!String.IsNullOrEmpty(term)) { empleados = empleados.Where(s => s.txtNombre.ToUpper().Contains(term.ToUpper()) || s.txtApellidos.ToUpper().Contains(term.ToUpper())); } return(Json(empleados.ToList <Empleado>())); }
public ActionResult Index(string sortOrder, string currentFilter, string searchString, int?page) { IEnumerable <Empleado> listaEmpleado = EmpleadoBLL.SelectAll(); 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; var empleados = from s in listaEmpleado select s; if (!String.IsNullOrEmpty(searchString)) { empleados = empleados.Where(s => s.txtNombre.ToUpper().Contains(searchString.ToUpper()) || s.txtApellidos.ToUpper().Contains(searchString.ToUpper())); } switch (sortOrder) { case "name_desc": empleados = empleados.OrderByDescending(s => s.txtNombre); break; case "Date": empleados = empleados.OrderBy(s => s.dateFechaContrato); break; case "date_desc": empleados = empleados.OrderByDescending(s => s.dateFechaContrato); break; default: // Name ascending empleados = empleados.OrderBy(s => s.txtNombre); break; } return(View(empleados.ToList <Empleado>())); }
public void cargarDatosEmpleados() { tblEmpleados.DataSource = EmpleadoBLL.SelectAll(); }