Example #1
0
        public void Tabela_Clicada(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = sender as DataGridView;

            try
            {
                if (e.ColumnIndex == 1 && e.RowIndex != -1)
                {
                    var      idDentista = dgv.Rows[e.RowIndex].Cells[0].Value;
                    Dentista d          = servicoDentista.Buscar(Convert.ToInt32(idDentista));
                    //Dentista d = new Dentista { Id = Convert.ToInt32(idDentista), Nome = " joao", Email = "*****@*****.**", CRO = "60135-410" };
                    var Form = new Vizualizar.FrmVizualizarDentista(d);
                    Form.ShowDialog();
                    if (Form.status == "apagado")
                    {
                        this.Close();
                        FrmDentistas form = new FrmDentistas();
                        form.Show();
                    }
                    if (Form.status == "editado")
                    {
                        dgv.Rows.RemoveAt(e.RowIndex);
                        GerarLinha(dgv, d);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ocorreu um erro, favor entrar em contato com o adminstrador do sistema" + ex, "Ops!");
            }
        }
Example #2
0
 private void dentistasToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     Agenda.FrmDentistas form = new Agenda.FrmDentistas();
     form.Show();
 }