private void InitializeComponent() { labelComponent = new Label(); labelDate = new Label(); labelFlightHours = new Label(); labelFlightCycles = new Label(); labelRemarks = new Label(); textBoxComponent = new TextBox(); dateTimePickerDate = new DateTimePicker(); textBoxFlightHours = new TextBox(); textBoxFlightCycles = new TextBox(); textBoxRemarks = new TextBox(); buttonOK = new Button(); buttonApply = new Button(); buttonCancel = new Button(); tabControl = new TabControl(); tabPageGeneral = new TabPage(); labelSeparator = new Label(); labelSeparator2 = new Label(); // // tabControl // tabControl.Controls.Add(tabPageGeneral); tabControl.Location = new Point(Css.WindowsForm.Constants.LEFT_MARGIN, Css.WindowsForm.Constants.TOP_MARGIN); // // tabPageGeneral // tabPageGeneral.BackColor = Css.WindowsForm.Colors.TabBackColor; tabPageGeneral.Text = "General"; tabPageGeneral.Controls.Add(labelComponent); tabPageGeneral.Controls.Add(textBoxComponent); tabPageGeneral.Controls.Add(labelSeparator); tabPageGeneral.Controls.Add(labelDate); tabPageGeneral.Controls.Add(dateTimePickerDate); tabPageGeneral.Controls.Add(labelFlightHours); tabPageGeneral.Controls.Add(textBoxFlightHours); tabPageGeneral.Controls.Add(labelFlightCycles); tabPageGeneral.Controls.Add(textBoxFlightCycles); tabPageGeneral.Controls.Add(labelSeparator2); tabPageGeneral.Controls.Add(labelRemarks); tabPageGeneral.Controls.Add(textBoxRemarks); // // labelComponent // labelComponent.Font = Css.WindowsForm.Fonts.RegularFont; labelComponent.ForeColor = Css.WindowsForm.Colors.ForeColor; labelComponent.Location = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, Css.WindowsForm.Constants.TAB_TOP_MARGIN); labelComponent.Size = Css.WindowsForm.Constants.DefaultLabelSize; labelComponent.TextAlign = ContentAlignment.MiddleLeft; // // textBoxComponent // textBoxComponent.Font = Css.WindowsForm.Fonts.RegularFont; textBoxComponent.ForeColor = Css.WindowsForm.Colors.ForeColor; textBoxComponent.Location = new Point(labelComponent.Right, Css.WindowsForm.Constants.TAB_TOP_MARGIN); textBoxComponent.ReadOnly = true; // // labelSeparator // labelSeparator.AutoSize = false; labelSeparator.Location = new Point(Css.WindowsForm.Constants.TAB_SEPARATOR_LEFT_MARGIN, textBoxComponent.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); labelSeparator.Height = 2; labelSeparator.BorderStyle = BorderStyle.Fixed3D; // // labelDate // labelDate.Font = Css.WindowsForm.Fonts.RegularFont; labelDate.ForeColor = Css.WindowsForm.Colors.ForeColor; labelDate.Location = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelSeparator.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); labelDate.Size = Css.WindowsForm.Constants.DefaultLabelSize; labelDate.Text = "Date:"; labelDate.TextAlign = ContentAlignment.MiddleLeft; // // dateTimePickerDate // dateTimePickerDate.Font = Css.WindowsForm.Fonts.RegularFont; dateTimePickerDate.ForeColor = Css.WindowsForm.Colors.ForeColor; dateTimePickerDate.BackColor = Color.White; dateTimePickerDate.Location = new Point(labelDate.Right, labelSeparator.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); dateTimePickerDate.Format = DateTimePickerFormat.Custom; dateTimePickerDate.CustomFormat = new TermsProvider()["DateFormat"].ToString(); // // labelFlightHours // labelFlightHours.Font = Css.WindowsForm.Fonts.RegularFont; labelFlightHours.ForeColor = Css.WindowsForm.Colors.ForeColor; labelFlightHours.Location = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); labelFlightHours.Size = Css.WindowsForm.Constants.DefaultLabelSize; labelFlightHours.Text = "Flight Hours:"; labelFlightHours.TextAlign = ContentAlignment.MiddleLeft; // // textBoxFlightHours // textBoxFlightHours.BackColor = Color.White; textBoxFlightHours.Font = Css.WindowsForm.Fonts.RegularFont; textBoxFlightHours.ForeColor = Css.WindowsForm.Colors.ForeColor; textBoxFlightHours.Location = new Point(labelFlightHours.Right, dateTimePickerDate.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); textBoxFlightHours.Text = "00:00"; // // labelFlightCycles // labelFlightCycles.Font = Css.WindowsForm.Fonts.RegularFont; labelFlightCycles.ForeColor = Css.WindowsForm.Colors.ForeColor; labelFlightCycles.Location = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, textBoxFlightHours.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL); labelFlightCycles.Size = Css.WindowsForm.Constants.DefaultLabelSize; labelFlightCycles.Text = "Flight Cycles:"; labelFlightCycles.TextAlign = ContentAlignment.MiddleLeft; // // textBoxFlightCycles // textBoxFlightCycles.BackColor = Color.White; textBoxFlightCycles.Font = Css.WindowsForm.Fonts.RegularFont; textBoxFlightCycles.ForeColor = Css.WindowsForm.Colors.ForeColor; textBoxFlightCycles.Location = new Point(labelFlightHours.Right, textBoxFlightHours.Bottom + Css.WindowsForm.Constants.HEIGHT_INTERVAL); textBoxFlightCycles.Text = "0"; // // labelSeparator // labelSeparator2.AutoSize = false; labelSeparator2.Location = new Point(Css.WindowsForm.Constants.TAB_SEPARATOR_LEFT_MARGIN, textBoxFlightCycles.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); labelSeparator2.Height = 2; labelSeparator2.BorderStyle = BorderStyle.Fixed3D; // // labelRemarks // labelRemarks.Font = Css.WindowsForm.Fonts.RegularFont; labelRemarks.ForeColor = Css.WindowsForm.Colors.ForeColor; labelRemarks.Size = Css.WindowsForm.Constants.DefaultLabelSize; labelRemarks.Text = "Remarks:"; labelRemarks.TextAlign = ContentAlignment.MiddleLeft; labelRemarks.Location = new Point(Css.WindowsForm.Constants.TAB_LEFT_MARGIN, labelSeparator2.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); // // textBoxRemarks // textBoxRemarks.Font = Css.WindowsForm.Fonts.RegularFont; textBoxRemarks.ForeColor = Css.WindowsForm.Colors.ForeColor; textBoxRemarks.BackColor = Color.White; textBoxRemarks.Multiline = true; textBoxRemarks.Height = Css.WindowsForm.Constants.BIG_TEXT_BOX_HEIGHT; textBoxRemarks.Location = new Point(labelFlightHours.Right, labelSeparator2.Bottom + Css.WindowsForm.Constants.SEPARATOR_INTERVAL); // // buttonOK // buttonOK.Font = Css.WindowsForm.Fonts.RegularFont; buttonOK.ForeColor = Css.WindowsForm.Colors.ForeColor; buttonOK.Size = new Size(Css.WindowsForm.Constants.BUTTON_WIDTH, Css.WindowsForm.Constants.BUTTON_HEIGHT); buttonOK.Text = "OK"; buttonOK.Click += buttonOK_Click; // // buttonApply // buttonApply.Font = Css.WindowsForm.Fonts.RegularFont; buttonApply.ForeColor = Css.WindowsForm.Colors.ForeColor; buttonApply.Size = new Size(Css.WindowsForm.Constants.BUTTON_WIDTH, Css.WindowsForm.Constants.BUTTON_HEIGHT); buttonApply.Text = "Apply"; buttonApply.Click += buttonApply_Click; // // buttonCancel // buttonCancel.Font = Css.WindowsForm.Fonts.RegularFont; buttonCancel.ForeColor = Css.WindowsForm.Colors.ForeColor; buttonCancel.Size = new Size(Css.WindowsForm.Constants.BUTTON_WIDTH, Css.WindowsForm.Constants.BUTTON_HEIGHT); buttonCancel.Text = "Cancel"; buttonCancel.Click += buttonCancel_Click; if (parentDetail != null) { Text = "SN " + parentDetail.SerialNumber + ". Actual State record"; } else { Text = "Set Actual State records"; } if (parentDetail is BaseDetail) { textBoxComponent.Text = parentDetail.ToString(); } else if (parentDetail != null) { textBoxComponent.Text = "S/N " + parentDetail.SerialNumber; } else { textBoxComponent.Text = parentDetails.Count + " items"; } if (parentDetail is AircraftFrameReal || parentDetail is AircraftFrame) { labelComponent.Text = "Aircraft:"; } else { labelComponent.Text = "Component:"; } AcceptButton = buttonOK; CancelButton = buttonCancel; FormBorderStyle = FormBorderStyle.FixedDialog; MaximizeBox = false; MinimizeBox = false; ClientSize = Css.WindowsForm.Constants.DefaultFormSize; StartPosition = FormStartPosition.CenterScreen; Controls.Add(tabControl); Controls.Add(buttonOK); Controls.Add(buttonApply); Controls.Add(buttonCancel); }
private void FillComboBoxes() { if (currentDetail != null) { if (currentDetail is BaseDetail) { textBoxComponent.Text = currentDetail.ToString(); } else { textBoxComponent.Text = "P/N " + currentDetail.PartNumber + ", S/N " + currentDetail.SerialNumber; } if (mode == MoveDetailFormMode.MoveToAircraft) { UpdateListOfAircraftsOfDetail(currentDetail); } else { UpdateListOfStoresOfDetail(currentDetail); } } else if (currentDetailsList != null && currentDetailsList.Count > 0) { if (currentDetailsList.Count == 1) { if (currentDetailsList[0] is BaseDetail) { textBoxComponent.Text = currentDetailsList[0].ToString(); } else { textBoxComponent.Text = "P/N " + currentDetailsList[0].PartNumber + ", S/N " + currentDetailsList[0].SerialNumber; } } else { textBoxComponent.Text = currentDetailsList.Count + " items"; } if (mode == MoveDetailFormMode.MoveToAircraft) { UpdateListOfAircraftsOfDetail(currentDetailsList[0]); } else { UpdateListOfStoresOfDetail(currentDetailsList[0]); } } else if (currentBaseDetailsList != null && currentBaseDetailsList.Count > 0) { if (currentBaseDetailsList.Count == 1) { textBoxComponent.Text = currentBaseDetailsList[0].ToString(); } else { textBoxComponent.Text = currentBaseDetailsList.Count + " items"; } if (mode == MoveDetailFormMode.MoveToAircraft) { UpdateListOfAircraftsOfDetail(currentBaseDetailsList[0]); } else { UpdateListOfStoresOfDetail(currentBaseDetailsList[0]); } } }