Beispiel #1
0
 public ActionResult Edit(decimal id, EmployeeSalary employeeSalary)
 {
     try
     {
         if (ModelState.IsValid)
         {
             EmployeeSalary obj = EmployeeSalary.Find(id);
             if (obj != null)
             {
                 obj = employeeSalary;
                 EmployeeSalary.Update(obj);
                 ViewBag.Message = "Employee Salary Updated Successfully";
             }
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch (Exception ex)
     {
         return(View());
     }
 }
Beispiel #2
0
        public ActionResult Edit(decimal id)
        {
            ViewData["Employee"] = Employee.ListEmployee(1);
            EmployeeSalary obj = EmployeeSalary.Find(id);

            if (obj != null)
            {
                return(View(obj));
            }
            else
            {
                return(RedirectToAction("Index"));
            }
        }