Esempio n. 1
0
        // GET: Employee
        public ActionResult GetAllEmpDetails()
        {
            Emprepository Emprepo = new Emprepository();

            ModelState.Clear();

            return(View(Emprepo.GetAllEmployee()));
        }
Esempio n. 2
0
 public ActionResult EditEmployeeDetails(EmpModel emp)
 {
     try
     {
         Emprepository Emprepo = new Emprepository();
         Emprepo.UpdateEmployee(emp);
         return(RedirectToAction("GetAllEmpDetails"));
     }
     catch (Exception)
     {
         return(View());
     }
 }
Esempio n. 3
0
 public ActionResult DeleteEmployee(int id)
 {
     try
     {
         Emprepository Emprepo = new Emprepository();
         if (Emprepo.DeleteEmployee(id))
         {
             ViewBag.message = "Empleado correctamente";
         }
         return(RedirectToAction("GetAllEmpDetails"));
     }
     catch (Exception)
     {
         return(View());
     }
 }
Esempio n. 4
0
 public ActionResult AddEmployee(EmpModel emp)
 {
     try
     {
         Emprepository Emprepo = new Emprepository();
         if (Emprepo.AddEmployee(emp))
         {
             ViewBag.message = "Almacenado correctamente";
         }
         return(RedirectToAction("GetAllEmpDetails"));
     }
     catch (Exception)
     {
         return(View());
     }
 }
Esempio n. 5
0
        public ActionResult EditEmployeeDetails(int id)
        {
            Emprepository Emprepo = new Emprepository();

            return(View(Emprepo.GetAllEmployee().Find(Emp => Emp.Empid == id)));
        }