Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            HiveInspection hiveInspection = db.HiveInspections.Find(id);

            db.HiveInspections.Remove(hiveInspection);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,HiveID,InspectionDate,WorkerID,HiveTemperatment,HiveCondition,QueenSighted,LayingPattern,amtHoneyRemoved,amtHoneycomb,amtPollen")] HiveInspection hiveInspection)
 {
     if (ModelState.IsValid)
     {
         db.Entry(hiveInspection).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.HiveID   = new SelectList(db.Hives, "Id", "HiveName", hiveInspection.HiveID);
     ViewBag.WorkerID = new SelectList(db.Workers, "Id", "WorkerName", hiveInspection.WorkerID);
     return(View(hiveInspection));
 }
Example #3
0
        // GET: HiveInspections/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HiveInspection hiveInspection = db.HiveInspections.Find(id);

            if (hiveInspection == null)
            {
                return(HttpNotFound());
            }
            return(View(hiveInspection));
        }
Example #4
0
        // GET: HiveInspections/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            HiveInspection hiveInspection = db.HiveInspections.Find(id);

            if (hiveInspection == null)
            {
                return(HttpNotFound());
            }
            ViewBag.HiveID   = new SelectList(db.Hives, "Id", "HiveName", hiveInspection.HiveID);
            ViewBag.WorkerID = new SelectList(db.Workers, "Id", "WorkerName", hiveInspection.WorkerID);
            return(View(hiveInspection));
        }