コード例 #1
0
ファイル: BudgetAnalysis.cs プロジェクト: Ontica/Erario
 private DataTable GetClassifierDataTable() {
   string classifierFilter = GetClassifierFilter();
   
   switch (classifierTypes.Length) {
     case 1:
       return AnalysisReader.OneClassFilteredGroup(classifierTypes[0].StructureField, 
                                                   classifierFilter);
     case 2:
       return AnalysisReader.TwoClassFilteredGroup(classifierTypes[0].StructureField, 
                                                   classifierTypes[1].StructureField,
                                                   classifierFilter);
     case 3:
       return AnalysisReader.ThreeClassFilteredGroup(classifierTypes[0].StructureField, 
                                                     classifierTypes[1].StructureField,
                                                     classifierTypes[2].StructureField,
                                                     classifierFilter);
     case 4:
       return AnalysisReader.FourClassFilteredGroup(classifierTypes[0].StructureField, 
                                                    classifierTypes[1].StructureField,
                                                    classifierTypes[2].StructureField, 
                                                    classifierTypes[3].StructureField, 
                                                    classifierFilter);
     default:
       return AnalysisReader.OneClassFilteredGroup(classifierTypes[0].StructureField,
                                                   classifierFilter);
   }
 }
コード例 #2
0
ファイル: BudgetAnalysis.cs プロジェクト: Ontica/Erario
    public decimal[] GetTotals() {
      DataTable table = null;
      decimal[] totals = new decimal[6];

      if (classifier != null) {
        table = AnalysisReader.OneClassFilteredGroup(classifierTypes[0].StructureField,
                                                     GetClassifierFilter());
      } else {
        table = AnalysisReader.OneClassGroup(classifierTypes[0].StructureField);
      }
      object value = table.Compute("SUM([Apr2005])", filter);
      if (value != System.DBNull.Value) {
        totals[0] = Convert.ToDecimal(value);
        totals[1] = Convert.ToDecimal(table.Compute("SUM([Pry2006])", filter));
        totals[2] = Convert.ToDecimal(table.Compute("SUM([Amp2006])", filter));
        totals[3] = Convert.ToDecimal(table.Compute("SUM([Red2006])", filter));
        totals[4] = Convert.ToDecimal(table.Compute("SUM([Apr2006])", filter));
        totals[5] = Convert.ToDecimal(table.Compute("SUM([Comp20062005])", filter));
      }
      return totals;
    }