Exemplo n.º 1
0
        public ActionResult GetShowImage(long layoutId, AvrPivotViewModel viewModel, int width, int height)
        {
            // have we anything selected in combo Xaxis?
            if (!string.IsNullOrEmpty(viewModel.ViewHeader.ChartXAxisViewColumn))
            {
                string img = GetChartStringFromService(layoutId, viewModel, width, height);
                if (img == "")
                {
                    return(View("AvrServiceError", (object)m_ErrorMessage));
                }

                return(View("Index", new ChartMapHelper.ChartModel(viewModel.ViewHeader.LayoutID, viewModel.ViewHeader.ChartType, img)));
            }
            return(View("Index", ChartMapHelper.GetEmptyChartData(viewModel)));
        }
Exemplo n.º 2
0
        public ActionResult Index(long layoutId, int width, int height)
        {
            ObjectStorage.Remove(Session.SessionID, layoutId, storagePrefixData);

            return(ObjectStorage.Using <AvrPivotViewModel, ActionResult>(viewModel =>
            {
                viewModel.ViewHeader.ChartType = "";

                ViewBag.Title = string.Format(Translator.GetMessageString("webChartTitle"), viewModel.ViewHeader.LayoutName);
                ViewBag.LayoutId = layoutId;

                if (!bv.common.Core.Utils.IsEmpty(viewModel.ViewHeader.ChartLocalSettingsXml))
                {
                    try
                    {
                        XmlDocument doc = new XmlDocument();
                        doc.LoadXml(viewModel.ViewHeader.ChartLocalSettingsXml);
                        if (doc.SelectSingleNode("//ChartType") != null)
                        {
                            long ltp;
                            if (long.TryParse(doc.SelectSingleNode("//ChartType").InnerText, out ltp))
                            {
                                var tp = (DBChartType)ltp;
                                viewModel.ViewHeader.ChartType = tp.ToString();
                            }
                        }


                        return GetShowImage(layoutId, viewModel, width, height);
                    }
                    catch (System.Exception e)
                    {
                        return View("AvrServiceError", (object)e.Message);
                    }
                }
                else
                {
                }
                return View("Index", ChartMapHelper.GetEmptyChartData(viewModel));
            }, Session.SessionID, layoutId, ViewLayoutController.StoragePrefix, false));
        }