// GET: Informe/EmpleadoI
        public ActionResult Index(string Estatus, string buscarPor, string buscar, string Page)
        {
            if (buscarPor == "Departamento")
            {
                return(View(empldn.GetAll().Where(x => x.Departamento.CodigoDep.StartsWith(buscar) || buscar == null)));
            }
            else if (buscarPor == "Nombre")
            {
                return(View(empldn.GetAll().Where(x => x.Nombre.StartsWith(buscar) || buscar == null)));
            }


            ViewBag.Estatus = (Estatus == null ? "A" : Estatus);
            if (Estatus == "A")
            {
                return(View(empldn.GetActives()));
            }
            else if (Estatus == "I")
            {
                return(View(empldn.GetInactives()));
            }

            var abc = empldn.GetActives();

            ViewBag.TotalPages = Math.Ceiling(abc.Count() / 10.0);
            int page = int.Parse(Page == null ? "1" : Page);

            ViewBag.Page = page;

            abc = abc.Skip((page - 1) * 10).Take(10);
            return(View(abc));
        }
Beispiel #2
0
        public ActionResult Create()
        {
            ViewBag.EmpleadoId = empleldn.GetAll().Where(y => y.Estatus == "A").Select(x => new SelectListItem()
            {
                Text  = x.Nombre + " " + x.Apellido + " (" + x.CodigoEmp + ") ",
                Value = x.Id.ToString()
            });

            return(View());
        }
        public ActionResult Create()
        {
            ViewBag.Encargado = empleldn.GetAll().Select(x => new SelectListItem()
            {
                Text  = x.Nombre + " " + x.Apellido + " (" + x.CodigoEmp + ") ",
                Value = x.Id.ToString()
            });

            return(View());
        }
Beispiel #4
0
        // GET: Informe/EntradaMEmp
        public ActionResult Index(string buscarPor, string buscar)
        {
            if (buscarPor == "Mes")
            {
                return(View(empldn.GetAll().Where(y => y.FechaIngreso.Month.ToString().StartsWith(buscar) || buscar == null)));
            }
            else if (buscarPor == "Anio")
            {
                return(View(empldn.GetAll().Where(y => y.FechaIngreso.Year.ToString().StartsWith(buscar) || buscar == null)));
            }
            var x = empldn.GetAll();

            return(View(x));
        }
        public ActionResult Delete(int id)
        {
            try
            {
                int count = empldn.GetAll().Where(x => x.CargoId == id).Count();

                if (count != 0)
                {
                    TempData["Msg"] = "Error al eliminar cargo, intentelo de nuevo ";
                }

                cargoldn.Delete(id);
                return(RedirectToAction("Index", "Cargo"));
            }
            catch
            {
                TempData["Msg"] = "Error al eliminar cargo, intentelo de nuevo ";
                return(RedirectToAction("Index", "Cargo", new { area = "Admin" }));
            }
        }
Beispiel #6
0
 public ActionResult Index()
 {
     return(View(empleadEmpleadoLDN.GetAll()));
 }