public ActionResult DeleteConfirmed(int id)
        {
            RealStateRegistryInterestBranch realStateRegistryInterestBranch = db.RealStateRegistryInterestBranches.Find(id);

            db.RealStateRegistryInterestBranches.Remove(realStateRegistryInterestBranch);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        // GET: RealStateRegistryInterestBranches/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RealStateRegistryInterestBranch realStateRegistryInterestBranch = db.RealStateRegistryInterestBranches.Find(id);

            if (realStateRegistryInterestBranch == null)
            {
                return(HttpNotFound());
            }
            return(View(realStateRegistryInterestBranch));
        }
        public ActionResult Edit([Bind(Include = "realStateRegistryInterest_branch_id,realStateRegistryInterest_branch_name,realStateRegistryInterest_branch_realstate_id,realStateRegistryInterest_branch_technical_member_id,realStateRegistryInterest_branch_district_id,realStateRegistryInterest_branch_isDeleted")] RealStateRegistryInterestBranch realStateRegistryInterestBranch)
        {
            if (ModelState.IsValid)
            {
                db.Entry(realStateRegistryInterestBranch).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_branch_technical_member_id = new SelectList(db.Citizens, "citizen_id", "citizen_national_id", realStateRegistryInterestBranch.realStateRegistryInterest_branch_technical_member_id);
            ViewBag.realStateRegistryInterest_branch_district_id         = new SelectList(db.Districts, "district_id", "district_name", realStateRegistryInterestBranch.realStateRegistryInterest_branch_district_id);
            ViewBag.realStateRegistryInterest_branch_realstate_id        = new SelectList(db.RealStateRegistryInterests, "realStateRegistryInterest_id", "realStateRegistryInterest_name", realStateRegistryInterestBranch.realStateRegistryInterest_branch_realstate_id);
            return(View(realStateRegistryInterestBranch));
        }
        // GET: RealStateRegistryInterestBranches/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RealStateRegistryInterestBranch realStateRegistryInterestBranch = db.RealStateRegistryInterestBranches.Find(id);

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

            ViewBag.realStateRegistryInterest_branch_technical_member_id = new SelectList(db.Citizens, "citizen_id", "citizen_national_id", realStateRegistryInterestBranch.realStateRegistryInterest_branch_technical_member_id);
            ViewBag.realStateRegistryInterest_branch_district_id         = new SelectList(db.Districts, "district_id", "district_name", realStateRegistryInterestBranch.realStateRegistryInterest_branch_district_id);
            ViewBag.realStateRegistryInterest_branch_realstate_id        = new SelectList(db.RealStateRegistryInterests, "realStateRegistryInterest_id", "realStateRegistryInterest_name", realStateRegistryInterestBranch.realStateRegistryInterest_branch_realstate_id);
            return(View(realStateRegistryInterestBranch));
        }