Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PointOfDelivery pointOfDelivery = this.db.PointsOfDeliveries.Find(id);

            this.db.PointsOfDeliveries.Remove(pointOfDelivery);
            this.db.SaveChanges();
            return(this.RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ID,Name,CoordX,CoordY")] PointOfDelivery pointOfDelivery)
 {
     if (this.ModelState.IsValid)
     {
         this.db.Entry(pointOfDelivery).State = EntityState.Modified;
         this.db.SaveChanges();
         return(this.RedirectToAction("Index"));
     }
     return(this.View(pointOfDelivery));
 }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "ID,Name,CoordX,CoordY")] PointOfDelivery pointOfDelivery)
        {
            if (this.ModelState.IsValid)
            {
                this.db.PointsOfDeliveries.Add(pointOfDelivery);
                this.db.SaveChanges();
                return(this.RedirectToAction("Index"));
            }

            return(this.View(pointOfDelivery));
        }
Beispiel #4
0
        // GET: PointsOfDeliveries/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PointOfDelivery pointOfDelivery = this.db.PointsOfDeliveries.Find(id);

            if (pointOfDelivery == null)
            {
                return(this.HttpNotFound());
            }
            return(this.View(pointOfDelivery));
        }
Beispiel #5
0
        // GET: PointsOfDeliveries/Create
        public ActionResult Create(string lon = "", string lat = "")
        {
            try
            {
                var pointOfDelivery = new PointOfDelivery()
                {
                    CoordX = float.Parse(lon),
                    CoordY = float.Parse(lat)
                };

                return(this.View(pointOfDelivery));
            }
            catch
            {
                return(this.View());
            }
        }