示例#1
0
 public ActionResult Edit(EmployeeModel emp)
 {
     try
     {
         EmpCRUDOperations.UpdateEmp(emp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
 public ActionResult Create(EmployeeModel Emp)
 {
     try
     {
         EmpCRUDOperations.AddEmp(Emp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
示例#3
0
 public ActionResult Delete(int id, EmployeeModel emp)
 {
     try
     {
         EmpCRUDOperations.DeleteEmp(id);
         return(RedirectToAction("Index"));
         // return View(emp);
         // return View();
     }
     catch
     {
         return(View());
     }
 }
示例#4
0
        public ActionResult getEmployees()
        {
            var emps = EmpCRUDOperations.getEmployees();

            return(View(emps));
        }
示例#5
0
        //
        // GET: /Emp1/Delete/5

        public ActionResult Delete(int id)
        {
            var emp = EmpCRUDOperations.getEmpbyId(id);

            return(View(emp));
        }