public IHttpActionResult PutemployeeFees(int id, employeeFeesModel employeeFees) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != employeeFees.Id) { return(BadRequest()); } db.Entry(employeeFees).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!employeeFeesExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PostemployeeFees(employeeFeesModel employeeFees) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.employeeFees.Add(employeeFees); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = employeeFees.Id }, employeeFees)); }
public IHttpActionResult DeleteemployeeFees(int id) { employeeFeesModel employeeFees = db.employeeFees.Find(id); if (employeeFees == null) { return(NotFound()); } db.employeeFees.Remove(employeeFees); db.SaveChanges(); return(Ok(employeeFees)); }