Ejemplo n.º 1
0
        private void tb_click(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dg = sender as DataGridView;

            try
            {
                if (e.ColumnIndex == 1 && e.RowIndex != -1)
                {
                    var     id  = dg.Rows[e.RowIndex].Cells[0].Value;
                    Dentist obj = service.Buscar(Convert.ToInt32(id));

                    var form = new frmEditDentist(obj);
                    form.ShowDialog();

                    if (form.status == "apagado")
                    {
                        this.Close();
                        frmConDentist frm = new frmConDentist();
                        frm.ShowDialog();
                    }
                    if (form.status == "editado")
                    {
                        dg.Rows.RemoveAt(e.RowIndex);
                        GerarLinha(dg, obj);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro ao selecionar o Dentist " + ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void btnLimpar_Click(object sender, EventArgs e)
        {
            frmConDentist frm = new frmConDentist();

            frm.ShowDialog();
        }
Ejemplo n.º 3
0
        private void menuAgDentists_Click(object sender, EventArgs e)
        {
            frmConDentist frm = new frmConDentist();

            frm.ShowDialog();
        }