public IHttpActionResult PostEmployee_tab(Employee_tab employee_tab) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Employee_tab.Add(employee_tab); try { db.SaveChanges(); } catch (DbUpdateException) { if (Employee_tabExists(employee_tab.employee_id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = employee_tab.employee_id }, employee_tab)); }
public IHttpActionResult PutEmployee_tab(decimal id, Employee_tab employee_tab) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employee_tab.employee_id) { return(BadRequest()); } db.Entry(employee_tab).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Employee_tabExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetEmployee_tab(decimal id) { Employee_tab employee_tab = db.Employee_tab.Find(id); if (employee_tab == null) { return(NotFound()); } return(Ok(employee_tab)); }
public IHttpActionResult DeleteEmployee_tab(decimal id) { Employee_tab employee_tab = db.Employee_tab.Find(id); if (employee_tab == null) { return(NotFound()); } db.Employee_tab.Remove(employee_tab); db.SaveChanges(); return(Ok(employee_tab)); }