Esempio n. 1
0
        public void Guardar(Employee employee)
        {
            EmployeeContext employeeContext = new EmployeeContext();

            employeeContext.Employees.Add(employee);
            employeeContext.SaveChanges();
        }
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 void SaveEmployee(Employee employee)
        {
            EmployeeContext employeeContext = new EmployeeContext();

            Employee empleado = employeeContext.Employees.First(emp => emp.EmployeeId == employee.EmployeeId);
            empleado.city = employee.city;
            empleado.Department = employee.Department;
            empleado.gender = employee.gender;
            empleado.name= employee.name;

            employeeContext.SaveChanges();
        }