Beispiel #1
0
 /// <summary>
 /// Создает форму для отображения информации о <see cref="JobCard"/>
 /// </summary>
 /// <param name="detailDirective"></param>
 public MaintenanceJobCardForm(DetailDirective detailDirective)
 {
     this.detailDirective = detailDirective;
     mode           = ScreenMode.Edit;
     jobCardControl = new JobCardTabPageControl(detailDirective);
     InitializeComponent();
     UpdateInformation();
 }
        /// <summary>
        /// Возвращает работу агрегата
        /// </summary>
        /// <returns></returns>
        public DetailDirective GetDetailDirective()
        {
            DetailDirective detailDirective = new DetailDirective((DirectiveType)comboBoxWorkType.SelectedItem);

            detailDirective.Interval = lifelengthViewerInterval.Lifelength;
            detailDirective.Notify   = lifelengthViewerNotify.Lifelength;
            return(detailDirective);
        }
Beispiel #3
0
 /// <summary>
 /// Создает вкладку для привязывания Detail Directive к рабочей карте
 /// </summary>
 /// <param name="detailDirective"></param>
 public JobCardTabPageControl(DetailDirective detailDirective)
 {
     this.detailDirective = detailDirective;
     currentJobCard       = new JobCard();
     currentJobCard.Date  = DateTime.Today;
     mode = ScreenMode.Add;
     InitializeComponent();
     UpdateInformation();
 }
        private void compliancePerformanceControl_Deleted(object sender, EventArgs e)
        {
            DetailCompliancePerformanceControl control = (DetailCompliancePerformanceControl)sender;
            DetailDirective directive = control.DetailDirective;

            existPrformances.Remove(control);
            flowLayoutPanelPerformances.Controls.Remove(control);
            try
            {
                currentDetail.RemoveDetailDirective(directive);
            }
            catch (Exception ex)
            {
                Program.Provider.Logger.Log("Error while removing data", ex);
            }
        }
 /// <summary>
 /// Сохранаяет данные заданного агрегата
 /// </summary>
 /// <param name="detail">Агрегат</param>
 public bool SaveData(AbstractDetail detail)
 {
     for (int i = 0; i < existPrformances.Count; i++)
     {
         if (!existPrformances[i].SaveData())
         {
             return(false);
         }
     }
     for (int i = 0; i < addedPerformances.Count; i++)
     {
         if (addedPerformances[i].Interval != Lifelength.NullLifelength)
         {
             DetailDirective detailDirective = addedPerformances[i].GetDetailDirective();
             detail.AddDetailDirective(detailDirective);
             if (addedPerformances[i].AddActualStateRecordToDetail)
             {
                 ActualStateRecord record = new ActualStateRecord(addedPerformances[i].ComponentLastPerformance);
                 record.RecordDate = addedPerformances[i].RecordDate;
                 detail.AddRecord(record);
             }
             if (addedPerformances[i].AddActualStateRecordToAircraft)
             {
                 ActualStateRecord record = new ActualStateRecord(addedPerformances[i].AircraftLastPerformance);
                 record.RecordDate = addedPerformances[i].RecordDate;
                 if (detail is BaseDetail)
                 {
                     ((BaseDetail)detail).ParentAircraft.AddRecord(record);
                 }
                 else
                 {
                     ((Aircraft)detail.Parent.Parent).AddRecord(record);
                 }
             }
         }
     }
     if (currentDetail != null)
     {
         UpdateInformation();
     }
     return(true);
 }
 /// <summary>
 /// Создает элемент управления, использующийся для редактирования отдельной информации Compliance/Performance
 /// </summary>
 /// <param name="detailDirective">Работа агрегата</param>
 public DetailCompliancePerformanceControl(DetailDirective detailDirective)
 {
     currentDetailDirective = detailDirective;
     InitializeComponent();
     UpdateInformation();
 }