OrderEditForm.Designer.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace ToyStoreApp;
  4. partial class OrderEditForm
  5. {
  6. private System.ComponentModel.IContainer components = null;
  7. private TableLayoutPanel rootLayout;
  8. private ComboBox articleComboBox;
  9. private NumericUpDown quantityNumeric;
  10. private ComboBox statusComboBox;
  11. private ComboBox customerComboBox;
  12. private ComboBox pickupPointComboBox;
  13. private DateTimePicker orderDatePicker;
  14. private DateTimePicker deliveryDatePicker;
  15. private TextBox receiveCodeTextBox;
  16. private Button saveButton;
  17. private Button cancelButton;
  18. protected override void Dispose(bool disposing)
  19. {
  20. if (disposing && (components is not null))
  21. {
  22. components.Dispose();
  23. }
  24. base.Dispose(disposing);
  25. }
  26. private void InitializeComponent()
  27. {
  28. rootLayout = new TableLayoutPanel();
  29. articleComboBox = new ComboBox();
  30. quantityNumeric = new NumericUpDown();
  31. statusComboBox = new ComboBox();
  32. pickupPointComboBox = new ComboBox();
  33. orderDatePicker = new DateTimePicker();
  34. deliveryDatePicker = new DateTimePicker();
  35. receiveCodeTextBox = new TextBox();
  36. saveButton = new Button();
  37. cancelButton = new Button();
  38. var commandPanel = new FlowLayoutPanel();
  39. rootLayout.SuspendLayout();
  40. commandPanel.SuspendLayout();
  41. ((System.ComponentModel.ISupportInitialize)quantityNumeric).BeginInit();
  42. SuspendLayout();
  43. rootLayout.ColumnCount = 2;
  44. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 170F));
  45. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  46. rootLayout.Dock = DockStyle.Fill;
  47. rootLayout.Padding = new Padding(16);
  48. rootLayout.RowCount = 9;
  49. for (var i = 0; i < 8; i++)
  50. {
  51. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 42F));
  52. }
  53. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 54F));
  54. AddRow(rootLayout, 0, "Артикул", articleComboBox);
  55. AddRow(rootLayout, 1, "Количество", quantityNumeric);
  56. AddRow(rootLayout, 2, "Статус", statusComboBox);
  57. AddRow(rootLayout, 3, "Клиент", customerComboBox);
  58. AddRow(rootLayout, 4, "Пункт выдачи", pickupPointComboBox);
  59. AddRow(rootLayout, 5, "Дата заказа", orderDatePicker);
  60. AddRow(rootLayout, 6, "Дата выдачи", deliveryDatePicker);
  61. AddRow(rootLayout, 7, "Код получения", receiveCodeTextBox);
  62. rootLayout.Controls.Add(commandPanel, 1, 8);
  63. articleComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  64. customerComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  65. pickupPointComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  66. quantityNumeric.Minimum = 1;
  67. quantityNumeric.Maximum = 100000;
  68. quantityNumeric.Value = 1;
  69. quantityNumeric.Width = 180;
  70. orderDatePicker.Format = DateTimePickerFormat.Short;
  71. orderDatePicker.ShowCheckBox = true;
  72. orderDatePicker.Width = 180;
  73. deliveryDatePicker.Format = DateTimePickerFormat.Short;
  74. deliveryDatePicker.ShowCheckBox = true;
  75. deliveryDatePicker.Width = 180;
  76. commandPanel.Controls.Add(saveButton);
  77. commandPanel.Controls.Add(cancelButton);
  78. commandPanel.Dock = DockStyle.Fill;
  79. commandPanel.FlowDirection = FlowDirection.RightToLeft;
  80. saveButton.Size = new Size(115, 34);
  81. saveButton.Text = "Сохранить";
  82. saveButton.Click += SaveButton_Click;
  83. cancelButton.DialogResult = DialogResult.Cancel;
  84. cancelButton.Size = new Size(115, 34);
  85. cancelButton.Text = "Отмена";
  86. AcceptButton = saveButton;
  87. AutoScaleDimensions = new SizeF(8F, 20F);
  88. AutoScaleMode = AutoScaleMode.Font;
  89. CancelButton = cancelButton;
  90. ClientSize = new Size(620, 396);
  91. Controls.Add(rootLayout);
  92. FormBorderStyle = FormBorderStyle.FixedDialog;
  93. MaximizeBox = false;
  94. MinimizeBox = false;
  95. StartPosition = FormStartPosition.CenterParent;
  96. Text = "Заказ";
  97. rootLayout.ResumeLayout(false);
  98. rootLayout.PerformLayout();
  99. commandPanel.ResumeLayout(false);
  100. ((System.ComponentModel.ISupportInitialize)quantityNumeric).EndInit();
  101. ResumeLayout(false);
  102. }
  103. private static void AddRow(TableLayoutPanel table, int row, string text, Control control)
  104. {
  105. var label = new Label { Dock = DockStyle.Fill, Text = text, TextAlign = ContentAlignment.MiddleLeft };
  106. control.Dock = DockStyle.Fill;
  107. table.Controls.Add(label, 0, row);
  108. table.Controls.Add(control, 1, row);
  109. }
  110. }