public ActionResult DeleteConfirmed(int id)
        {
            Fascility fascility = db.Fascilities.Find(id);

            fascility.isDeleted = 1;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Fascility_Id,Fascility_Name,Fascility_Description,WasteCollectionPricePerMonth,districtsId")] Fascility fascility)
 {
     if (ModelState.IsValid)
     {
         fascility.isDeleted       = 0;
         db.Entry(fascility).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(RedirectToAction("Index"));
 }
        public ActionResult Create([Bind(Include = "Fascility_Id,Fascility_Name,Fascility_Description,WasteCollectionPricePerMonth,districtsId")] Fascility fascility)
        {
            if (ModelState.IsValid)
            {
                fascility.isDeleted = 0;
                db.Fascilities.Add(fascility);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(RedirectToAction("Index"));
        }
        // GET: Fascilities/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Fascility fascility = db.Fascilities.Find(id);

            if (fascility == null)
            {
                return(HttpNotFound());
            }
            string value = JsonConvert.SerializeObject(fascility, Formatting.Indented, new JsonSerializerSettings
            {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            });

            return(Json(value, JsonRequestBehavior.AllowGet));
        }