private void SearchSupplierBtn_Click(object sender, EventArgs e) { OrderFindSupplier FindSupplier = new OrderFindSupplier(); FindSupplier.FormClosing += (object sender2, FormClosingEventArgs e2) => { if (FindSupplier.ReturnSupplierId() != null) { this.IdSupplierTxt.Text = FindSupplier.ReturnSupplierId(); this.NameSupplierTxt.Text = FindSupplier.ReturnSupplierName(); this.AfmSupplierTxt.Text = FindSupplier.ReturnSupplierAfm(); this.PrevDebitSupplierTxt.Text = FindSupplier.ReturnSupplierDebit(); GetDataProd(); } }; FindSupplier.FormClosed += new FormClosedEventHandler(FormClose); this.Enabled = false; FindSupplier.ShowDialog(); }
private void SearchSupplierBtn_Click(object sender, EventArgs e) { OrderFindSupplier FindSupplier = new OrderFindSupplier(); FindSupplier.FormClosing += (object sender2, FormClosingEventArgs e2) => { if (FindSupplier.ReturnSupplierId() != null) { ClearValues(); if (Convert.ToInt16(ProdItemsTxt.Text.ToString()) > 1) { ClearProds(); } this.IdSupplierTxt.Text = FindSupplier.ReturnSupplierId(); this.NameSupplierTxt.Text = FindSupplier.ReturnSupplierName(); this.AfmSupplierTxt.Text = FindSupplier.ReturnSupplierAfm(); this.PrevDebitSupplierTxt.Text = FindSupplier.ReturnSupplierDebit(); } }; FindSupplier.FormClosed += new FormClosedEventHandler(FormClose); this.Enabled = false; FindSupplier.ShowDialog(); }