Exemplo n.º 1
0
 /// <summary>
 /// Добавление директив в таблицу данных
 /// </summary>
 /// <param name="dataset">Таблица, в которую добавляются данные</param>
 private void AddItemsToDataSet(WorkPackageReleaseToServiceDataSet dataset)
 {
     foreach (KeyValuePair <string, int> keyValuePair in Items)
     {
         AddItemDataset(keyValuePair, dataset);
     }
 }
Exemplo n.º 2
0
        private WorkPackageReleaseToServiceDataSet GenerateDataSet()
        {
            var dataSet = new WorkPackageReleaseToServiceDataSet();

            AddReleaseToServiceInformationToDataSet(dataSet);
            AddItemsToDataSet(dataSet);
            return(dataSet);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Добавляется элемент в таблицу данных
 /// </summary>
 /// <param name="keyValuePair">Добавлямая директива</param>
 /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
 private void AddItemDataset(KeyValuePair <string, int> keyValuePair, WorkPackageReleaseToServiceDataSet destinationDataSet)
 {
     destinationDataSet.WPItemsTable.AddWPItemsTableRow(keyValuePair.Key, keyValuePair.Value);
 }
Exemplo n.º 4
0
        private void AddReleaseToServiceInformationToDataSet(WorkPackageReleaseToServiceDataSet destinationDataSet)
        {
            var termsProvider = new GlobalTermsProvider();
            var aircraft      = _currentWorkPackage.Aircraft;
            var totalFlight   = GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(aircraft);
            var op            = GlobalObjects.CasEnvironment.Operators.First(o => o.ItemId == aircraft.OperatorId);
            var airportName   = op.Name + Environment.NewLine + "The Seychelles National Airport";
            var maintenanceReleaseCertificate = _currentWorkPackage.ReleaseCertificateNo;
            var nationality      = "The Seychelles";
            var manufacturer     = GlobalObjects.ComponentCore.GetBaseComponentById(aircraft.AircraftFrameId).Manufacturer;
            var registrationMark = aircraft.RegistrationNumber;
            var model            = aircraft.Model.ToString();
            var serialNumber     = aircraft.SerialNumber;
            var totalCycles      = totalFlight.Cycles.ToString();
            var totalFlightHours = totalFlight.Hours.ToString();
            var operatorLogotype = op.LogotypeReportLarge;
            var operatorName     = op.Name;
            var operatorAddress  = op.Address;
            var pagesCount       = Items != null?Items.Sum(x => x.Value) : 0;

            var engines = new List <BaseComponent>(GlobalObjects.ComponentCore.GetAircraftEngines(aircraft.ItemId));

            var leftEngine  = engines.FirstOrDefault(i => i.Position.Equals("LH"));
            var rightEngine = engines.FirstOrDefault(i => i.Position.Equals("RH"));

            var engine1Serial = "";
            var engine2Serial = "";

            if (_isScatReport)
            {
                if (leftEngine != null)
                {
                    engine1Serial = $"{leftEngine.SerialNumber}";
                }

                if (rightEngine != null)
                {
                    engine2Serial = $"{rightEngine.SerialNumber}";
                }
            }
            else
            {
                if (leftEngine != null)
                {
                    engine1Serial = $"{leftEngine.Model} \n s/n {leftEngine.SerialNumber}";
                }

                if (rightEngine != null)
                {
                    engine2Serial = $"{rightEngine.Model} \n s/n {rightEngine.SerialNumber}";
                }
            }


            var apu       = GlobalObjects.ComponentCore.GetAircraftApu(aircraft.ItemId);
            var apuSerial = apu != null ? apu.SerialNumber : "";

            var workPerformedCheckType = _currentWorkPackage.CheckType;
            var workPerformedStartDate = "";

            if (_currentWorkPackage.Status == WorkPackageStatus.Published || _currentWorkPackage.Status == WorkPackageStatus.Closed)
            {
                workPerformedStartDate = _currentWorkPackage.PublishingDate.ToString(termsProvider["DateFormat"].ToString());
            }
            else
            {
                workPerformedStartDate = _currentWorkPackage.OpeningDate.ToString(termsProvider["DateFormat"].ToString());
            }
            var workPerformedEndDate = "";

            if (_currentWorkPackage.Status == WorkPackageStatus.Closed)
            {
                workPerformedEndDate = _currentWorkPackage.ClosingDate.ToString(termsProvider["DateFormat"].ToString());
            }
            var workPerformedStation     = _currentWorkPackage.Station;
            var workPerformedWorkOrderNo = _currentWorkPackage.Number;
            var wpTitle = _currentWorkPackage.Title;
            var workPerformedMaintenanceReportNo = _currentWorkPackage.MaintenanceRepairOrzanization;
            var remarks           = _currentWorkPackage.Remarks;
            var additionalRemarks = "";
            var catchword         = "";
            var crsNumber         = "";

            var task = _currentWorkPackage.WorkPakageRecords.FirstOrDefault(i => i.Task is MaintenanceDirective)?.Task;

            if (task != null)
            {
                var mpd = task as MaintenanceDirective;
                additionalRemarks = mpd.ScheduleRef;
                catchword         = $"R{mpd.ScheduleRevisionNum}";
                crsNumber         = $"{mpd.ScheduleRevisionDate:dd.MM.yyyy}";
            }

            var revision = _currentWorkPackage.Revision;

            destinationDataSet.ReleaseToServiceTable.AddReleaseToServiceTableRow(airportName,
                                                                                 maintenanceReleaseCertificate,
                                                                                 nationality, manufacturer,
                                                                                 registrationMark, model, serialNumber,
                                                                                 totalCycles, totalFlightHours,
                                                                                 operatorLogotype,
                                                                                 operatorName, operatorAddress,
                                                                                 workPerformedCheckType,
                                                                                 workPerformedStartDate,
                                                                                 workPerformedEndDate,
                                                                                 workPerformedStation,
                                                                                 workPerformedWorkOrderNo,
                                                                                 wpTitle,
                                                                                 workPerformedMaintenanceReportNo,
                                                                                 remarks, additionalRemarks, catchword, crsNumber, engine1Serial, engine2Serial,

                                                                                 apuSerial, _currentWorkPackage.Station, pagesCount);
        }
        private void AddReleaseToServiceInformationToDataSet(WorkPackageReleaseToServiceDataSet destinationDataSet)
        {
            var termsProvider = new GlobalTermsProvider();
            var aircraft      = _currentWorkPackage.Aircraft;
            var totalFlight   = GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(aircraft);
            var op            = GlobalObjects.CasEnvironment.Operators.First(o => o.ItemId == aircraft.ItemId);
            var airportName   = op.Name + Environment.NewLine + "The Seychelles National Airport";
            var maintenanceReleaseCertificate = _currentWorkPackage.ReleaseCertificateNo;
            var nationality      = "The Seychelles";
            var manufacturer     = GlobalObjects.ComponentCore.GetBaseComponentById(aircraft.AircraftFrameId).Manufacturer;
            var registrationMark = aircraft.RegistrationNumber;
            var model            = aircraft.Model.ToString();
            var serialNumber     = aircraft.SerialNumber;
            var totalCycles      = totalFlight.Cycles.ToString();
            var totalFlightHours = totalFlight.Hours.ToString();
            var operatorLogotype = op.LogotypeReportLarge;
            var operatorName     = op.Name;
            var operatorAddress  = op.Address;
            var pagesCount       = Items != null?Items.Sum(x => x.Value) : 0;

            var engines       = new List <BaseComponent>(GlobalObjects.ComponentCore.GetAircraftEngines(aircraft.ItemId));
            var engine1Serial = engines.Count > 0 ? engines[0].SerialNumber : "";
            var engine2Serial = engines.Count > 1 ? engines[1].SerialNumber : "";

            var apu       = GlobalObjects.ComponentCore.GetAircraftApu(aircraft.ItemId);
            var apuSerial = apu != null ? apu.SerialNumber : "";

            var workPerformedCheckType = _currentWorkPackage.CheckType;
            var workPerformedStartDate = "";

            if (_currentWorkPackage.Status == WorkPackageStatus.Published || _currentWorkPackage.Status == WorkPackageStatus.Closed)
            {
                workPerformedStartDate = _currentWorkPackage.PublishingDate.ToString(termsProvider["DateFormat"].ToString());
            }
            var workPerformedEndDate = "";

            if (_currentWorkPackage.Status == WorkPackageStatus.Closed)
            {
                workPerformedEndDate = _currentWorkPackage.ClosingDate.ToString(termsProvider["DateFormat"].ToString());
            }
            var workPerformedStation     = _currentWorkPackage.Station;
            var workPerformedWorkOrderNo = _currentWorkPackage.Number;
            var wpTitle = _currentWorkPackage.Title;
            var workPerformedMaintenanceReportNo = _currentWorkPackage.MaintenanceRepairOrzanization;
            var remarks           = _currentWorkPackage.Remarks;
            var additionalRemarks = termsProvider["CAARequirements"].ToString();
            var catchword         = termsProvider["Revision"].ToString();
            var crsNumber         = _currentWorkPackage.ReleaseCertificateNo;
            var revision          = _currentWorkPackage.Revision;

            destinationDataSet.ReleaseToServiceTable.AddReleaseToServiceTableRow(airportName,
                                                                                 maintenanceReleaseCertificate,
                                                                                 nationality, manufacturer,
                                                                                 registrationMark, model, serialNumber,
                                                                                 totalCycles, totalFlightHours,
                                                                                 operatorLogotype,
                                                                                 operatorName, operatorAddress,
                                                                                 workPerformedCheckType,
                                                                                 workPerformedStartDate,
                                                                                 workPerformedEndDate,
                                                                                 workPerformedStation,
                                                                                 workPerformedWorkOrderNo,
                                                                                 wpTitle,
                                                                                 workPerformedMaintenanceReportNo,
                                                                                 remarks, additionalRemarks, catchword,
                                                                                 crsNumber, engine1Serial, engine2Serial,
                                                                                 apuSerial, revision, pagesCount);
        }