示例#1
0
        private void btAdicionar_Click(object sender, EventArgs e)
        {
            FormAddOpcionais form = new FormAddOpcionais();

            form.ShowDialog();
            opcional.Create(form.Op);
            AtualizaDGV();
        }
示例#2
0
 private void btViewMode_Click(object sender, EventArgs e)
 {
     if (dgvPesquisar.CurrentRow != null)
     {
         int key = int.Parse(dgvAdicionados.CurrentRow.Cells[0].Value.ToString());
         FormAddOpcionais form = new FormAddOpcionais(opcional.Read(key), false);
         form.ShowDialog(this);
     }
     else
     {
         MessageBox.Show("Selecione uma linha para visualizar!", "Ops...", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
示例#3
0
 private void btEditar_Click(object sender, EventArgs e)
 {
     if (dgvPesquisar.CurrentRow != null)
     {
         int key = int.Parse(dgvPesquisar.CurrentRow.Cells[0].Value.ToString());
         FormAddOpcionais form = new FormAddOpcionais(opcional.Read(key), true);
         form.ShowDialog(this);
         opcional.Update(form.Op);
         AtualizaDGV();
     }
     else
     {
         MessageBox.Show("Selecione uma linha para editar!", "Ops...", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }