コード例 #1
0
        /// <summary>
        /// Добавляется элемент в таблицу данных
        /// </summary>
        /// <param name="baseDetail">Добавлямый бавовый агрегат</param>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        public virtual void AddBaseDetailToDataset(BaseDetail baseDetail, DirectiveListReportDataSet destinationDataSet)
        {
            DirectiveListReportDataSet.OperatorTableRow parentOperator = destinationDataSet.OperatorTable.FindByOperatorID(baseDetail.ParentAircraft.Parent.ID);
            string serialNumber          = baseDetail.SerialNumber;
            string manufactureDate       = baseDetail.ManufactureDate.ToString("MMM dd, yyyy");
            string model                 = baseDetail.Model;
            string sinceNewHours         = ((int)baseDetail.Lifelength.Hours.TotalHours).ToString().Trim();
            string sinceNewCycles        = baseDetail.Lifelength.Cycles.ToString().Trim();
            string sinceNewCalendar      = baseDetail.Lifelength.Calendar.ToString().Trim();
            string sinceOverhaulHours    = ((int)baseDetail.Limitation.ResourceSinceOverhaul.Hours.TotalHours).ToString().Trim();
            string sinceOverhaulCycles   = baseDetail.Limitation.ResourceSinceOverhaul.Cycles.ToString().Trim();
            string sinceOverhaulCalendar = (baseDetail.Limitation.ResourceSinceOverhaul.Calendar).ToString().Trim();

            destinationDataSet.BaseDetailTable.AddBaseDetailTableRow(
                parentOperator, baseDetail.ID,
                serialNumber, manufactureDate, model, sinceNewHours,
                sinceNewCycles, sinceNewCalendar,
                sinceOverhaulHours,
                sinceOverhaulCycles,
                sinceOverhaulCalendar, "", "", "");
        }
コード例 #2
0
        /// <summary>
        /// Добавляется элемент в таблицу данных
        /// </summary>
        /// <param name="aircraft">Добавлямое ВС</param>
        /// <param name="destinationDataSet">Таблица, в которую добавляется элемент</param>
        public virtual void AddAircraftToDataset(Aircraft aircraft, DirectiveListReportDataSet destinationDataSet)
        {
            DirectiveListReportDataSet.OperatorTableRow operatorId = destinationDataSet.OperatorTable.FindByOperatorID(aircraft.Parent.ID);
            string model                 = aircraft.Model;
            string serialNumber          = aircraft.SerialNumber;
            string manufactureDate       = aircraft.ManufactureDate.ToString("MMM dd, yyyy");
            string SinceNewHours         = lifelengthFormatter.GetHoursData(aircraft.Limitation.ResourceSinceNew.Hours).Trim();
            string sinceNewCycles        = aircraft.Limitation.ResourceSinceNew.Cycles.ToString().Trim();
            string sinceNewCalendar      = lifelengthFormatter.GetCalendarData(aircraft.Limitation.ResourceSinceNew.Calendar).Trim();
            string SinceOverhaulHours    = lifelengthFormatter.GetHoursData(aircraft.Limitation.ResourceSinceOverhaul.Hours).Trim();
            string sinceOverhaulCycles   = aircraft.Limitation.ResourceSinceOverhaul.Cycles.ToString().Trim();
            string sinceOverhaulCalendar = lifelengthFormatter.GetCalendarData(aircraft.Limitation.ResourceSinceOverhaul.Calendar).Trim();
            string registrationNumber    = aircraft.RegistrationNumber;
            string lineNumber            = "-";
            string variableNumber        = "-";

            if (aircraft is WestAircraft)
            {
                lineNumber     = ((WestAircraft)aircraft).LineNumber;
                variableNumber = ((WestAircraft)aircraft).VariableNumber;
            }
            destinationDataSet.BaseDetailTable.AddBaseDetailTableRow(operatorId, aircraft.ID, serialNumber,
                                                                     manufactureDate, model, SinceNewHours, sinceNewCycles, sinceNewCalendar, SinceOverhaulHours, sinceOverhaulCycles, sinceOverhaulCalendar, registrationNumber, lineNumber, variableNumber);
        }