public IHttpActionResult Puttb_EmpAdvance(int id, tb_EmpAdvance tb_EmpAdvance) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tb_EmpAdvance.ID) { return(BadRequest()); } db.Entry(tb_EmpAdvance).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!tb_EmpAdvanceExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult Gettb_EmpAdvance(int id) { tb_EmpAdvance tb_EmpAdvance = db.tb_EmpAdvance.Find(id); if (tb_EmpAdvance == null) { return(NotFound()); } return(Ok(tb_EmpAdvance)); }
public IHttpActionResult Posttb_EmpAdvance(tb_EmpAdvance tb_EmpAdvance) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.tb_EmpAdvance.Add(tb_EmpAdvance); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = tb_EmpAdvance.ID }, tb_EmpAdvance)); }
public IHttpActionResult Deletetb_EmpAdvance(int id) { tb_EmpAdvance tb_EmpAdvance = db.tb_EmpAdvance.Find(id); if (tb_EmpAdvance == null) { return(NotFound()); } db.tb_EmpAdvance.Remove(tb_EmpAdvance); db.SaveChanges(); return(Ok(tb_EmpAdvance)); }