Ejemplo n.º 1
0
 public static FullReportRecord GetFullReportRecord(RecordTypeCalc record, string title = null)
 {
     FullReportRecord rec=new FullReportRecord();
     rec.Title = String.IsNullOrEmpty(title) ? record.Title : title;
     rec.Key = record.ID;
     rec.Selectable = true;
     rec.Children = new List<FullReportRecord>();
     return rec;
 }
Ejemplo n.º 2
0
 protected void processNeedData(RecordTypeCalc rCalc)
 {
     CurrentNeedRecords = new List<string>();
     double d=rCalc.CalcFunction(this, null);
     List<string> current=CurrentNeedRecords.ToList();
     foreach (String key in current) {
         if (!NeedRecords.Contains(key)) {
             NeedRecords.Add(key);
         }
         RecordTypeBase recordType=RecordTypes[key];
         if (recordType is RecordTypeCalc) {
             RecordTypeCalc child=recordType as RecordTypeCalc;
             processNeedData(child);
         }
     }
 }
Ejemplo n.º 3
0
 public RecordTypeCalc(RecordTypeCalc baseRecord, bool toChart = false, bool visible = false, ResultTypeEnum resultType = ResultTypeEnum.sum, string formatDouble = "#,0.##")
 {
     ID = baseRecord.ID;
     Title = baseRecord.Title;
     CalcFunction = baseRecord.CalcFunction;
     Visible = visible;
     ToChart = toChart;
     FormatDouble = formatDouble;
     ResultType = resultType;
 }
Ejemplo n.º 4
0
        public static void CreateGAP()
        {
            P_GA1.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA1_Otd.Key] - report[date,PiramidaRecords.P_GA1_Priem.Key]);
                });

            P_GA2.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA2_Otd.Key] - report[date,PiramidaRecords.P_GA2_Priem.Key]);
                });

            P_GA3 = new RecordTypeCalc("P_GA3", "ГА-3 P",
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA3_Otd.Key] - report[date,PiramidaRecords.P_GA3_Priem.Key]);
                }));

            P_GA4.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA4_Otd.Key] - report[date,PiramidaRecords.P_GA4_Priem.Key]);
                });

            P_GA5.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA5_Otd.Key] - report[date,PiramidaRecords.P_GA5_Priem.Key]);
                });

            P_GA6.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA6_Otd.Key] - report[date,PiramidaRecords.P_GA6_Priem.Key]);
                });

            P_GA7.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA7_Otd.Key] - report[date,PiramidaRecords.P_GA7_Priem.Key]);
                });

            P_GA8.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA8_Otd.Key] - report[date,PiramidaRecords.P_GA8_Priem.Key]);
                });

            P_GA9.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA9_Otd.Key] - report[date,PiramidaRecords.P_GA9_Priem.Key]);
                });

            P_GA10.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return (report[date,PiramidaRecords.P_GA10_Otd.Key] - report[date,PiramidaRecords.P_GA10_Priem.Key]);
                });

            P_Vozb.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return
                        report[date, PiramidaRecords.P_Vozb_GA1_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA2_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA3_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA4_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA5_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA6_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA7_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA8_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA9_Priem.Key] +
                        report[date, PiramidaRecords.P_Vozb_GA10_Priem.Key];
                });

            P_SN_GA.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return
                        report[date, PiramidaRecords.P_SN_11T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_12T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_13T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_14T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_15T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_16T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_17T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_18T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_19T_Priem.Key] +
                        report[date, PiramidaRecords.P_SN_20T_Priem.Key];
                });

            P_SK.CalcFunction=
                new RecordCalcDelegate((report, date) => {
                    return
                        report[date, PiramidaRecords.P_GA1_Priem.Key] +
                        report[date, PiramidaRecords.P_GA2_Priem.Key] +
                        report[date, PiramidaRecords.P_GA9_Priem.Key] +
                        report[date, PiramidaRecords.P_GA10_Priem.Key];
                });
        }