Putilin P. A. Lab work 1 Hard #10
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user