Example #1
0
 public ActionResult Delete(long id)
 {
     try
     {
         ViewChart viewchart = BaseChartRepository.GetChart(id, GetUserId());
         return(View(viewchart));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
Example #2
0
 public ViewResult Details(long id)
 {
     try
     {
         ViewChart viewchart = BaseChartRepository.GetChart(id, GetUserId());
         ViewBag.ChartTypes = new SelectList(ChartTypes, viewchart != null ? viewchart.ChartType.TrimEnd() : ChartTypes[0]);
         return(View("Details", viewchart));
     }
     catch (Exception e)
     {
         ExceptionMessageToViewBag(e);
         return(View("Error"));
     }
 }
Example #3
0
        public ActionResult ShowDiagram(Int64 id /*chart id.*/)
        {
            try
            {
                Guid      userId    = GetUserId();
                ViewChart viewchart = BaseChartRepository.GetChart(id, userId);

                return(View(viewchart));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                //  this view is showed in frame, so
                //  it should show error message by itself
                return(View());
            }
        }
Example #4
0
        public ActionResult ShowChart(Int64 id /*chart id.*/)
        {
            try
            {
                Guid      userId = GetUserId();
                ViewChart v      = BaseChartRepository.GetChart(id, userId);
                ViewBag.ChartID = v.ID;
                ViewBag.Width   = v.Width;
                ViewBag.Height  = v.Height;

                return(View("ShowChart", v));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Example #5
0
        public ActionResult Edit(long id)
        {
            try
            {
                ViewChart v = BaseChartRepository.GetChart(id, GetUserId());
                SetCreateEditViewBag(v);

                if (v.ChartType.ToLower() == Diagram.ToLower())
                {
                    return(View("EditDiagram", v));
                }
                return(View("Edit", v));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Example #6
0
        //  this method renders the chart demo page;
        //  name must be the same as in ChartController to utilize the updating script;
        //  https://www.evernote.com/shard/s132/nl/14501366/7dea6933-c310-4df8-906c-a0457ca00fac
        public ActionResult ShowChart()
        {
            try
            {
                var v = BaseChartRepository.GetChart(_chartId, _userId);
                ViewBag.ChartID = v.ID;
                ViewBag.Width   = v.Width;
                ViewBag.Height  = v.Height;

                if (v.ChartType.ToLower() == Line.ToLower())
                {
                    return(View("DemoChart"));
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Example #7
0
        public ActionResult ShowDiagramDataSet(Int64 id /*chart id.*/)
        {
            try
            {
                Guid      userId = GetUserId();
                ViewChart v      = BaseChartRepository.GetChart(id, userId);

                if (v.ChartType.ToLower() == Diagram.ToLower())
                {
                    ViewBag.ChartID = v.ID;
                    ViewBag.Width   = v.Width;
                    ViewBag.Height  = v.Height;
                    return(View("ShowDiagramDataSet", v));
                }
                return(RedirectToAction("ShowChart", new { id }));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }
Example #8
0
        /*
         * public ActionResult XLSX(Int64 id/*chart id.* /)
         * {
         *  try
         *  {
         *      //  here should be export to XLSX realization
         *      ViewChart viewchart = chartRepository.GetChart(id, GetUserID());
         *      return View(viewchart);
         *  }
         *  catch (Exception e)
         *  {
         *      ExceptionMessageToViewBag(e);
         *      return View("Error");
         *  }
         * }
         */

        public ActionResult DataSet(Int64 id /*chart id.*/, long?groupId, String group, long?ownerId, String owner,
                                    long?locationId, String location, String element, String svgId)
        {
            try
            {
                ViewChart viewchart = BaseChartRepository.GetChart(id, GetUserId());
                ViewBag.Group      = group;
                ViewBag.GroupID    = groupId;
                ViewBag.Owner      = owner;
                ViewBag.OwnerID    = ownerId;
                ViewBag.Location   = location;
                ViewBag.LocationID = locationId;
                ViewBag.Element    = element;
                ViewBag.SVGID      = svgId;
                List <ViewElementFiltered> v = BaseChartRepository.GetElementFilteredList(element, ownerId, groupId, locationId, GetUserId(), id);
                ViewBag.ElementList = v;
                return(View(viewchart));
            }
            catch (Exception e)
            {
                ExceptionMessageToViewBag(e);
                return(View("Error"));
            }
        }