| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- using System.Drawing;
- using System.Windows.Forms;
- namespace TradeApp.WinForms.V08;
- partial class OrderEditForm
- {
- private System.ComponentModel.IContainer components = null;
- private TableLayoutPanel rootLayout;
- private ComboBox articleComboBox;
- private NumericUpDown quantityNumeric;
- private ComboBox statusComboBox;
- private ComboBox customerComboBox;
- private ComboBox pickupPointComboBox;
- private DateTimePicker orderDatePicker;
- private DateTimePicker deliveryDatePicker;
- private TextBox receiveCodeTextBox;
- private Button saveButton;
- private Button cancelButton;
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components is not null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- rootLayout = new TableLayoutPanel();
- articleComboBox = new ComboBox();
- quantityNumeric = new NumericUpDown();
- statusComboBox = new ComboBox();
- pickupPointComboBox = new ComboBox();
- orderDatePicker = new DateTimePicker();
- deliveryDatePicker = new DateTimePicker();
- receiveCodeTextBox = new TextBox();
- saveButton = new Button();
- cancelButton = new Button();
- var commandPanel = new FlowLayoutPanel();
- rootLayout.SuspendLayout();
- commandPanel.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)quantityNumeric).BeginInit();
- SuspendLayout();
- rootLayout.ColumnCount = 2;
- rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 170F));
- rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
- rootLayout.Dock = DockStyle.Fill;
- rootLayout.Padding = new Padding(16);
- rootLayout.RowCount = 9;
- for (var i = 0; i < 8; i++)
- {
- rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
- }
- rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
- AddRow(rootLayout, 0, "Артикул", articleComboBox);
- AddRow(rootLayout, 1, "Количество", quantityNumeric);
- AddRow(rootLayout, 2, "Статус", statusComboBox);
- AddRow(rootLayout, 3, "Клиент", customerComboBox);
- AddRow(rootLayout, 4, "Пункт выдачи", pickupPointComboBox);
- AddRow(rootLayout, 5, "Дата заказа", orderDatePicker);
- AddRow(rootLayout, 6, "Дата выдачи", deliveryDatePicker);
- AddRow(rootLayout, 7, "Код получения", receiveCodeTextBox);
- rootLayout.Controls.Add(commandPanel, 1, 8);
- articleComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
- customerComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
- pickupPointComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
- quantityNumeric.Minimum = 1;
- quantityNumeric.Maximum = 100000;
- quantityNumeric.Value = 1;
- quantityNumeric.Width = 180;
- orderDatePicker.Format = DateTimePickerFormat.Short;
- orderDatePicker.ShowCheckBox = true;
- orderDatePicker.Width = 180;
- deliveryDatePicker.Format = DateTimePickerFormat.Short;
- deliveryDatePicker.ShowCheckBox = true;
- deliveryDatePicker.Width = 180;
- commandPanel.Controls.Add(saveButton);
- commandPanel.Controls.Add(cancelButton);
- commandPanel.Dock = DockStyle.Fill;
- commandPanel.FlowDirection = FlowDirection.RightToLeft;
- saveButton.Size = new Size(115, 34);
- saveButton.Text = "Сохранить";
- saveButton.Click += SaveButton_Click;
- cancelButton.DialogResult = DialogResult.Cancel;
- cancelButton.Size = new Size(115, 34);
- cancelButton.Text = "Отмена";
- AcceptButton = saveButton;
- AutoScaleDimensions = new SizeF(8F, 20F);
- AutoScaleMode = AutoScaleMode.Font;
- CancelButton = cancelButton;
- ClientSize = new Size(620, 396);
- Controls.Add(rootLayout);
- FormBorderStyle = FormBorderStyle.FixedDialog;
- MaximizeBox = false;
- MinimizeBox = false;
- StartPosition = FormStartPosition.CenterParent;
- Text = "Заказ";
- rootLayout.ResumeLayout(false);
- rootLayout.PerformLayout();
- commandPanel.ResumeLayout(false);
- ((System.ComponentModel.ISupportInitialize)quantityNumeric).EndInit();
- ResumeLayout(false);
- }
- private static void AddRow(TableLayoutPanel table, int row, string text, Control control)
- {
- var label = new Label { Dock = DockStyle.Fill, Text = text, TextAlign = ContentAlignment.MiddleLeft };
- control.Dock = DockStyle.Fill;
- table.Controls.Add(label, 0, row);
- table.Controls.Add(control, 1, row);
- }
- }
|