Esempio n. 1
0
        public ActionResult Edit(int Id)
        {
            EmployeeBusinessLayer employeeBusinessLayer = new EmployeeBusinessLayer();
            Employee employee = employeeBusinessLayer.Employees().Single(emp => emp.EmployeeId == Id);

            return View(employee);
        }
Esempio n. 2
0
        public ActionResult Edit(Employee employee)
        {
            if(ModelState.IsValid)
            {
                EmployeeBusinessLayer employeeBusinessLayer = new EmployeeBusinessLayer();
                employeeBusinessLayer.SaveEmployee(employee);
                return RedirectToAction("Prueba");

            }
            return View();
        }
Esempio n. 3
0
        public ActionResult Create(Employee employee)
        {
            if (ModelState.IsValid)
            {
                EmployeeBusinessLayer employeeBusinessLayer = new EmployeeBusinessLayer();
                employeeBusinessLayer.Guardar(employee);
                return RedirectToAction("Prueba");
            }

            return View();
        }
Esempio n. 4
0
        public ActionResult Prueba()
        {
            EmployeeBusinessLayer employeeBusinessLayer = new EmployeeBusinessLayer();

            List<Employee> employees = employeeBusinessLayer.Employees().ToList();

            return View(employees);
        }
Esempio n. 5
0
 public ActionResult Delete(int id)
 {
     EmployeeBusinessLayer employeeBL = new EmployeeBusinessLayer();
     employeeBL.Delete(id);
     return RedirectToAction("Prueba");
 }