Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MunicipalityRegion municipalityRegion = db.MunicipalityRegion.Find(id);

            db.MunicipalityRegion.Remove(municipalityRegion);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "MunicipalyRegionId,MunicipalityId,RegionId")] MunicipalityRegion municipalityRegion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(municipalityRegion).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.MunicipalityId = new SelectList(db.Municipalitys, "MunicipalityId", "Name", municipalityRegion.MunicipalityId);
     ViewBag.RegionId       = new SelectList(db.Region, "RegionId", "Name", municipalityRegion.RegionId);
     return(View(municipalityRegion));
 }
Example #3
0
        // GET: MunicipalityRegions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MunicipalityRegion municipalityRegion = db.MunicipalityRegion.Find(id);

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

            if (municipalityRegion == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MunicipalityId = new SelectList(db.Municipalitys, "MunicipalityId", "Name", municipalityRegion.MunicipalityId);
            ViewBag.RegionId       = new SelectList(db.Region, "RegionId", "Name", municipalityRegion.RegionId);
            return(View(municipalityRegion));
        }