/// <summary>
        /// Добавляется элемент в таблицу данных
        /// </summary>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        protected virtual void AddAircraftToDataset(WorkPackageDataSet destinationDataSet)
        {
            if (ReportedAircraft == null)
            {
                return;
            }
            var    aircraftLifelength = GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(_reportedAircraft);
            string registrationNumber = ReportedAircraft.RegistrationNumber;
            string model                 = _reportedAircraft.Model.ToString();
            string serialNumber          = ReportedAircraft.SerialNumber;
            string manufactureDate       = SmartCore.Auxiliary.Convert.GetDateFormat(ReportedAircraft.ManufactureDate);
            string sinceNewHours         = aircraftLifelength.Hours.ToString().Trim();
            string sinceNewCycles        = aircraftLifelength.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,
                                           model, lineNumberCaption, variableNumberCaption,
                                           lineNumber, variableNumber, sinceNewHours, sinceNewCycles);
        }
        /// <summary>
        /// Добавляется элемент ServiceBulletin в таблицу данных
        /// </summary>
        /// <param name="componentStatus">Добавлямая директива</param>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        public void AddDetailItemToDataset(Component componentStatus, WorkPackageDataSet destinationDataSet)
        {
            string groupName = "Detail";

            destinationDataSet.
            Items.
            AddItemsRow("MyAtaChapter", "MyRefNo", "MyDescription", "MyWorkType",
                        "MyManHours", groupName, "Cost", "Overdue", "apdate", "Complitance");
        }
        /// <summary>
        /// Построить источник данных (DataSet) для вывода в отчет
        /// </summary>
        /// <returns></returns>
        public virtual WorkPackageDataSet GenerateDataSet()
        {
            WorkPackageDataSet dataset = new WorkPackageDataSet();

            AddAircraftToDataset(dataset);
            AddItemsToDataSet(dataset);
            AddAdditionalDataToDataSet(dataset);

            return(dataset);
        }
        /// <summary>
        /// Добавление директив в таблицу данных
        /// </summary>
        /// <param name="dataset">Таблица, в которую добавляются данные</param>
        protected virtual void AddItemsToDataSet(WorkPackageDataSet dataset)
        {
            int i;

            for (i = 0; i < _reportedWorkPackage.AdStatus.Count; i++)
            {
                AddADStatusItemToDataset(_reportedWorkPackage.AdStatus[i], dataset);
            }
            for (i = 0; i < _reportedWorkPackage.Components.Count; i++)
            {
                AddDetailItemToDataset(_reportedWorkPackage.Components[i], dataset);
            }
        }
        /// <summary>
        /// Добавление дополнительной информации
        /// </summary>
        /// <param name="destinationDateSet"></param>
        protected void AddAdditionalDataToDataSet(WorkPackageDataSet destinationDateSet)
        {
            var reportHeader = ReportedAircraft.RegistrationNumber + ". " + ReportTitle;

            DateAsOf = SmartCore.Auxiliary.Convert.GetDateFormat(DateTime.Today);

            var reportFooter         = new GlobalTermsProvider()["ReportFooter"].ToString();
            var reportFooterPrepared = new GlobalTermsProvider()["ReportFooterPrepared"].ToString();
            var reportFooterLink     = new GlobalTermsProvider()["ProductWebsite"].ToString();

            destinationDateSet.
            AdditionalDataTAble.
            AddAdditionalDataTAbleRow(GlobalObjects.CasEnvironment.Operators.First(o => o.ItemId == _reportedAircraft.OperatorId).LogoTypeWhite,
                                      reportHeader, "MyDate", DateAsOf,
                                      "MyMansHours", reportFooter, reportFooterPrepared,
                                      reportFooterLink);
        }
        /// <summary>
        /// Добавляется элемент в таблицу данных
        /// </summary>
        /// <param name="adStatusItem">Добавлямая директива</param>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        private void AddADStatusItemToDataset(Directive adStatusItem, WorkPackageDataSet destinationDataSet)
        {
            GlobalObjects.PerformanceCalculator.GetNextPerformance(adStatusItem);

            string ataCapter       = adStatusItem.ATAChapter.ToString();
            string reference       = adStatusItem.Description;
            string description     = adStatusItem.WorkType.ToString();
            string lastPerformance = (adStatusItem.LastPerformance == null ? "" : adStatusItem.LastPerformance.ToString());
            string mansHours       = adStatusItem.ManHours.ToString();
            string overdue         = (adStatusItem.Remains == null ? "" : adStatusItem.Remains.ToString());// ADStatusItem.ToString();
            string cost            = adStatusItem.Cost.ToString();
            string approxDate      = adStatusItem.NextPerformanceDate != null
                ? SmartCore.Auxiliary.Convert.GetDateFormat((DateTime)adStatusItem.NextPerformanceDate)
                : "";

            const string groupName = "ADStatusItem";

            destinationDataSet.
            Items.
            AddItemsRow(ataCapter, reference, description, "Work Type",
                        mansHours, groupName, cost, overdue, approxDate, lastPerformance);
        }