예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            JassLatLon jasslatlon = db.JassLatLons.Find(id);

            db.JassLatLons.Remove(jasslatlon);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
        //
        // GET: /LatLon/Details/5

        public ActionResult Details(int id = 0)
        {
            JassLatLon jasslatlon = db.JassLatLons.Find(id);

            if (jasslatlon == null)
            {
                return(HttpNotFound());
            }
            return(View(jasslatlon));
        }
예제 #3
0
        //
        // GET: /LatLon/Edit/5

        public ActionResult Edit(int id = 0)
        {
            JassLatLon jasslatlon = db.JassLatLons.Find(id);

            if (jasslatlon == null)
            {
                return(HttpNotFound());
            }
            ViewBag.JassLatLonGroupID = new SelectList(db.JassLatLonGroups, "JassLatLonGroupID", "Name", jasslatlon.JassLatLonGroupID);

            jasslatlon = apiCaller.MapLatLonToNarr(jasslatlon);
            return(View(jasslatlon));
        }
예제 #4
0
        public ActionResult Edit(JassLatLon jasslatlon)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    jasslatlon = apiCaller.MapLatLonToNarr(jasslatlon);
                    db.Entry(jasslatlon).State = EntityState.Modified;
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
                ViewBag.JassLatLonGroupID = new SelectList(db.JassLatLonGroups, "JassLatLonGroupID", "Name", jasslatlon.JassLatLonGroupID);
            }
            catch (Exception e)
            {
                apiCaller.createBuilderLog("EXCEPTION", "Location", e.Message, new TimeSpan(), false);
                ViewBag.message = "ERROR when editing";
            }

            return(View(jasslatlon));
        }
예제 #5
0
        public ActionResult Create(JassLatLon jasslatlon)
        {
            ViewBag.JassLatLonGroupID = new SelectList(db.JassLatLonGroups, "JassLatLonGroupID", "Name", jasslatlon.JassLatLonGroupID);

            try
            {
                if (ModelState.IsValid)
                {
                    jasslatlon = apiCaller.MapLatLonToNarr(jasslatlon);
                    db.JassLatLons.Add(jasslatlon);
                    db.SaveChanges();
                    return(View("Edit", jasslatlon));
                }
            }
            catch (Exception e)
            {
                apiCaller.createBuilderLog("EXCEPTION", "Location", e.Message, new TimeSpan(), false);
                ViewBag.JassMessage = "ERROR when creating";
            }

            return(View(jasslatlon));
        }