Example #1
0
 public ActionResult Edit(Empleado empleado)
 {
     if (ModelState.IsValid)
     {
         empleadEmpleadoLDN.Update(empleado);
         return(RedirectToAction("Index", "Empleado", new { area = "Admin" }));
     }
     return(View());
 }
Example #2
0
        public ActionResult Create(SalidaEmpleado salidaEmpleado)
        {
            ViewBag.EmpleadoId = empleldn.GetAll().Where(y => y.Estatus == "A").Select(x => new SelectListItem()
            {
                Text  = x.Nombre + " " + x.Apellido + " (" + x.CodigoEmp + ") ",
                Value = x.Id.ToString()
            });

            if (ModelState.IsValid)
            {
                var x = empleldn.GetActives().Where(y => y.Id == salidaEmpleado.EmpleadoId);
                var instanciavalor = x.First();
                instanciavalor.Estatus = "I";
                empleldn.Update(instanciavalor);
                saliempleldn.Insert(salidaEmpleado);
                return(RedirectToAction("Index", "SalidaEmpleado", new { area = "Admin" }));
            }

            return(View());
        }