public IHttpActionResult PutSystem_Project(long id, System_Project system_Project) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != system_Project.ID) { return(BadRequest()); } db.Entry(system_Project).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!System_ProjectExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(long id) { System_Project system_Project = db.System_Project.Find(id); db.System_Project.Remove(system_Project); db.SaveChanges(); return(RedirectToAction("Index")); }
public IHttpActionResult GetSystem_Project(long id) { System_Project system_Project = db.System_Project.Find(id); if (system_Project == null) { return(NotFound()); } return(Ok(system_Project)); }
public ActionResult Edit([Bind(Include = "ID,CompanyID,ProjectName,ProjectShort,ProjectAddress,ProjectAgreement,ProjectNotes,ProjectStatus,StartDate,EndDate,OrderID,Status")] System_Project system_Project) { if (ModelState.IsValid) { db.Entry(system_Project).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.CompanyID = new SelectList(db.System_Company, "ID", "CompanyName", system_Project.CompanyID); return(View(system_Project)); }
public IHttpActionResult PostSystem_Project(System_Project system_Project) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.System_Project.Add(system_Project); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = system_Project.ID }, system_Project)); }
public IHttpActionResult DeleteSystem_Project(long id) { System_Project system_Project = db.System_Project.Find(id); if (system_Project == null) { return(NotFound()); } db.System_Project.Remove(system_Project); db.SaveChanges(); return(Ok(system_Project)); }
// GET: Project/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } System_Project system_Project = db.System_Project.Find(id); if (system_Project == null) { return(HttpNotFound()); } return(View(system_Project)); }
// GET: Project/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } System_Project system_Project = db.System_Project.Find(id); if (system_Project == null) { return(HttpNotFound()); } ViewBag.CompanyID = new SelectList(db.System_Company, "ID", "CompanyName", system_Project.CompanyID); return(View(system_Project)); }