Esempio n. 1
0
        public static InternalReport CreateInternalReport(String identifier, Int32 userId, Int32 projectId, String source,
                                                          Boolean isBulk, String comment, String settingsXml)
        {
            DataReader     dataReader = null;
            InternalReport report;

            CheckInternalReportNotDefined(new String[] { identifier });

            // this function should be called within a try - catch environment higher up
            try
            {
                dataReader = Database.CreateInternalReport(identifier, userId, projectId,
                                                           source, isBulk, comment, settingsXml);
                if (dataReader.Read())
                {
                    report = new InternalReport(dataReader);
                }
                else
                {
                    throw new System.Exception("Unable to create internal report.");
                }

                return(report);
            }
            finally
            {
                if (dataReader != null)
                {
                    dataReader.Close();
                }
            }
        }
Esempio n. 2
0
        public static InternalReport GetInternalReport(String identifier)
        {
            DataReader     dataReader     = null;
            InternalReport internalReport = null;

            try
            {
                dataReader = Database.GetInternalReportByIdentifier(identifier);
                if (dataReader.Read())
                {
                    internalReport = new InternalReport(dataReader);
                }
            }
            finally
            {
                CloseDataReader(dataReader);
            }
            return(internalReport);
        }