Example #1
0
        public static ChartRequestModel ToRequest(this UserChartEntity uq)
        {
            var result = new ChartRequestModel(uq.QueryName)
            {
                ChartScript = uq.ChartScript,
                Filters     = uq.Filters.ToFilterList(),
            };

            result.Columns.ZipForeach(uq.Columns, (r, u) =>
            {
                r.Token        = u.Token;
                r.DisplayName  = u.DisplayName;
                r.OrderByIndex = u.OrderByIndex;
                r.OrderByType  = u.OrderByType;
            });

            result.Parameters.ForEach(r =>
            {
                r.Value = uq.Parameters.FirstOrDefault(u => u.Name == r.Name)?.Value ?? r.ScriptParameter.DefaultValue(r.ScriptParameter.GetToken(uq));
            });
            return(result);
        }
Example #2
0
 public ChartScript GetChartScript()
 {
     return(ChartRequestModel.GetChartScriptFunc(this.ChartScript));
 }