public IHttpActionResult PutHRM_DEF_SHIFT_HRS(int id, HRM_DEF_SHIFT_HRS hRM_DEF_SHIFT_HRS) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != hRM_DEF_SHIFT_HRS.CODE) { return(BadRequest()); } db.Entry(hRM_DEF_SHIFT_HRS).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!HRM_DEF_SHIFT_HRSExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetHRM_DEF_SHIFT_HRS(int id) { HRM_DEF_SHIFT_HRS hRM_DEF_SHIFT_HRS = db.HRM_DEF_SHIFT_HRS.Find(id); if (hRM_DEF_SHIFT_HRS == null) { return(NotFound()); } return(Ok(hRM_DEF_SHIFT_HRS)); }
public ActionResult AddOrEdit(HRM_DEF_SHIFT_HRS car) { if (car.CODE == 0) { HttpResponseMessage response = GlobalVariables.WebApiClient.PostAsJsonAsync("HRM_DEF_SHIFT_HRS", car).Result; } else { HttpResponseMessage response = GlobalVariables.WebApiClient.PutAsJsonAsync("HRM_DEF_SHIFT_HRS/" + car.CODE, car).Result; } return(RedirectToAction("Index")); }
public IHttpActionResult PostHRM_DEF_SHIFT_HRS(HRM_DEF_SHIFT_HRS hRM_DEF_SHIFT_HRS) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.HRM_DEF_SHIFT_HRS.Add(hRM_DEF_SHIFT_HRS); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = hRM_DEF_SHIFT_HRS.CODE }, hRM_DEF_SHIFT_HRS)); }
public IHttpActionResult DeleteHRM_DEF_SHIFT_HRS(int id) { HRM_DEF_SHIFT_HRS hRM_DEF_SHIFT_HRS = db.HRM_DEF_SHIFT_HRS.Find(id); if (hRM_DEF_SHIFT_HRS == null) { return(NotFound()); } db.HRM_DEF_SHIFT_HRS.Remove(hRM_DEF_SHIFT_HRS); db.SaveChanges(); return(Ok(hRM_DEF_SHIFT_HRS)); }