private void mtlDeletar_Click(object sender, EventArgs e) { try { DialogResult resp = MessageBox.Show("Deseja continuar ?", "Mensagem", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (resp == System.Windows.Forms.DialogResult.Yes) { int codigo = Convert.ToInt16(dgvAnot.CurrentRow.Cells[0].Value); taAnot.DeletarAnot(codigo); dgvAnot.DataSource = taAnot.SelectAnot(); string total = (dgvAnot.RowCount - 1).ToString(); } } catch (Exception ex) { MessageBox.Show("Erro: " + ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void frmVerAnot_Load(object sender, EventArgs e) { dgvVer.DataSource = taAnot.SelectAnot(); }
private void frmConfigurarAnot_Load(object sender, System.EventArgs e) { DataSet1TableAdapters.tb_AnotTableAdapter taAnot = new DataSet1TableAdapters.tb_AnotTableAdapter(); dgvAnot.DataSource = taAnot.SelectAnot(); // throw new System.NotImplementedException(); }