/// <summary> /// Добавляется элемент в таблицу данных /// </summary> /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param> private void AddAircraftToDataset(WPIncomingInspectionDataSet destinationDataSet) { if (_currentWorkPackage.Aircraft == null) { return; } var aircraftLifelength = GlobalObjects.CasEnvironment.Calculator.GetCurrentFlightLifelength(_currentWorkPackage.Aircraft); string serialNumber = _currentWorkPackage.Aircraft.SerialNumber; string manufactureDate = _currentWorkPackage.Aircraft.ManufactureDate.ToString(new GlobalTermsProvider()["DateFormat"].ToString()); string sinceNewHours = aircraftLifelength.Hours.ToString(); string sinceNewCycles = aircraftLifelength.Cycles.ToString().Trim(); string lineNumberCaption = ""; string variableNumberCaption = ""; string lineNumber = _currentWorkPackage.Aircraft.LineNumber; string variableNumber = _currentWorkPackage.Aircraft.VariableNumber; if (lineNumber != "") { lineNumberCaption = "L/N:"; } if (variableNumber != "") { variableNumberCaption = "V/N:"; } destinationDataSet.AircraftInformationTable.AddAircraftInformationTableRow(_currentWorkPackage.Aircraft.RegistrationNumber, serialNumber, manufactureDate, _currentWorkPackage.Aircraft.Model.ToString(), lineNumberCaption, variableNumberCaption, lineNumber, variableNumber, sinceNewHours, sinceNewCycles); }
/// <summary> /// Добавление дополнительной информации /// </summary> /// <param name="destinationDateSet"></param> private void AddAdditionalDataToDataSet(WPIncomingInspectionDataSet destinationDateSet) { var reportHeader = "Component Change Order"; 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 == _currentWorkPackage.Aircraft.OperatorId).LogotypeReportLarge, reportHeader, "", "", "", reportFooter, reportFooterPrepared, reportFooterLink); }
private WPIncomingInspectionDataSet GenerateDataSet() { WPIncomingInspectionDataSet dataSet = new WPIncomingInspectionDataSet(); AddAdditionalDataToDataSet(dataSet); AddMainInformationToDataSet(dataSet); AddAircraftToDataset(dataSet); return(dataSet); }
private void AddMainInformationToDataSet(WPIncomingInspectionDataSet destinationDataSet) { destinationDataSet.MainTable.AddMainTableRow("", _currentWorkPackage.Title, _currentWorkPackage.Station); }