Beispiel #1
0
        /// <summary>
        /// Raises the    AJAXRequest event.
        /// </summary>
        /// <param name="args">The <see cref="NewWayMedia.Common.Controls.DataRequestEventArgs"/> instance containing the event data.</param>
        /// <returns></returns>
        protected override string OnAJAXRequest(DataRequestEventArgs args)
        {
            try
            {
                PageEx p      = Page as PageEx;
                int?   height = p.GetRequestInt("height");
                int?   width  = p.GetRequestInt("width");



                chart.Height = height ?? 250;
                chart.Width  = width ?? 250;

                switch (handler.Action)
                {
                case actionKeyApplyGraphType:
                    int?type = p.GetRequestInt("type");
                    settings.ChartType = (ChartType)(type ?? 0);
                    chartDashboardSettingsProvider.Save(settings, ClientID);
                    break;

                case actionKeyApplyTimeFrame:
                    int?timeFrame = p.GetRequestInt("frame");
                    settings.TimeFrameType = (TimeFrameType)(timeFrame ?? 0);
                    chartDashboardSettingsProvider.Save(settings, ClientID);
                    break;

                case actionKeyShow:
                    break;


                default:
                    return(base.OnAJAXRequest(args));
                }
                chart.Type      = settings.ChartType;
                chart.TimeFrame = settings.TimeFrameType;
                if (datasource != null)
                {
                    chart.DataSource = datasource();
                }

                return(ControlHelper.GetControlHtml(chart));
            }
            catch (Exception ex)
            {
                Util.Log.Error("OnAJAXRequest", ex);
            }
            return(string.Empty);
        }
Beispiel #2
0
 /// <summary>
 /// Gets the action URL.
 /// </summary>
 /// <param name="actionName">Name of the action.</param>
 /// <returns></returns>
 public string GetActionURL(string actionName)
 {
     return(PageEx.GetAJAXHadlerURL(this) + "&action=" + HttpUtility.UrlEncode(actionName));
 }
Beispiel #3
0
 /// <summary>
 /// Retruns url to xml data source
 /// </summary>
 /// <returns>Url</returns>
 private string GetXmlSourceUrl()
 {
     return(PageEx.GetDymanicDataRequestUrl(this));
 }