public ActionResult DeleteConfirmed(int id)
        {
            RealStateRegistryInterest realStateRegistryInterest = db.RealStateRegistryInterests.Find(id);

            db.RealStateRegistryInterests.Remove(realStateRegistryInterest);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(RealStateRegistryInterest realStateRegistryInterest)
        {
            if (ModelState.IsValid)
            {
                db.Entry(realStateRegistryInterest).State = System.Data.Entity.EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.State = new SelectList(db.States.Where(a => a.state_isDeleted != true), "state_id", "state_name");

            ViewBag.realStateRegistryInterest_address        = new SelectList(db.Districts, "district_id", "district_name", realStateRegistryInterest.realStateRegistryInterest_address);
            ViewBag.realStateRegistryInterest_Departments_id = new SelectList(db.RealStateRegistryInterestDepartments, "realStateRegistryInterestDepartments_id", "realStateRegistryInterestDepartments_name", realStateRegistryInterest.realStateRegistryInterest_Departments_id);
            return(View(realStateRegistryInterest));
        }
        public ActionResult Create([Bind(Include = "realStateRegistryInterest_id,realStateRegistryInterest_name,realStateRegistryInterest_address,realStateRegistryInterest_Departments_id,realStateRegistryInterest_isDeleted")] RealStateRegistryInterest realStateRegistryInterest)
        {
            if (ModelState.IsValid)
            {
                db.RealStateRegistryInterests.Add(realStateRegistryInterest);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.State = new SelectList(db.States.Where(a => a.state_isDeleted != true), "state_id", "state_name");

            ViewBag.realStateRegistryInterest_address        = new SelectList(db.Districts, "district_id", "district_name", realStateRegistryInterest.realStateRegistryInterest_address);
            ViewBag.realStateRegistryInterest_Departments_id = new SelectList(db.RealStateRegistryInterestDepartments, "realStateRegistryInterestDepartments_id", "realStateRegistryInterestDepartments_name", realStateRegistryInterest.realStateRegistryInterest_Departments_id);
            return(View(realStateRegistryInterest));
        }
        // GET: RealStateRegistryInterests/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RealStateRegistryInterest realStateRegistryInterest = db.RealStateRegistryInterests.Find(id);

            if (realStateRegistryInterest == null)
            {
                return(HttpNotFound());
            }
            return(View(realStateRegistryInterest));
        }
        // GET: RealStateRegistryInterests/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RealStateRegistryInterest realStateRegistryInterest = db.RealStateRegistryInterests.Find(id);

            if (realStateRegistryInterest == null)
            {
                return(HttpNotFound());
            }
            ViewBag.State = new SelectList(db.States.Where(a => a.state_isDeleted != true), "state_id", "state_name");

            ViewBag.realStateRegistryInterest_address        = new SelectList(db.Districts, "district_id", "district_name", realStateRegistryInterest.realStateRegistryInterest_address);
            ViewBag.realStateRegistryInterest_Departments_id = new SelectList(db.RealStateRegistryInterestDepartments, "realStateRegistryInterestDepartments_id", "realStateRegistryInterestDepartments_name", realStateRegistryInterest.realStateRegistryInterest_Departments_id);
            return(View(realStateRegistryInterest));
        }