Begin adding fluxnet site autocomplete

This commit is contained in:
2016-01-29 12:40:00 -05:00
parent 7e4d475260
commit c5fcb8d635
5 changed files with 47 additions and 6 deletions
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LeafWeb.Core.DAL;
namespace LeafWeb.Web.Controllers
{
//[UserActivity]
public class ControllerBase : Controller
{
protected readonly DataService DataService = new DataService();
protected override void Dispose(bool disposing)
{
DataService.Dispose();
base.Dispose(disposing);
}
}
}
+14
View File
@@ -0,0 +1,14 @@
using System.Web.Mvc;
using LeafWeb.Core.DAL;
namespace LeafWeb.Web.Controllers
{
public class FluxnetSiteController : ControllerBase
{
public JsonResult Autocomplete(string term)
{
var cities = DataService.GetFluxnetSitesAutocomplete(term);
return Json(cities, JsonRequestBehavior.AllowGet);
}
}
}
+1 -1
View File
@@ -12,7 +12,7 @@ using LeafWeb.Web.Charter;
namespace LeafWeb.Web.Controllers
{
public class LeafCharterController : Controller
public class LeafCharterController : Controller
{
public ActionResult Index()
{
-4
View File
@@ -10,10 +10,6 @@ namespace LeafWeb.Web.Controllers
{
public ActionResult Index()
{
var dataService = new DataService();
var fluxnetSites = dataService.GetFluxnetSites().ToList();
// initialize the session storage to retain SessionID between requests
Session["placeholder"] = 0;
return View();