//------------------------------------------------------------------- public object[] GetValues(CChartSetup chart) { List <object> lstValeurs = new List <object>(); CParametreSourceChart p = chart.ParametresDonnees.GetSourceFV(SourceId); if (p != null) { CEasyQuery query = p.GetSource(chart) as CEasyQuery; if (query != null) { //trouve la table DataTable table = query.GetTable(TableName); if (table != null) { DataColumn col = table.Columns[ColumnName]; if (col != null) { foreach (DataRow row in table.Rows) { object val = row[col]; if (val == DBNull.Value) { lstValeurs.Add(null); } else { lstValeurs.Add(val); } } } else if (Formule != null) { foreach (DataRow row in table.Rows) { CDynamicDataTableRow dr = new CDynamicDataTableRow(row); CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(dr); CResultAErreur result = Formule.Eval(ctx); if (result) { lstValeurs.Add(result.Data); } else { lstValeurs.Add(null); } } } } } } return(lstValeurs.ToArray()); }
//------------------------------------------------------- public override object GetSource(CChartSetup chartSetup) { if (m_formule == null) { return(null); } //Trouve la source CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(chartSetup); CResultAErreur result = m_formule.Eval(ctx); if (result) { return(result.Data); } return(null); }
public override string GetString(string value) { CChartSetup setup = CProprieteSelectChartAreaEditor.ChartSetup; if (setup != null) { foreach (CChartArea area in setup.Areas) { if (area.AreaId == value) { return(area.AreaName); } } } return(""); }
public override string GetString(string value) { CChartSetup setup = CProprieteSelectChartLegendEditor.ChartSetup; if (setup != null) { foreach (CLegendArea Legend in setup.Legends) { if (Legend.LegendId == value) { return(Legend.LegendName); } } } return(""); }
//------------------------------------------------------------------- public object[] GetValues(CChartSetup chart) { List <object> lstRetour = new List <object>(); CParametreSourceChart p = chart.ParametresDonnees.GetSourceFV(m_strIdSource); if (p != null && m_formule != null) { object valeur = p.GetSource(chart); IEnumerable valEnum = valeur as IEnumerable; if (valEnum is IEnumerable && EvaluateOnEachSourceElement) { foreach (object o in valEnum) { CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(o); CResultAErreur result = m_formule.Eval(ctx); if (result) { lstRetour.Add(result.Data); } } } else { CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(valeur); CResultAErreur result = m_formule.Eval(ctx); IEnumerable retour = result.Data as IEnumerable; if (retour != null) { foreach (object obj in retour) { lstRetour.Add(obj); } } } } return(lstRetour.ToArray()); }
//------------------------------------------------- public CDonneesDeChart(CChartSetup chartSetup) { m_chartSetup = chartSetup; }
//------------------------------------------------------- public CParametreSourceChartEasyQuery(CChartSetup chartSetup) : base(chartSetup) { }
//------------------------------------------------------- public override object GetSource(CChartSetup chartSetup) { return(EasyQuery); }
//------------------------------------------------------- public CParametreSourceChartFormule(CChartSetup chartSetup) : base(chartSetup) { }
//------------------------------------------------------- public abstract object GetSource(CChartSetup chart);
//------------------------------------------------------- public CParametreSourceChart(CChartSetup chartSetup) { m_strId = Guid.NewGuid().ToString(); SourceName = SourceTypeName; m_chartSetup = chartSetup;; }