/// <summary> /// Создается форма добавления подчека /// </summary> /// <param name="directive">Maintenance Directive</param> public MaintenanceSubCheckForm(MaintenanceDirective directive) { this.directive = directive; this.view = SubCheckFormView.Add; InitializeComponent(); Initialize(); Text = ((Aircraft)directive.Parent).RegistrationNumber + ". Add subcheck"; }
/// <summary> /// Создается форма редактирования подчека /// </summary> /// <param name="subCheck"></param> public MaintenanceSubCheckForm(MaintenanceSubCheck subCheck) { this.subCheck = subCheck; view = SubCheckFormView.Edit; InitializeComponent(); Initialize(); Text = ((Aircraft)subCheck.Parent.Parent.Parent).RegistrationNumber + ". " + ((MaintenanceLimitation)subCheck.Parent).CheckType + ". " + subCheck.Name + ". Edit subcheck"; textBoxName.Text = subCheck.Name; }
/// <summary> /// Создает форму для добавления SubCheck-а в список JobCard /// </summary> public JoinSubCheckForm(MaintenanceSubCheck subCheck, SubCheckFormView view) { this.subCheck = subCheck; this.view = view; // // labelSubChecks // labelSubChecks.Font = Css.OrdinaryText.Fonts.RegularFont; labelSubChecks.ForeColor = Css.OrdinaryText.Colors.ForeColor; labelSubChecks.Location = new Point(MARGIN, MARGIN); labelSubChecks.Size = new Size(100, 25); labelSubChecks.Text = "Subchecks:"; // // comboBoxSubChecks // comboBoxSubChecks.Font = Css.OrdinaryText.Fonts.RegularFont; comboBoxSubChecks.ForeColor = Css.OrdinaryText.Colors.ForeColor; comboBoxSubChecks.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxSubChecks.Location = new Point(labelSubChecks.Right, MARGIN); comboBoxSubChecks.Size = new Size(250, 25); // // buttonOK // buttonOK.Font = Css.OrdinaryText.Fonts.RegularFont; buttonOK.ForeColor = Css.OrdinaryText.Colors.ForeColor; buttonOK.Size = new Size(100, 25); buttonOK.Text = "OK"; buttonOK.Click += buttonOK_Click; // // buttonCancel // buttonCancel.Font = Css.OrdinaryText.Fonts.RegularFont; buttonCancel.ForeColor = Css.OrdinaryText.Colors.ForeColor; buttonCancel.Size = new Size(100, 25); buttonCancel.Text = "Cancel"; buttonCancel.Click += buttonCancel_Click; AcceptButton = buttonOK; CancelButton = buttonCancel; MaximizeBox = false; MinimizeBox = false; FormBorderStyle = FormBorderStyle.FixedDialog; BackColor = Css.CommonAppearance.Colors.BackColor; if (view == SubCheckFormView.Add) { Text = subCheck.Name + ". Join subcheck"; } else if (view == SubCheckFormView.Delete) { Text = subCheck.Name + ". Cutoff subcheck"; } ClientSize = new Size(labelSubChecks.Width + comboBoxSubChecks.Width + 2 * MARGIN, comboBoxSubChecks.Height + buttonOK.Height + 2 * MARGIN + 10); buttonOK.Location = new Point((labelSubChecks.Width + comboBoxSubChecks.Width + 2 * MARGIN) / 2 - buttonOK.Width - 5, comboBoxSubChecks.Bottom + 10); buttonCancel.Location = new Point((labelSubChecks.Width + comboBoxSubChecks.Width + 2 * MARGIN) / 2 + 5, comboBoxSubChecks.Bottom + 10); Controls.Add(labelSubChecks); Controls.Add(comboBoxSubChecks); Controls.Add(buttonOK); Controls.Add(buttonCancel); FillComboBoxItems(); }