ProductEditForm.Designer.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace TradeApp.WinForms.V08;
  4. partial class ProductEditForm
  5. {
  6. private System.ComponentModel.IContainer components = null;
  7. private TableLayoutPanel rootLayout;
  8. private TextBox articleTextBox;
  9. private TextBox nameTextBox;
  10. private ComboBox unitComboBox;
  11. private NumericUpDown priceNumeric;
  12. private ComboBox supplierComboBox;
  13. private ComboBox manufacturerComboBox;
  14. private ComboBox categoryComboBox;
  15. private NumericUpDown discountNumeric;
  16. private NumericUpDown stockNumeric;
  17. private TextBox descriptionTextBox;
  18. private TextBox imageTextBox;
  19. private Button chooseImageButton;
  20. private Button saveButton;
  21. private Button cancelButton;
  22. protected override void Dispose(bool disposing)
  23. {
  24. if (disposing && (components is not null))
  25. {
  26. components.Dispose();
  27. }
  28. base.Dispose(disposing);
  29. }
  30. private void InitializeComponent()
  31. {
  32. rootLayout = new TableLayoutPanel();
  33. articleTextBox = new TextBox();
  34. nameTextBox = new TextBox();
  35. unitComboBox = new ComboBox();
  36. priceNumeric = new NumericUpDown();
  37. supplierComboBox = new ComboBox();
  38. manufacturerComboBox = new ComboBox();
  39. categoryComboBox = new ComboBox();
  40. discountNumeric = new NumericUpDown();
  41. stockNumeric = new NumericUpDown();
  42. descriptionTextBox = new TextBox();
  43. imageTextBox = new TextBox();
  44. chooseImageButton = new Button();
  45. saveButton = new Button();
  46. cancelButton = new Button();
  47. var imagePanel = new FlowLayoutPanel();
  48. var commandPanel = new FlowLayoutPanel();
  49. rootLayout.SuspendLayout();
  50. imagePanel.SuspendLayout();
  51. commandPanel.SuspendLayout();
  52. ((System.ComponentModel.ISupportInitialize)priceNumeric).BeginInit();
  53. ((System.ComponentModel.ISupportInitialize)discountNumeric).BeginInit();
  54. ((System.ComponentModel.ISupportInitialize)stockNumeric).BeginInit();
  55. SuspendLayout();
  56. rootLayout.ColumnCount = 2;
  57. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 170F));
  58. rootLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  59. rootLayout.Dock = DockStyle.Fill;
  60. rootLayout.Padding = new Padding(16);
  61. rootLayout.RowCount = 12;
  62. for (var i = 0; i < 9; i++)
  63. {
  64. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 40F));
  65. }
  66. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 96F));
  67. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 44F));
  68. rootLayout.RowStyles.Add(new RowStyle(SizeType.Absolute, 52F));
  69. AddRow(rootLayout, 0, "Артикул", articleTextBox);
  70. AddRow(rootLayout, 1, "Название", nameTextBox);
  71. AddRow(rootLayout, 2, "Ед. измерения", unitComboBox);
  72. AddRow(rootLayout, 3, "Цена", priceNumeric);
  73. AddRow(rootLayout, 4, "Поставщик", supplierComboBox);
  74. AddRow(rootLayout, 5, "Производитель", manufacturerComboBox);
  75. AddRow(rootLayout, 6, "Категория", categoryComboBox);
  76. AddRow(rootLayout, 7, "Скидка", discountNumeric);
  77. AddRow(rootLayout, 8, "Остаток", stockNumeric);
  78. AddRow(rootLayout, 9, "Описание", descriptionTextBox);
  79. AddRow(rootLayout, 10, "Фото", imagePanel);
  80. rootLayout.Controls.Add(commandPanel, 1, 11);
  81. foreach (Control control in new Control[] { articleTextBox, nameTextBox, unitComboBox, supplierComboBox, manufacturerComboBox, categoryComboBox })
  82. {
  83. control.Anchor = AnchorStyles.Left | AnchorStyles.Right;
  84. }
  85. priceNumeric.DecimalPlaces = 2;
  86. priceNumeric.Maximum = 1000000;
  87. priceNumeric.Width = 180;
  88. discountNumeric.DecimalPlaces = 2;
  89. discountNumeric.Maximum = 100;
  90. discountNumeric.Width = 180;
  91. stockNumeric.Maximum = 1000000;
  92. stockNumeric.Width = 180;
  93. descriptionTextBox.Dock = DockStyle.Fill;
  94. descriptionTextBox.Multiline = true;
  95. descriptionTextBox.ScrollBars = ScrollBars.Vertical;
  96. imagePanel.Controls.Add(imageTextBox);
  97. imagePanel.Controls.Add(chooseImageButton);
  98. imagePanel.Dock = DockStyle.Fill;
  99. imagePanel.WrapContents = false;
  100. imageTextBox.Size = new Size(250, 27);
  101. chooseImageButton.Size = new Size(132, 32);
  102. chooseImageButton.Text = "Выбрать";
  103. chooseImageButton.Click += ChooseImageButton_Click;
  104. commandPanel.Controls.Add(saveButton);
  105. commandPanel.Controls.Add(cancelButton);
  106. commandPanel.Dock = DockStyle.Fill;
  107. commandPanel.FlowDirection = FlowDirection.RightToLeft;
  108. saveButton.Size = new Size(115, 34);
  109. saveButton.Text = "Сохранить";
  110. saveButton.Click += SaveButton_Click;
  111. cancelButton.DialogResult = DialogResult.Cancel;
  112. cancelButton.Size = new Size(115, 34);
  113. cancelButton.Text = "Отмена";
  114. AcceptButton = saveButton;
  115. AutoScaleDimensions = new SizeF(8F, 20F);
  116. AutoScaleMode = AutoScaleMode.Font;
  117. CancelButton = cancelButton;
  118. ClientSize = new Size(620, 588);
  119. Controls.Add(rootLayout);
  120. FormBorderStyle = FormBorderStyle.FixedDialog;
  121. MaximizeBox = false;
  122. MinimizeBox = false;
  123. StartPosition = FormStartPosition.CenterParent;
  124. Text = "Товар";
  125. rootLayout.ResumeLayout(false);
  126. rootLayout.PerformLayout();
  127. imagePanel.ResumeLayout(false);
  128. imagePanel.PerformLayout();
  129. commandPanel.ResumeLayout(false);
  130. ((System.ComponentModel.ISupportInitialize)priceNumeric).EndInit();
  131. ((System.ComponentModel.ISupportInitialize)discountNumeric).EndInit();
  132. ((System.ComponentModel.ISupportInitialize)stockNumeric).EndInit();
  133. ResumeLayout(false);
  134. }
  135. private static void AddRow(TableLayoutPanel table, int row, string text, Control control)
  136. {
  137. var label = new Label { Dock = DockStyle.Fill, Text = text, TextAlign = ContentAlignment.MiddleLeft };
  138. control.Dock = DockStyle.Fill;
  139. table.Controls.Add(label, 0, row);
  140. table.Controls.Add(control, 1, row);
  141. }
  142. }