public IHttpActionResult PutProject_House(long id, Project_House project_House) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != project_House.ID) { return(BadRequest()); } db.Entry(project_House).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Project_HouseExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(long id) { Project_House project_House = db.Project_House.Find(id); db.Project_House.Remove(project_House); db.SaveChanges(); return(RedirectToAction("Index")); }
public IHttpActionResult GetProject_House(long id) { Project_House project_House = db.Project_House.Find(id); if (project_House == null) { return(NotFound()); } return(Ok(project_House)); }
public ActionResult Edit([Bind(Include = "ID,BuildID,UnitName,UnitShort,FloorName,FloorShort,HouseName,HouseShort,HouseStatus,HouseIntro,HouseModel,HouseType,HouseClass,HouseCategory,HouseArea,HousePrice,HouseTotal,Remark,OrderID,Status")] Project_House project_House) { if (ModelState.IsValid) { db.Entry(project_House).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.BuildID = new SelectList(db.Project_Build, "ID", "BuildName", project_House.BuildID); return(View(project_House)); }
public IHttpActionResult PostProject_House(Project_House project_House) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Project_House.Add(project_House); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = project_House.ID }, project_House)); }
public IHttpActionResult DeleteProject_House(long id) { Project_House project_House = db.Project_House.Find(id); if (project_House == null) { return(NotFound()); } db.Project_House.Remove(project_House); db.SaveChanges(); return(Ok(project_House)); }
// GET: House/Details/5 public ActionResult Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Project_House project_House = db.Project_House.Find(id); if (project_House == null) { return(HttpNotFound()); } return(View(project_House)); }
// GET: House/Edit/5 public ActionResult Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Project_House project_House = db.Project_House.Find(id); if (project_House == null) { return(HttpNotFound()); } ViewBag.BuildID = new SelectList(db.Project_Build, "ID", "BuildName", project_House.BuildID); return(View(project_House)); }