public IHttpActionResult PutBStage(int id, BStage bStage) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bStage.id) { return(BadRequest()); } db.Entry(bStage).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BStageExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutTBALocation(string id, TBALocation tBALocation) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != tBALocation.CODE) { return(BadRequest()); } db.Entry(tBALocation).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!TBALocationExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult PutContractConsultant(string id, ContractConsultant contractConsultant) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != contractConsultant.INITIALS) { return(BadRequest()); } db.Entry(contractConsultant).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ContractConsultantExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult Create([Bind(Include = "id,FullReference,Status,FromDate,ToDate,Consultant,Sales_Update")] BStage bStage) { if (ModelState.IsValid) { db.BStages.Add(bStage); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bStage)); }