示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            fotbollsplaner fotbollsplaner = db.fotbollsplaners.Find(id);

            db.fotbollsplaners.Remove(fotbollsplaner);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id, Namn, Adress, Ort, Postnummer, Latitud, Longitud, AntalGras, AntalGrus, AntalKonstGras, Parkering, Omkladnadsrum, Kafe, Restaurang, Upplyst, Bokning, Hemsida, Fritext")] fotbollsplaner fotbollsplaner)
 {
     if (ModelState.IsValid)
     {
         db.Entry(fotbollsplaner).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(fotbollsplaner));
 }
示例#3
0
        public fotbollsplaner RightClickMapLink(string latlon)
        {
            fotbollsplaner model = new fotbollsplaner();

            latlon = latlon.Trim(' ').Trim('(').Trim(')');


            model.Latitud  = latlon.Split(',')[0];
            model.Longitud = latlon.Split(',')[1].Trim(' ');


            return(model);
        }
示例#4
0
        // GET: fotbollsplaners/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            fotbollsplaner fotbollsplaner = db.fotbollsplaners.Find(id);

            if (fotbollsplaner == null)
            {
                return(HttpNotFound());
            }
            return(View(fotbollsplaner));
        }
示例#5
0
 public ActionResult Create([Bind(Include = "Id,Namn,Adress,Ort,Postnummer,Latitud,Longitud,AntalGras,AntalGrus,AntalKonstGras,Parkering,Omkladnadsrum,Kafe,Restaurang,Upplyst,Bokning,Hemsida,Fritext")] fotbollsplaner fotbollsplaner)
 {
     if (ModelState.IsValid)
     {
         db.fotbollsplaners.Add(fotbollsplaner);
         db.SaveChanges();
         ViewBag.SuccessConfirm = "y";
         return(View());
     }
     else
     {
         return(View());
     }
 }
        public ActionResult Planid(string id)
        {
            fotbollsplaner aktuellFotbollsplan = db.fotbollsplaners.Find(Convert.ToInt32(id));

            return(View("Index", aktuellFotbollsplan));
        }