public async Task <ActionResult> DeleteConfirmed(int id) { BeaconModels beacon = await db.beacon.FindAsync(id); db.beacon.Remove(beacon); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "IdBeacon,beaconAddress,beaconMajor,beaconMinor,Place_idPlace")] BeaconModels beacon) { if (ModelState.IsValid) { db.Entry(beacon).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(beacon)); }
public async Task <ActionResult> Create([Bind(Include = "IdBeacon,beaconAddress,beaconMajor,beaconMinor,Place_idPlace")] BeaconModels beacon /*, HttpPostedFileBase photo*/) { if (ModelState.IsValid) { db.beacon.Add(beacon); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(beacon)); }
public async Task <ActionResult> Delete(int?idBeacon) { if (idBeacon == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BeaconModels beacon = await db.beacon.FindAsync(idBeacon); if (beacon == null) { return(HttpNotFound()); } return(View(beacon)); }