예제 #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            BeaconModels beacon = await db.beacon.FindAsync(id);

            db.beacon.Remove(beacon);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
예제 #2
0
        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));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }