Исправлена базовая часть

This commit is contained in:
Павел Путилин 2023-04-11 20:26:48 +04:00
parent 8c8934c48c
commit 1af2ad81e8
9 changed files with 14 additions and 17 deletions

View File

@ -100,7 +100,7 @@
this.Controls.Add(this.textBoxName);
this.Controls.Add(this.labelName);
this.Name = "FormComponent";
this.Text = "FormComponent";
this.Text = "Компонент";
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -103,7 +103,7 @@
this.Controls.Add(this.buttonAdd);
this.Controls.Add(this.dataGridView);
this.Name = "FormComponents";
this.Text = "FormComponents";
this.Text = "Компоненты";
this.Load += new System.EventHandler(this.FormComponents_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -126,7 +126,7 @@
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Name = "FormCreateOrder";
this.Text = "FormCreateOrder";
this.Text = "Создать заказ";
((System.ComponentModel.ISupportInitialize)(this.textBoxCount)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -155,7 +155,7 @@
this.Controls.Add(this.buttonCreateOrder);
this.Controls.Add(this.dataGridView);
this.Name = "FormMain";
this.Text = "FormMain";
this.Text = "Заказы";
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();

View File

@ -239,7 +239,7 @@
this.Controls.Add(this.buttonSave);
this.Controls.Add(this.buttonCancel);
this.Name = "FormReinforced";
this.Text = "FormReinforced";
this.Text = "Изделие";
this.groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -101,7 +101,7 @@
this.Controls.Add(this.labelCount);
this.Controls.Add(this.labelReinforced);
this.Name = "FormReinforcedComponent";
this.Text = "FormReinforcedComponent";
this.Text = "Компонент изделия";
this.ResumeLayout(false);
this.PerformLayout();

View File

@ -103,7 +103,7 @@
this.Controls.Add(this.buttonAdd);
this.Controls.Add(this.dataGridView);
this.Name = "FormViewReinforced";
this.Text = "FormViewReinforced";
this.Text = "Изделия";
this.Load += new System.EventHandler(this.FormViewReinforced_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);

View File

@ -56,18 +56,15 @@ namespace PrecastConcretePlantView
{
if (dataGridView.SelectedRows.Count == 1)
{
var service =
Program.ServiceProvider?.GetService(typeof(FormComponent));
if (service is FormComponent form)
var service = Program.ServiceProvider?.GetService(typeof(FormReinforced));
if (service is FormReinforced form)
{
form.Id =
Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
form.Id = Convert.ToInt32(dataGridView.SelectedRows[0].Cells["Id"].Value);
if (form.ShowDialog() == DialogResult.OK)
{
LoadData();
}
}
LoadData();
}
}
private void ButtonDel_Click(object sender, EventArgs e)

View File

@ -106,11 +106,11 @@ namespace PrecastConcretePlantListImplement
private OrderViewModel GetViewModel(Order model)
{
var res = model.GetViewModel;
foreach (var pastry in _source.Reinforced)
foreach (var reinforced in _source.Reinforced)
{
if (pastry.Id == model.ReinforcedId)
if (reinforced.Id == model.ReinforcedId)
{
res.ReinforcedName = pastry.ReinforcedName;
res.ReinforcedName = reinforced.ReinforcedName;
break;
}
}