diff --git a/Typography/Typography/FormCreateOrder.Designer.cs b/Typography/Typography/FormCreateOrder.Designer.cs index ddd3e8c..cff1aac 100644 --- a/Typography/Typography/FormCreateOrder.Designer.cs +++ b/Typography/Typography/FormCreateOrder.Designer.cs @@ -124,6 +124,7 @@ Controls.Add(labelPrinted); Name = "FormCreateOrder"; Text = "Заказ"; + Load += FormCreateOrder_Load; ResumeLayout(false); PerformLayout(); } diff --git a/Typography/Typography/FormCreateOrder.cs b/Typography/Typography/FormCreateOrder.cs index 5758927..ff0fe62 100644 --- a/Typography/Typography/FormCreateOrder.cs +++ b/Typography/Typography/FormCreateOrder.cs @@ -17,18 +17,6 @@ namespace TypographyView _logicP = logicP; _logicO = logicO; } - private void FormCreateOrder_Load(object sender, EventArgs e) - { - _logger.LogInformation("Загрузка изделий для заказа"); - var _list = _logicP.ReadList(null); - if (_list != null) - { - comboBoxPrinted.DisplayMember = "PrintedName"; - comboBoxPrinted.ValueMember = "Id"; - comboBoxPrinted.DataSource = _list; - comboBoxPrinted.SelectedItem = null; - } - } private void CalcSum() { if (comboBoxPrinted.SelectedValue != null && !string.IsNullOrEmpty(textBoxCount.Text)) @@ -99,5 +87,17 @@ namespace TypographyView DialogResult = DialogResult.Cancel; Close(); } + private void FormCreateOrder_Load(object sender, EventArgs e) + { + _logger.LogInformation("Загрузка изделий для заказа"); + var _list = _logicP.ReadList(null); + if (_list != null) + { + comboBoxPrinted.DisplayMember = "PrintedName"; + comboBoxPrinted.ValueMember = "Id"; + comboBoxPrinted.DataSource = _list; + comboBoxPrinted.SelectedItem = null; + } + } } } diff --git a/Typography/Typography/FormMain.Designer.cs b/Typography/Typography/FormMain.Designer.cs index 7a0710e..12610c3 100644 --- a/Typography/Typography/FormMain.Designer.cs +++ b/Typography/Typography/FormMain.Designer.cs @@ -29,7 +29,7 @@ private void InitializeComponent() { dataGridViewOrders = new DataGridView(); - menuStrip1 = new MenuStrip(); + menuStrip = new MenuStrip(); directoriesToolStripMenuItem = new ToolStripMenuItem(); componentsToolStripMenuItem = new ToolStripMenuItem(); printedsToolStripMenuItem = new ToolStripMenuItem(); @@ -39,7 +39,7 @@ buttonIssuedOrder = new Button(); buttonRef = new Button(); ((System.ComponentModel.ISupportInitialize)dataGridViewOrders).BeginInit(); - menuStrip1.SuspendLayout(); + menuStrip.SuspendLayout(); SuspendLayout(); // // dataGridViewOrders @@ -51,18 +51,19 @@ dataGridViewOrders.RowHeadersVisible = false; dataGridViewOrders.RowHeadersWidth = 51; dataGridViewOrders.RowTemplate.Height = 29; + dataGridViewOrders.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridViewOrders.Size = new Size(1080, 424); dataGridViewOrders.TabIndex = 3; // - // menuStrip1 + // menuStrip // - menuStrip1.ImageScalingSize = new Size(20, 20); - menuStrip1.Items.AddRange(new ToolStripItem[] { directoriesToolStripMenuItem }); - menuStrip1.Location = new Point(0, 0); - menuStrip1.Name = "menuStrip1"; - menuStrip1.Size = new Size(1331, 28); - menuStrip1.TabIndex = 4; - menuStrip1.Text = "menuStrip1"; + menuStrip.ImageScalingSize = new Size(20, 20); + menuStrip.Items.AddRange(new ToolStripItem[] { directoriesToolStripMenuItem }); + menuStrip.Location = new Point(0, 0); + menuStrip.Name = "menuStrip"; + menuStrip.Size = new Size(1331, 28); + menuStrip.TabIndex = 6; + menuStrip.Text = "menuStrip"; // // directoriesToolStripMenuItem // @@ -146,13 +147,14 @@ Controls.Add(buttonTakeOrderInWork); Controls.Add(buttonCreateOrder); Controls.Add(dataGridViewOrders); - Controls.Add(menuStrip1); - MainMenuStrip = menuStrip1; + Controls.Add(menuStrip); + MainMenuStrip = menuStrip; Name = "FormMain"; Text = "Типография"; + Load += FormMain_Load; ((System.ComponentModel.ISupportInitialize)dataGridViewOrders).EndInit(); - menuStrip1.ResumeLayout(false); - menuStrip1.PerformLayout(); + menuStrip.ResumeLayout(false); + menuStrip.PerformLayout(); ResumeLayout(false); PerformLayout(); } @@ -160,7 +162,7 @@ #endregion private DataGridView dataGridViewOrders; - private MenuStrip menuStrip1; + private MenuStrip menuStrip; private ToolStripMenuItem directoriesToolStripMenuItem; private ToolStripMenuItem componentsToolStripMenuItem; private ToolStripMenuItem printedsToolStripMenuItem; diff --git a/Typography/Typography/FormMain.cs b/Typography/Typography/FormMain.cs index 5c50ebe..69420b4 100644 --- a/Typography/Typography/FormMain.cs +++ b/Typography/Typography/FormMain.cs @@ -15,10 +15,6 @@ namespace TypographyView _logger = logger; _orderLogic = orderLogic; } - private void FormMain_Load(object sender, EventArgs e) - { - LoadData(); - } private void LoadData() { try @@ -134,5 +130,9 @@ namespace TypographyView { LoadData(); } + private void FormMain_Load(object sender, EventArgs e) + { + LoadData(); + } } } diff --git a/Typography/Typography/FormMain.resx b/Typography/Typography/FormMain.resx index a0623c8..6c82d08 100644 --- a/Typography/Typography/FormMain.resx +++ b/Typography/Typography/FormMain.resx @@ -117,7 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + 17, 17 \ No newline at end of file diff --git a/Typography/Typography/FormPrinted.Designer.cs b/Typography/Typography/FormPrinted.Designer.cs index 09c609b..0122512 100644 --- a/Typography/Typography/FormPrinted.Designer.cs +++ b/Typography/Typography/FormPrinted.Designer.cs @@ -167,6 +167,7 @@ // textBoxPrice.Location = new Point(143, 49); textBoxPrice.Name = "textBoxPrice"; + textBoxPrice.ReadOnly = true; textBoxPrice.Size = new Size(214, 27); textBoxPrice.TabIndex = 4; // @@ -203,7 +204,8 @@ Controls.Add(labelName); Controls.Add(groupBoxComponents); Name = "FormPrinted"; - Text = "FormPrinted"; + Text = "Печатная продукция"; + Load += FormPrinted_Load; groupBoxComponents.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)dataGridViewComponents).EndInit(); ResumeLayout(false); diff --git a/Typography/Typography/FormPrinted.cs b/Typography/Typography/FormPrinted.cs index 9921572..deb09db 100644 --- a/Typography/Typography/FormPrinted.cs +++ b/Typography/Typography/FormPrinted.cs @@ -20,29 +20,6 @@ namespace TypographyView _logic = logic; _printedComponents = new Dictionary(); } - private void FormPrinted_Load(object sender, EventArgs e) - { - if (_id.HasValue) - { - _logger.LogInformation("Загрузка изделия"); - try - { - var view = _logic.ReadElement(new PrintedSearchModel { Id = _id.Value }); - if (view != null) - { - textBoxName.Text = view.PrintedName; - textBoxPrice.Text = view.Price.ToString(); - _printedComponents = view.PrintedComponents ?? new Dictionary(); - LoadData(); - } - } - catch (Exception ex) - { - _logger.LogError(ex, "Ошибка загрузки изделия"); - MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - } private void LoadData() { _logger.LogInformation("Загрузка компонент изделия"); @@ -195,5 +172,29 @@ namespace TypographyView DialogResult = DialogResult.Cancel; Close(); } + + private void FormPrinted_Load(object sender, EventArgs e) + { + if (_id.HasValue) + { + _logger.LogInformation("Загрузка изделия"); + try + { + var view = _logic.ReadElement(new PrintedSearchModel { Id = _id.Value }); + if (view != null) + { + textBoxName.Text = view.PrintedName; + textBoxPrice.Text = view.Price.ToString(); + _printedComponents = view.PrintedComponents ?? new Dictionary(); + LoadData(); + } + } + catch (Exception ex) + { + _logger.LogError(ex, "Ошибка загрузки изделия"); + MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } } } diff --git a/Typography/Typography/FormPrinted.resx b/Typography/Typography/FormPrinted.resx index 552902d..4a96278 100644 --- a/Typography/Typography/FormPrinted.resx +++ b/Typography/Typography/FormPrinted.resx @@ -126,13 +126,4 @@ True - - True - - - True - - - True - \ No newline at end of file diff --git a/Typography/Typography/FormPrinteds.Designer.cs b/Typography/Typography/FormPrinteds.Designer.cs index 15d9741..1e4b67d 100644 --- a/Typography/Typography/FormPrinteds.Designer.cs +++ b/Typography/Typography/FormPrinteds.Designer.cs @@ -101,6 +101,7 @@ Controls.Add(dataGridViewPrinteds); Name = "FormPrinteds"; Text = "Печатная продукция"; + Load += FormPrinteds_Load; ((System.ComponentModel.ISupportInitialize)dataGridViewPrinteds).EndInit(); ResumeLayout(false); } diff --git a/Typography/Typography/FormPrinteds.cs b/Typography/Typography/FormPrinteds.cs index 155262c..21a817c 100644 --- a/Typography/Typography/FormPrinteds.cs +++ b/Typography/Typography/FormPrinteds.cs @@ -15,10 +15,6 @@ namespace TypographyView _logger = logger; _logic = logic; } - private void FormPrinteds_Load(object sender, EventArgs e) - { - LoadData(); - } private void LoadData() { try @@ -94,5 +90,9 @@ namespace TypographyView { LoadData(); } + private void FormPrinteds_Load(object sender, EventArgs e) + { + LoadData(); + } } }