ProductListForm.Designer.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. using System.Drawing;
  2. using System.Windows.Forms;
  3. namespace ToyStoreApp;
  4. partial class ProductListForm
  5. {
  6. private System.ComponentModel.IContainer components = null;
  7. private TableLayoutPanel RootBindingPanel;
  8. private TableLayoutPanel topLayout;
  9. private FlowLayoutPanel ToolbarBindingPanel;
  10. private Label userInfoLabel;
  11. private Label searchLabel;
  12. private ComboBox searchFieldComboBox;
  13. private TextBox searchTextBox;
  14. private Label supplierLabel;
  15. private ComboBox supplierComboBox;
  16. private Label sortLabel;
  17. private ComboBox sortComboBox;
  18. private Button addButton;
  19. private Button editButton;
  20. private Button deleteButton;
  21. private Button ordersButton;
  22. private Button exitButton;
  23. private DataGridView ProductsBindingGrid;
  24. private StatusStrip statusStrip;
  25. private ToolStripStatusLabel countStatusLabel;
  26. protected override void Dispose(bool disposing)
  27. {
  28. if (disposing && (components is not null))
  29. {
  30. components.Dispose();
  31. }
  32. base.Dispose(disposing);
  33. }
  34. private void InitializeComponent()
  35. {
  36. RootBindingPanel = new TableLayoutPanel();
  37. topLayout = new TableLayoutPanel();
  38. ToolbarBindingPanel = new FlowLayoutPanel();
  39. userInfoLabel = new Label();
  40. searchLabel = new Label();
  41. searchFieldComboBox = new ComboBox();
  42. searchTextBox = new TextBox();
  43. supplierLabel = new Label();
  44. supplierComboBox = new ComboBox();
  45. sortLabel = new Label();
  46. sortComboBox = new ComboBox();
  47. addButton = new Button();
  48. editButton = new Button();
  49. deleteButton = new Button();
  50. ordersButton = new Button();
  51. exitButton = new Button();
  52. ProductsBindingGrid = new DataGridView();
  53. statusStrip = new StatusStrip();
  54. countStatusLabel = new ToolStripStatusLabel();
  55. var articleColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Article", HeaderText = "Артикул", MinimumWidth = 80, Name = "articleColumn", ReadOnly = true };
  56. var nameColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Name", FillWeight = 150F, HeaderText = "Название", MinimumWidth = 160, Name = "nameColumn", ReadOnly = true };
  57. var categoryColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Category", HeaderText = "Категория", MinimumWidth = 120, Name = "categoryColumn", ReadOnly = true };
  58. var manufacturerColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Manufacturer", HeaderText = "Производитель", MinimumWidth = 120, Name = "manufacturerColumn", ReadOnly = true };
  59. var supplierColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Supplier", HeaderText = "Поставщик", MinimumWidth = 120, Name = "supplierColumn", ReadOnly = true };
  60. var priceColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Price", HeaderText = "Цена", MinimumWidth = 80, Name = "priceColumn", ReadOnly = true };
  61. var discountColumn = new DataGridViewTextBoxColumn { DataPropertyName = "DiscountPercent", HeaderText = "Скидка", MinimumWidth = 80, Name = "discountColumn", ReadOnly = true };
  62. var finalPriceColumn = new DataGridViewTextBoxColumn { DataPropertyName = "FinalPrice", HeaderText = "Цена со скидкой", MinimumWidth = 110, Name = "finalPriceColumn", ReadOnly = true };
  63. var stockColumn = new DataGridViewTextBoxColumn { DataPropertyName = "StockQuantity", HeaderText = "Остаток", MinimumWidth = 80, Name = "stockColumn", ReadOnly = true };
  64. RootBindingPanel.SuspendLayout();
  65. topLayout.SuspendLayout();
  66. ToolbarBindingPanel.SuspendLayout();
  67. ((System.ComponentModel.ISupportInitialize)ProductsBindingGrid).BeginInit();
  68. statusStrip.SuspendLayout();
  69. SuspendLayout();
  70. RootBindingPanel.ColumnCount = 1;
  71. RootBindingPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  72. RootBindingPanel.Controls.Add(topLayout, 0, 0);
  73. RootBindingPanel.Controls.Add(ProductsBindingGrid, 0, 1);
  74. RootBindingPanel.Controls.Add(statusStrip, 0, 2);
  75. RootBindingPanel.Dock = DockStyle.Fill;
  76. RootBindingPanel.RowCount = 3;
  77. RootBindingPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 86F));
  78. RootBindingPanel.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
  79. RootBindingPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 26F));
  80. topLayout.ColumnCount = 2;
  81. topLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F));
  82. topLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 300F));
  83. topLayout.Controls.Add(ToolbarBindingPanel, 0, 0);
  84. topLayout.Controls.Add(userInfoLabel, 1, 0);
  85. topLayout.Dock = DockStyle.Fill;
  86. topLayout.RowCount = 1;
  87. topLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
  88. ToolbarBindingPanel.Controls.Add(searchLabel);
  89. ToolbarBindingPanel.Controls.Add(searchFieldComboBox);
  90. ToolbarBindingPanel.Controls.Add(searchTextBox);
  91. ToolbarBindingPanel.Controls.Add(supplierLabel);
  92. ToolbarBindingPanel.Controls.Add(supplierComboBox);
  93. ToolbarBindingPanel.Controls.Add(sortLabel);
  94. ToolbarBindingPanel.Controls.Add(sortComboBox);
  95. ToolbarBindingPanel.Controls.Add(addButton);
  96. ToolbarBindingPanel.Controls.Add(editButton);
  97. ToolbarBindingPanel.Controls.Add(deleteButton);
  98. ToolbarBindingPanel.Controls.Add(ordersButton);
  99. ToolbarBindingPanel.Controls.Add(exitButton);
  100. ToolbarBindingPanel.Dock = DockStyle.Fill;
  101. ToolbarBindingPanel.Padding = new Padding(8, 7, 8, 4);
  102. ToolbarBindingPanel.WrapContents = true;
  103. userInfoLabel.Dock = DockStyle.Fill;
  104. userInfoLabel.Font = new Font("Segoe UI", 9F, FontStyle.Bold);
  105. userInfoLabel.Padding = new Padding(8, 7, 12, 4);
  106. userInfoLabel.TextAlign = ContentAlignment.MiddleRight;
  107. searchLabel.AutoSize = true;
  108. searchLabel.Margin = new Padding(3, 6, 4, 0);
  109. searchLabel.Text = "Поиск";
  110. searchFieldComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  111. searchFieldComboBox.Items.AddRange(new object[] { "Везде", "Артикул", "Наименование", "Категория", "Описание", "Производитель", "Поставщик", "Единица измерения", "Цена", "Скидка", "Цена со скидкой", "Количество на складе" });
  112. searchFieldComboBox.Size = new Size(155, 28);
  113. searchFieldComboBox.SelectedIndex = 0;
  114. searchFieldComboBox.SelectedIndexChanged += SearchFieldComboBox_SelectedIndexChanged;
  115. searchTextBox.Size = new Size(170, 27);
  116. searchTextBox.TextChanged += SearchTextBox_TextChanged;
  117. supplierLabel.AutoSize = true;
  118. supplierLabel.Margin = new Padding(4, 6, 4, 0);
  119. supplierLabel.Text = "Поставщик";
  120. supplierComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  121. supplierComboBox.Size = new Size(165, 28);
  122. supplierComboBox.SelectedIndexChanged += SupplierComboBox_SelectedIndexChanged;
  123. sortLabel.AutoSize = true;
  124. sortLabel.Margin = new Padding(4, 6, 4, 0);
  125. sortLabel.Text = "Сортировка";
  126. sortComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
  127. sortComboBox.Items.AddRange(new object[] { "Название", "Цена по возрастанию", "Цена по убыванию", "Остаток по возрастанию", "Остаток по убыванию" });
  128. sortComboBox.Size = new Size(175, 28);
  129. sortComboBox.SelectedIndex = 0;
  130. sortComboBox.SelectedIndexChanged += SortComboBox_SelectedIndexChanged;
  131. addButton.Size = new Size(96, 32);
  132. addButton.Text = "Добавить";
  133. addButton.UseVisualStyleBackColor = true;
  134. addButton.Click += AddButton_Click;
  135. editButton.Size = new Size(120, 32);
  136. editButton.Text = "Изменить";
  137. editButton.UseVisualStyleBackColor = true;
  138. editButton.Click += EditButton_Click;
  139. deleteButton.Size = new Size(96, 32);
  140. deleteButton.Text = "Удалить";
  141. deleteButton.UseVisualStyleBackColor = true;
  142. deleteButton.Click += DeleteButton_Click;
  143. ordersButton.Size = new Size(96, 32);
  144. ordersButton.Text = "Заказы";
  145. ordersButton.UseVisualStyleBackColor = true;
  146. ordersButton.Click += OrdersButton_Click;
  147. exitButton.Size = new Size(82, 32);
  148. exitButton.Text = "Выход";
  149. exitButton.UseVisualStyleBackColor = true;
  150. exitButton.Click += ExitButton_Click;
  151. ProductsBindingGrid.AllowUserToAddRows = false;
  152. ProductsBindingGrid.AllowUserToDeleteRows = false;
  153. ProductsBindingGrid.AutoGenerateColumns = false;
  154. ProductsBindingGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
  155. ProductsBindingGrid.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
  156. ProductsBindingGrid.Columns.AddRange(new DataGridViewColumn[] { articleColumn, nameColumn, categoryColumn, manufacturerColumn, supplierColumn, priceColumn, discountColumn, finalPriceColumn, stockColumn });
  157. ProductsBindingGrid.Dock = DockStyle.Fill;
  158. ProductsBindingGrid.MultiSelect = false;
  159. ProductsBindingGrid.ReadOnly = true;
  160. ProductsBindingGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
  161. ProductsBindingGrid.CellDoubleClick += ProductsGrid_CellDoubleClick;
  162. ProductsBindingGrid.RowPrePaint += ProductsGrid_RowPrePaint;
  163. statusStrip.Items.AddRange(new ToolStripItem[] { countStatusLabel });
  164. countStatusLabel.Text = "Товаров: 0";
  165. AutoScaleDimensions = new SizeF(8F, 20F);
  166. AutoScaleMode = AutoScaleMode.Font;
  167. ClientSize = new Size(1320, 760);
  168. Controls.Add(RootBindingPanel);
  169. MinimumSize = new Size(1060, 620);
  170. StartPosition = FormStartPosition.CenterScreen;
  171. Text = $"{AppearanceSettings.ProductListTitle} [V02]";
  172. BackColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  173. topLayout.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
  174. ToolbarBindingPanel.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
  175. userInfoLabel.BackColor = ColorTranslator.FromHtml(AppearanceSettings.SecondaryBackgroundColor);
  176. ProductsBindingGrid.BackgroundColor = ColorTranslator.FromHtml(AppearanceSettings.MainBackgroundColor);
  177. addButton.BackColor = ColorTranslator.FromHtml(AppearanceSettings.AccentColor);
  178. addButton.UseVisualStyleBackColor = false;
  179. Load += ProductListForm_Load;
  180. RootBindingPanel.ResumeLayout(false);
  181. RootBindingPanel.PerformLayout();
  182. topLayout.ResumeLayout(false);
  183. ToolbarBindingPanel.ResumeLayout(false);
  184. ToolbarBindingPanel.PerformLayout();
  185. ((System.ComponentModel.ISupportInitialize)ProductsBindingGrid).EndInit();
  186. statusStrip.ResumeLayout(false);
  187. statusStrip.PerformLayout();
  188. ResumeLayout(false);
  189. }
  190. }