Ejemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            EmployeedataAccessLayer employeeDataAccessLayers = new EmployeedataAccessLayer();

            employeeDataAccessLayers.DeleteEmployee(id);
            return(Ok());
        }
Ejemplo n.º 2
0
        public IEnumerable <Employee> Get()
        {
            // return new string[] { "value1", "value2" };
            EmployeedataAccessLayer employeeDataAccessLayers = new EmployeedataAccessLayer();

            return(employeeDataAccessLayers.GetAllEmployees());
        }
Ejemplo n.º 3
0
        public Employee Get(int id)
        {
            //return "value";
            EmployeedataAccessLayer employeeDataAccessLayers = new EmployeedataAccessLayer();
            var employee = employeeDataAccessLayers.GetEmployeeData(id);

            return(employee);
        }
Ejemplo n.º 4
0
        public ActionResult Put(int id, [FromBody] Employee employee)
        {
            if (id != employee.ID)
            {
                return(BadRequest());
            }
            EmployeedataAccessLayer employeeDataAccessLayers = new EmployeedataAccessLayer();

            employeeDataAccessLayers.UpdateEmployee(employee);
            return(Ok());
        }
Ejemplo n.º 5
0
        public void Post([FromBody] Employee employee)
        {
            EmployeedataAccessLayer employeeDataAccessLayers = new EmployeedataAccessLayer();

            employeeDataAccessLayers.AddEmployee(employee);
        }