예제 #1
0
        public ActionResult ShowAllRecords()
        {
            EmployeeOP employeeOP = new EmployeeOP();
            var        list       = employeeOP.GetAllData();

            return(View(list));
        }
예제 #2
0
        public ActionResult Edit(int id)
        {
            EmployeeOP employeeOP = new EmployeeOP();
            var        result     = employeeOP.GetEmployeeDetails(id);

            return(View(result));
        }
예제 #3
0
        public ActionResult Delete(int id)
        {
            EmployeeOP employeeOP = new EmployeeOP();

            employeeOP.DeleteRecord(id);

            return(RedirectToAction("ShowAllRecords"));
        }
예제 #4
0
        public ActionResult Edit(Employee employee)
        {
            EmployeeOP employeeOP = new EmployeeOP();

            employeeOP.UpdateRecord(employee);

            return(RedirectToAction("ShowAllRecords"));
        }
예제 #5
0
 public ActionResult Index(Employee emp)
 {
     if (ModelState.IsValid)
     {
         EmployeeOP employeeOP = new EmployeeOP();
         int        id         = employeeOP.AddEmployee(emp);
         if (id > 0)
         {
             ViewBag.Success = "Data Added Successfully :)";
             ViewBag.Value   = 1;
         }
         else
         {
             ViewBag.Success = "Data Addition Failed :)";
         }
     }
     return(View("Index"));
 }