private void btn_SelectProvider_Click(object sender, EventArgs e) { try { id_VendorBuy = Convert.ToInt32(grid_SearchVendors.SelectedRows[0].Cells[0].Value.ToString()); answer = tap.GetDataById(id_VendorBuy); frm_Buys.Provider = answer[0]; frm_Buys.lbl_Vendor.Text = "Provedor: \n" + frm_Buys.Provider.Nombre; this.Close(); } catch (Exception error) { MessageBox.Show("Ha Ocurrido el Siguiente Error: " + error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_EditProvider_Click(object sender, EventArgs e) { try { id_Vendor = Convert.ToInt32(grid_SearchVendors.SelectedRows[0].Cells[0].Value.ToString()); res = tap.GetDataById(id_Vendor); frm_EditVendor.txt_NIT.Text = res[0].Nit.ToString(); frm_EditVendor.txt_Name.Text = res[0].Nombre.ToString(); frm_EditVendor.txt_Adress.Text = res[0].Dir_Numero.ToString(); frm_EditVendor.txt_Neighborhood.Text = res[0].Dir_Barrio.ToString(); this.Close(); frm_EditVendor.Show(); } catch (Exception error) { MessageBox.Show("Ha Ocurrido el Siguiente Error: " + error, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }