Example #1
0
        public ActionResult RemoveItem(long itemId)
        {
            var item = ChosenItems.FirstOrDefault(i => i.Id == itemId);

            if (item != null)
            {
                ChosenItems.Remove(item);
            }

            return(PartialView("~/Views/Plan/ChosenDestinations.cshtml", ChosenItems));
        }
Example #2
0
        // GET: Routing
        public ActionResult Index(long townId)
        {
            var homeTown = routingService.GetHomeCoordinates(townId);

            // insert the home town for calculations:
            ChosenItems.Insert(0, homeTown);

            LastOrderedList = tspService.SolveTsp(ChosenItems);

            // Remove hometown after calculations are done:
            ChosenItems.Remove(homeTown);
            return(View(LastOrderedList));
        }