private void alterarBt_Click(object sender, EventArgs e) { DAO.OrigemDAO oDAO = new DAO.OrigemDAO(); DAO.UsuarioDAO uDAO = new DAO.UsuarioDAO(); DataGridViewRow row = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex]; int idCelula = Int16.Parse(row.Cells[0].Value.ToString()); string valor = row.Cells[2].Value.ToString(); int origem = Int16.Parse(row.Cells[3].Value.ToString()); string descr = row.Cells[5].Value.ToString(); int resp = Int16.Parse(row.Cells[6].Value.ToString()); string nota = row.Cells[7].Value.ToString(); clear(); id = idCelula; depositTb.Text = valor; origemDp.SelectedText = oDAO.NomeOrigem(origem); descripTb.Text = descr; respDp.SelectedText = uDAO.NomeColaborador(resp); notaTb.Text = nota; switchAlterar(); }
private void alterarBt_Click(object sender, EventArgs e) { DAO.UsuarioDAO uDAO = new DAO.UsuarioDAO(); DataGridViewRow row = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex]; int idCelula = Int16.Parse(row.Cells[0].Value.ToString()); string valor = row.Cells[2].Value.ToString(); string tipo = row.Cells[4].Value.ToString(); string descr = row.Cells[5].Value.ToString(); int resp = Int16.Parse(row.Cells[6].Value.ToString()); string nota = row.Cells[7].Value.ToString(); clear(); id = idCelula; saqueTb.Text = Convert.ToString(Convert.ToDouble(valor) * -1); tipoDp.SelectedItem = tipo; respDp.SelectedText = uDAO.NomeColaborador(resp); notaTb.Text = nota; descripTb.Text = descr; switchAlterar(); }