Example #1
0
        /// <summary>
        /// Добавление дополнительной информации
        /// </summary>
        /// <param name="destinationDateSet"></param>
        private void AddAdditionalDataToDataSet(WorkPackagesDataSet destinationDateSet)
        {
            DateAsOf = SmartCore.Auxiliary.Convert.GetDateFormat(DateTime.Today);

            string reportHeader;
            string model;

            if (_reportedAircraft != null)
            {
                reportHeader = ReportedAircraft.RegistrationNumber + ". " + ReportTitle;
                model        = ReportedAircraft.Model.ToString();
            }
            else
            {
                reportHeader = ReportTitle;
                model        = "";
            }

            if (_isFiltered)
            {
                reportHeader += ". Filtered";
            }
            string reportFooter         = new GlobalTermsProvider()["ReportFooter"].ToString();
            string reportFooterPrepared = new GlobalTermsProvider()["ReportFooterPrepared"].ToString();
            string reportFooterLink     = new GlobalTermsProvider()["ProductWebsite"].ToString();

            destinationDateSet.
            AdditionalDataTable.
            AddAdditionalDataTableRow(_operatorLogotype,
                                      reportHeader, model, DateAsOf,
                                      reportFooter, reportFooterPrepared, reportFooterLink);
        }
Example #2
0
 /// <summary>
 /// Добавление директив в таблицу данных
 /// </summary>
 /// <param name="dataset">Таблица, в которую добавляются данные</param>
 protected virtual void AddDirectivesToDataSet(WorkPackagesDataSet dataset)
 {
     foreach (var workPackage in _reportedDirectives)
     {
         AddDirectiveToDataset(workPackage, dataset);
     }
 }
Example #3
0
        /// <summary>
        /// Добавляется элемент в таблицу данных
        /// </summary>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        protected virtual void AddAircraftToDataset(WorkPackagesDataSet destinationDataSet)
        {
            if (ReportedAircraft == null)
            {
                return;
            }
            string     registrationNumber    = ReportedAircraft.RegistrationNumber;
            string     serialNumber          = ReportedAircraft.SerialNumber;
            string     manufactureDate       = SmartCore.Auxiliary.Convert.GetDateFormat(ReportedAircraft.ManufactureDate);
            Lifelength lifelength            = GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(_reportedAircraft);
            string     sinceNewHours         = lifelength.Hours.ToString().Trim();
            string     sinceNewCycles        = lifelength.Cycles.ToString().Trim();
            string     lineNumberCaption     = "";
            string     variableNumberCaption = "";

            string lineNumber     = (ReportedAircraft).LineNumber;
            string variableNumber = (ReportedAircraft).VariableNumber;

            if (lineNumber != "")
            {
                lineNumberCaption = "L/N:";
            }
            if (variableNumber != "")
            {
                variableNumberCaption = "V/N:";
            }
            destinationDataSet.
            AircraftInformationTable.
            AddAircraftInformationTableRow(registrationNumber, serialNumber, manufactureDate,
                                           lineNumberCaption, variableNumberCaption, lineNumber,
                                           variableNumber, sinceNewHours, sinceNewCycles);
        }
Example #4
0
        /// <summary>
        /// Построить источник данных (DataSet) для вывода в отчет
        /// </summary>
        /// <returns></returns>
        public virtual WorkPackagesDataSet GenerateDataSet()
        {
            WorkPackagesDataSet dataset = new WorkPackagesDataSet();

            AddAircraftToDataset(dataset);
            AddDirectivesToDataSet(dataset);
            AddAdditionalDataToDataSet(dataset);

            return(dataset);
        }
Example #5
0
        /// <summary>
        /// Добавляется элемент в таблицу данных
        /// </summary>
        /// <param name="directive">Добавлямая директива</param>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        private void AddDirectiveToDataset(WorkPackage directive, WorkPackagesDataSet destinationDataSet)
        {
            string date;

            if (directive.Status == WorkPackageStatus.Opened)
            {
                date = SmartCore.Auxiliary.Convert.GetDateFormat(directive.OpeningDate);
            }
            else if (directive.Status == WorkPackageStatus.Closed)
            {
                date = SmartCore.Auxiliary.Convert.GetDateFormat(directive.ClosingDate);
            }
            else
            {
                date = SmartCore.Auxiliary.Convert.GetDateFormat(directive.PublishingDate);
            }

            destinationDataSet.
            WorkPackagesTable.
            AddWorkPackagesTableRow(directive.Title, directive.Description, directive.Status.ToString(),
                                    date, directive.Author, directive.Remarks, directive.Number);
        }