private void btnConsultar_Click(object sender, EventArgs e) { Cadastro.FrmFornecedor f = new Cadastro.FrmFornecedor(); f.lblTitulo.Text = "Consultar fornecedor"; f.txtRazao.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value); f.txtNomeFant.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value); f.txtCep.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value); f.txtNumero.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value); f.txtComplemento.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value); f.ShowDialog(); }
private void btnAlterar_Click(object sender, EventArgs e) { Cadastro.FrmFornecedor f = new Cadastro.FrmFornecedor(); f.lblTitulo.Text = "Alterar fornecedor"; f.txtRazao.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[1].Value); f.txtNomeFant.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[2].Value); f.txtCep.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[3].Value); f.txtNumero.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[4].Value); f.txtComplemento.Text = Convert.ToString(dataGridView1.CurrentRow.Cells[5].Value); f.Codigo = Convert.ToInt16(dataGridView1.CurrentRow.Cells[0].Value); f.btnCadastrar.Click -= f.btnCadastrar_Click; f.btnCadastrar.Click += f.Alterar; f.btnCadastrar.Text = "Alterar"; f.ShowDialog(); CarregarDadosGrid(); }
private void button7_Click(object sender, EventArgs e) { Cadastro.FrmFornecedor c = new Cadastro.FrmFornecedor(); c.ShowDialog(); }