public IHttpActionResult PutClubHouseTable(int id, ClubHouseTable clubHouseTable) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != clubHouseTable.Id) { return(BadRequest()); } db.Entry(clubHouseTable).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ClubHouseTableExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult DeleteConfirmed(int id) { ClubHouseTable clubHouseTable = db.ClubHouseTables.Find(id); db.ClubHouseTables.Remove(clubHouseTable); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,EmailId,Purpose,Description,RequestDate,PaymentStatus")] ClubHouseTable clubHouseTable) { if (ModelState.IsValid) { db.Entry(clubHouseTable).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clubHouseTable)); }
public IHttpActionResult GetClubHouseTable(int id) { ClubHouseTable clubHouseTable = db.ClubHouseTables.Find(id); if (clubHouseTable == null) { return(NotFound()); } return(Ok(clubHouseTable)); }
public ActionResult Create([Bind(Include = "Id,EmailId,Purpose,Description,RequestDate,PaymentStatus")] ClubHouseTable clubHouseTable) { if (ModelState.IsValid) { db.ClubHouseTables.Add(clubHouseTable); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(clubHouseTable)); }
public IHttpActionResult PostClubHouseTable(ClubHouseTable clubHouseTable) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.ClubHouseTables.Add(clubHouseTable); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = clubHouseTable.Id }, clubHouseTable)); }
public IHttpActionResult DeleteClubHouseTable(int id) { ClubHouseTable clubHouseTable = db.ClubHouseTables.Find(id); if (clubHouseTable == null) { return(NotFound()); } db.ClubHouseTables.Remove(clubHouseTable); db.SaveChanges(); return(Ok(clubHouseTable)); }
public IHttpActionResult DeleteFromClubHouseTable(string emailId) { ClubHouseTable clubHouseItem = db.ClubHouseTables.Where(c => c.EmailId == emailId).FirstOrDefaultAsync <ClubHouseTable>().Result; if (clubHouseItem == null) { return(NotFound()); } db.ClubHouseTables.Remove(clubHouseItem); db.SaveChanges(); return(Ok(clubHouseItem)); }
// GET: ClubHouseTablesMVC/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClubHouseTable clubHouseTable = db.ClubHouseTables.Find(id); if (clubHouseTable == null) { return(HttpNotFound()); } return(View(clubHouseTable)); }