Example #1
0
        public ActionResult Edit(EmpTable emp)
        {
            var obj = new DBComponent();

            obj.UpdateEmployee(emp);
            return(RedirectToAction("AllEmployees"));//Moves the code to the Action AllEmployees...
        }
        [HttpPost]//As there are 2 methods, we should differ them by the HTTP Method....
        public ActionResult Edit(Employee emp)
        {
            var com = new DBComponent();

            com.UpdateEmployee(emp);
            return(RedirectToAction("AllEmployees"));//Redirecting to the Table View...
        }