protected override void OnActionExecuting(ActionExecutingContext filterContext) { string serverNameURL = Request.Url.ToString(); int dotIndex = serverNameURL.IndexOf("."); this.ServerName = (dotIndex > -1) ? serverNameURL.Substring(0, dotIndex) : "localhost"; this.ServerName = this.ServerName.Replace("http://", ""); ViewBag.ServerName = ServerName; string storageConnectionString; if (Session["StorageConnectionString"] == null) { Session["StorageConnectionString"] = "StorageConnectionStringProd"; } if (Session["LatLonGroupID"] == null) { Session["LatLonGroupName"] = "KeyCitiesQAPage"; Session["LatLonGroupID"] = 1; } storageConnectionString = (string)Session["StorageConnectionString"]; apiCaller = new JassWeatherAPI(this.ServerName, HttpContext.Server.MapPath("~/App_Data"), storageConnectionString); jassuserinfo = apiCaller.GetCurrentUser(); Session["UserInfo"] = jassuserinfo; base.OnActionExecuting(filterContext); }
public ActionResult ShowDashBoard() //list container { Session["StorageConnectionString"] = "StorageConnectionStringDev"; apiCaller = new JassWeatherAPI(ServerName, HttpContext.Server.MapPath("~/App_Data"), (string)Session["StorageConnectionString"]); List <JassVariableStatus> variableStatusModel = apiCaller.listVariableStatus((int?)jassuserinfo.JassVariableGroupID); #region select Variable Group var userInfo = apiCaller.GetCurrentUser(); ViewBag.VariableGroupID = userInfo.JassVariableGroupID; int VariableGroupID = (int)ViewBag.VariableGroupID; var variableGroups = db.JassVariableGroups.ToList(); ViewBag.JassVariableID = new SelectList(variableGroups, "JassVariableGroupID", "Name"); #endregion return(View(variableStatusModel)); }