コード例 #1
0
 public ActionResult Edit(Employee employee)
 {
     ///Update employee
     employee.Type = EmployeeTypeDB.GetInstance().FindEmployeeType(employee.Type.Id);
     EmployeeDB.GetInstance().UpdateEmployee(employee);
     return(Redirect("Index"));
 }
コード例 #2
0
 public ActionResult Create(Employee employee)
 {
     employee.Type   = EmployeeTypeDB.GetInstance().FindEmployeeType(employee.Type.Id);
     employee.Status = EmployeeStatusDB.GetInstance().FindEmployeeStatus(employee.Status.Id);
     EmployeeDB.GetInstance().AddEmployee(employee);
     return(Redirect("Index"));
 }
コード例 #3
0
        public ActionResult Edit(int employeeId)
        {
            EmployeeViewModel viewModel = new EmployeeViewModel()
            {
                Employee      = EmployeeDB.GetInstance().FindEmployee(employeeId),
                EmployeeTypes = EmployeeTypeDB.GetInstance().GetEmployeeTypes()
            };

            return(View(viewModel));
        }
コード例 #4
0
        public ActionResult Create()
        {
            EmployeeViewModel viewModel = new EmployeeViewModel()
            {
                EmployeeTypes    = EmployeeTypeDB.GetInstance().GetEmployeeTypes(),
                EmployeeStatuses = EmployeeStatusDB.GetInstance().GetEmployeeStatuses()
            };

            return(View(viewModel));
        }
コード例 #5
0
 // GET: EmployeeType
 public ActionResult Index()
 {
     return(View(EmployeeTypeDB.GetInstance().GetEmployeeTypes()));
 }
コード例 #6
0
 ///HTTPPost DeleteAccepted will be hit if the user presses yes on the delete page above.
 public ActionResult DeleteAccepted(int employeeTypeId)
 {
     //Delete employee
     EmployeeTypeDB.GetInstance().DeleteEmployeeType(employeeTypeId);
     return(Redirect("Index"));
 }
コード例 #7
0
 public ActionResult Edit(EmployeeType employeeType)
 {
     ///Update employee
     EmployeeTypeDB.GetInstance().UpdateEmployeeType(employeeType);
     return(Redirect("Index"));
 }
コード例 #8
0
        public ActionResult Edit(int employeeTypeId)
        {
            EmployeeType emplT = EmployeeTypeDB.GetInstance().FindEmployeeType(employeeTypeId);

            return(View(emplT));
        }
コード例 #9
0
 public ActionResult Create(EmployeeType employeeType)
 {
     EmployeeTypeDB.GetInstance().AddEmployeeType(employeeType);
     return(Redirect("Index"));
 }