public static DataTable GetPortalTicketsTablePage(LoginUser loginUser, int from, int to, string sortField, TabularReport tabReport)
        {
            from++;
            to++;

            SqlCommand command = new SqlCommand();

            GetPortalTicketsSQL(loginUser, command, tabReport, true, false);

            command.Parameters.AddWithValue("@From", from);
            command.Parameters.AddWithValue("@To", to);

            Report.AddCommandParameters(command, loginUser);

            DataTable table = new DataTable();

            using (SqlConnection connection = new SqlConnection(loginUser.ConnectionString))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction(IsolationLevel.ReadUncommitted);

                command.Connection  = connection;
                command.Transaction = transaction;
                try
                {
                    using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                    {
                        adapter.Fill(table);
                    }
                    transaction.Commit();
                    table = DataUtils.DecodeDataTable(table);
                    table = DataUtils.StripHtmlDataTable(table);
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    ExceptionLogs.LogException(loginUser, ex, "Portal Tickets Data", DataUtils.GetCommandTextSql(command));
                    throw;
                }
                connection.Close();
            }

            return(table);
        }
Esempio n. 2
0
 public static void GetSummaryCommand(LoginUser loginUser, SqlCommand command, SummaryReport summaryReport, bool isSchemaOnly, bool useUserFilter, bool useDefaultOrderBy)
 {
     command.CommandType = CommandType.Text;
     GetSummarySql(loginUser, command, summaryReport, isSchemaOnly, null, useUserFilter, useDefaultOrderBy);
     Report.AddCommandParameters(command, loginUser);
 }