Ejemplo n.º 1
0
        private static DataTable GetSummaryData(LoginUser loginUser, SummaryReport summaryReport, bool useDefaultOrderBy, Report report = null)
        {
            SqlCommand command = new SqlCommand();

            SummaryReportSql.GetSummaryCommand(loginUser, command, summaryReport, false, false, useDefaultOrderBy);
            BaseCollection.FixCommandParameters(command);
            if (report != null)
            {
                report.LastSqlExecuted = DataUtils.GetCommandTextSql(command);
                report.Collection.Save();
            }

            DataTable table = new DataTable();

            using (SqlConnection connection = new SqlConnection(loginUser.ConnectionString))
            {
                connection.Open();
                command.Connection = connection;
                using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                {
                    try
                    {
                        adapter.Fill(table);
                    }
                    catch (Exception ex)
                    {
                        ExceptionLogs.LogException(loginUser, ex, "GetSummaryData");
                        throw;
                    }
                }
                connection.Close();
            }
            return(table);
        }
Ejemplo n.º 2
0
        public static void GetSummarySql(LoginUser loginUser, SqlCommand command, SummaryReport summaryReport, bool isSchemaOnly, int?reportID, bool useUserFilter, bool useDefaultOrderBy)
        {
            SummaryReportSql summaryReportSql = new SummaryReportSql(loginUser);

            summaryReportSql.GetSummarySql(command, summaryReport, isSchemaOnly, reportID, useUserFilter, useDefaultOrderBy);
        }
 public ReportSummaryAll(LoginUser loginUser, Report report)
 {
     _loginUser        = loginUser;
     _report           = report;
     _summaryReportSql = new SummaryReportSql(loginUser);
 }