public ViewNewConsignment(Model.NewConsignment newConsignment) { InitializeComponent(); this.newConsignment = newConsignment; }
private void btnConsignment1_Click(object sender, EventArgs e) { if (Form == "Mapa") { ViewNewConsignment viewNewConsignment = new ViewNewConsignment(NewConsignment = Main.sQLFunction.SearchConsignment((Button)sender)); viewNewConsignment.ShowDialog(); } if (Form == "Refregerator") { switch (GetNameButton((Button)sender)) { case "btnConsignment1": { refrigerator.Storey = 1; break; } case "btnConsignment2": { refrigerator.Storey = 2; break; } case "btnConsignment3": { refrigerator.Storey = 3; break; } case "btnConsignment4": { refrigerator.Storey = 4; break; } case "btnConsignment5": { refrigerator.Storey = 5; break; } case "btnConsignment6": { refrigerator.Storey = 6; break; } } Refrigerator.refrigeratorClass = refrigerator; Close(); } if (Form == "Weight") { switch (GetNameButton((Button)sender)) { case "btnConsignment1": { refrigerator.Storey = 1; refrigerator.CodeNumber = btnConsignment1.Text; break; } case "btnConsignment2": { refrigerator.Storey = 2; refrigerator.CodeNumber = btnConsignment2.Text; break; } case "btnConsignment3": { refrigerator.Storey = 3; refrigerator.CodeNumber = btnConsignment3.Text; break; } case "btnConsignment4": { refrigerator.Storey = 4; refrigerator.CodeNumber = btnConsignment4.Text; break; } case "btnConsignment5": { refrigerator.Storey = 5; refrigerator.CodeNumber = btnConsignment5.Text; break; } case "btnConsignment6": { refrigerator.Storey = 6; refrigerator.CodeNumber = btnConsignment6.Text; break; } } MessageBox.Show("Camera:" + refrigerator.Camera + "\n" + "Column:" + refrigerator.Column + "\n" + "Rows:" + refrigerator.Rows + "\n" + "Storey:" + refrigerator.Storey + "\n" + "Code:" + refrigerator.CodeNumber); Control_Weighing.control_Weighing.CodeNumber = refrigerator.CodeNumber; Control_Weighing.AddRecord(); Close(); } if (Form == "Sell") { switch (GetNameButton((Button)sender)) { case "btnConsignment1": { refrigerator.Storey = 1; refrigerator.CodeNumber = btnConsignment1.Text; break; } case "btnConsignment2": { refrigerator.Storey = 2; refrigerator.CodeNumber = btnConsignment2.Text; break; } case "btnConsignment3": { refrigerator.Storey = 3; refrigerator.CodeNumber = btnConsignment3.Text; break; } case "btnConsignment4": { refrigerator.Storey = 4; refrigerator.CodeNumber = btnConsignment4.Text; break; } case "btnConsignment5": { refrigerator.Storey = 5; refrigerator.CodeNumber = btnConsignment5.Text; break; } case "btnConsignment6": { refrigerator.Storey = 6; refrigerator.CodeNumber = btnConsignment6.Text; break; } } Main.sQLFunction.LoadDataConsignmentInCell(refrigerator, ref sell); Sell.SellClass = sell; Sell.refrigeratorClass = refrigerator; Sell.AddInterface(); } if (Form == "Write-Off") { switch (GetNameButton((Button)sender)) { case "btnConsignment1": { refrigerator.Storey = 1; refrigerator.CodeNumber = btnConsignment1.Text; break; } case "btnConsignment2": { refrigerator.Storey = 2; refrigerator.CodeNumber = btnConsignment2.Text; break; } case "btnConsignment3": { refrigerator.Storey = 3; refrigerator.CodeNumber = btnConsignment3.Text; break; } case "btnConsignment4": { refrigerator.Storey = 4; refrigerator.CodeNumber = btnConsignment4.Text; break; } case "btnConsignment5": { refrigerator.Storey = 5; refrigerator.CodeNumber = btnConsignment5.Text; break; } case "btnConsignment6": { refrigerator.Storey = 6; refrigerator.CodeNumber = btnConsignment6.Text; break; } } Main.sQLFunction.LoadDataConsignmentInCell(refrigerator, ref WriteOffClass); WriteOff.WriteOffClass = WriteOffClass; WriteOff.NewConsignment = Main.sQLFunction.SearchConsignment((Button)sender); WriteOff.refrigeratorClass = refrigerator; WriteOff.AddInterface(); } }