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

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.textBoxName);
this.Controls.Add(this.labelName); this.Controls.Add(this.labelName);
this.Name = "FormComponent"; this.Name = "FormComponent";
this.Text = "FormComponent"; this.Text = "Компонент";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -106,11 +106,11 @@ namespace PrecastConcretePlantListImplement
private OrderViewModel GetViewModel(Order model) private OrderViewModel GetViewModel(Order model)
{ {
var res = model.GetViewModel; 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; break;
} }
} }