/// <summary> /// load subplot view for noram users /// </summary> /// <param name="plotid"></param> /// <returns>subplot view</returns> // GET: PlotChart public ActionResult SubPlots(long?plotid) //String plotid, int zoom) { var defaultPlotId = Helper.Settings.get("DefaultPlotId").ToString(); ViewData["DefaultPlotID"] = defaultPlotId; PlotChartViewModel plotviewmodel = new PlotChartViewModel(); var plotList = helper.GetPlotsOld(); plotviewmodel.plotlist = plotList.ToList().OrderBy(x => x.PlotId, new BExIS.Modules.PMM.UI.Helper.NaturalSorter()); var plotListNew = helper.GetPlotsNew(); plotviewmodel.plotlistNew = plotListNew.ToList().OrderBy(x => x.PlotId, new BExIS.Modules.PMM.UI.Helper.NaturalSorter()); plotviewmodel.selectedPlot = null; var list_plotlist = plotviewmodel.plotlist.ToList(); if (plotid != null && list_plotlist.Count > 0 && list_plotlist.First(x => x.Id == plotid) != null) { plotviewmodel.selectedPlot = plotid != null?list_plotlist.First(x => x.Id == plotid) : list_plotlist.First(); } if (plotviewmodel.selectedPlot == null) { plotviewmodel.selectedPlot = plotList.Where(a => a.Id == Convert.ToInt64(defaultPlotId)).FirstOrDefault(); } plotviewmodel.ImageSource = helper.ProducePlot(helper.GetPlot(plotviewmodel.selectedPlot.Id), 1, false); ViewBag.Title = "BExIS - Plot Maps"; return(View(plotviewmodel)); }
/// <summary> /// Load plot admin view /// </summary> /// <returns>plot admin view</returns> public ActionResult Index() { PlotChartViewModel plotviewmodel = new PlotChartViewModel(); var plotList = helper.GetPlots(); plotviewmodel.plotlist = plotList.ToList().OrderBy(x => x.PlotId, new BExIS.Modules.PMM.UI.Helper.NaturalSorter()); plotviewmodel.isAdmin = true; plotviewmodel.allPlots = "," + String.Join(",", plotviewmodel.plotlist.Select(x => x.Id.ToString()).ToArray()); return(View(plotviewmodel)); }