예제 #1
0
 /// <summary>
 /// run a specified function for all rows
 /// </summary>
 /// <param name="processRow"></param>
 public void ProcessAllRows(TProcessResult processRow)
 {
     foreach (TResult element in Results.GetResults())
     {
         processRow(this, element);
     }
 }
예제 #2
0
        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void MenuItemClick(System.Object sender, System.EventArgs e)
        {
            Int32  columnCounter;
            String detailReportCSV;
            String action;
            String query;
            String LineCode;

            DataRowView[] TheDataRowViewArray;
            TResult       SelectedResult;
            String        paramName;
            String        paramValue;
            String        SettingsDirectory;
            MenuItem      ClickedMenuItem = (MenuItem)sender;

            TheDataRowViewArray = FGridView.SelectedDataRowsAsDataRowView;

            if (TheDataRowViewArray.Length <= 0)
            {
                // no row is selected
                return;
            }

            LineCode       = TheDataRowViewArray[0][0].ToString();
            SelectedResult = null;

            foreach (TResult r in results.GetResults())
            {
                if (r.code == LineCode)
                {
                    SelectedResult = r;
                }
            }

            detailReportCSV = (String)ClickedMenuItem.Tag;
            StringHelper.GetNextCSV(ref detailReportCSV, ",");

            // get rid of the name
            action = StringHelper.GetNextCSV(ref detailReportCSV, ",");

            if (action == "PartnerEditScreen")
            {
#if TODO
                // get the partner key
                Int64 PartnerKey = Convert.ToInt64(SelectedResult.column[Convert.ToInt32(detailReportCSV)].ToString());
                // TODO: open Partner Edit screen with the given partner key
#endif
            }
            else if (action.IndexOf(".xml") != -1)
            {
                query             = StringHelper.GetNextCSV(ref detailReportCSV, ",");
                FDetailParameters = new TParameterList(FOrigParameters);
                FDetailParameters.Add("param_whereSQL", query);

                // get the parameter names and values
                while (detailReportCSV.Length > 0)
                {
                    paramName  = StringHelper.GetNextCSV(ref detailReportCSV, ",");
                    paramValue = StringHelper.GetNextCSV(ref detailReportCSV, ",");
                    FDetailParameters.Add(paramName, new TVariant(paramValue));
                }

                // add the values of the selected column (in this example the first one)
                for (columnCounter = 0; columnCounter <= FDetailParameters.Get("MaxDisplayColumns").ToInt() - 1; columnCounter += 1)
                {
                    FDetailParameters.Add("param_" +
                                          FDetailParameters.Get("param_calculation", columnCounter).ToString(), SelectedResult.column[columnCounter]);
                }

                // action is a link to a settings file; it contains e.g. xmlfiles, currentReport, and column settings
                // TParameterList.Load adds the new parameters to the existing parameters
                SettingsDirectory = TClientSettings.ReportingPathReportSettings;
                FDetailParameters.Load(SettingsDirectory + '/' + action);
                GenerateReportInThread();
            }
        }