Пример #1
0
        public ActionResult UpdateEmployee(int id)
        {
            ManiEmployeesViewModel model = new ManiEmployeesViewModel()
            {
                Employee   = _employeeManager.GetEmployee(id),
                Titles     = _titleManager.GetTitles(),
                ButtonName = "Update Employee",
            };

            return(View(model));
        }
Пример #2
0
        public ActionResult AddNewEmployee()
        {
            ManiEmployeesViewModel model = new ManiEmployeesViewModel()
            {
                Employee   = new Employee(),
                Titles     = _titleManager.GetTitles(),
                ButtonName = "Add Employee",
            };

            return(View(model));
        }
Пример #3
0
 public ActionResult UpdateEmployee(Employee employee)
 {
     if (!ModelState.IsValid)
     {
         ManiEmployeesViewModel model = new ManiEmployeesViewModel()
         {
             Employee   = _employeeManager.GetEmployee(employee.EmployeeID),
             Titles     = _titleManager.GetTitles(),
             ButtonName = "Update Employee",
         };
         return(View(model));
     }
     _employeeManager.UpdateEmployee(employee);
     TempData["message"] = "Çalışan Güncellendi";
     return(RedirectToAction("EmployeeManiPage"));
 }
Пример #4
0
 public ActionResult AddNewEmployee(Employee employee)
 {
     if (!ModelState.IsValid)
     {
         ManiEmployeesViewModel model = new ManiEmployeesViewModel()
         {
             Employee   = new Employee(),
             Titles     = _titleManager.GetTitles(),
             ButtonName = "Add Employee",
         };
         return(View(model));
     }
     _employeeManager.AddEmployee(employee);
     TempData["message"] = "Yeni çalışan eklendi";
     return(RedirectToAction("EmployeeManiPage"));
 }