public async Task <ActionResult> DeleteConfirmed(int id) { StructureOwner structureOwner = await db.StructureOwners.FindAsync(id); db.StructureOwners.Remove(structureOwner); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "StructureOwnerID,Name,Email,MobileNumber")] StructureOwner structureOwner) { if (ModelState.IsValid) { db.Entry(structureOwner).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(structureOwner)); }
public async Task <ActionResult> Create([Bind(Include = "StructureOwnerID,Name,Email,MobileNumber")] StructureOwner structureOwner) { if (ModelState.IsValid) { db.StructureOwners.Add(structureOwner); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(structureOwner)); }
// GET: StructureOwners/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StructureOwner structureOwner = await db.StructureOwners.FindAsync(id); if (structureOwner == null) { return(HttpNotFound()); } return(View(structureOwner)); }