public async Task <ActionResult> DeleteConfirmed(int id) { Rometype rometype = await db.Rometype.FindAsync(id); db.Rometype.Remove(rometype); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "IDX,roomtype,price,pnumber")] Rometype rometype) { if (ModelState.IsValid) { db.Entry(rometype).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(rometype)); }
public async Task <ActionResult> Create([Bind(Include = "IDX,roomtype,price,pnumber")] Rometype rometype) { if (ModelState.IsValid) { db.Rometype.Add(rometype); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(rometype)); }
// GET: Rometypes/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Rometype rometype = await db.Rometype.FindAsync(id); if (rometype == null) { return(HttpNotFound()); } return(View(rometype)); }