Esempio n. 1
0
 private void TbCedula_LostFocus(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(tbCedula.Text))
     {
         RegistroDentista temp = Interface.ObtenerUnDentista(tbCedula.Text);
         if (temp == null)
         {
             if (DialogResult.Yes == MessageBox.Show("Dentista no registrado\n\n¿Desea registrarlo?", "AVISO", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
             {
                 PantallaAgregarDentista Pant = new PantallaAgregarDentista(ObtenerRegistroDentista);
                 Pant.ShowDialog();
                 if (Pant.AceptarCambios)
                 {
                     InitializeComponent4(Pant.ObtenerRegistroDentista);
                     btnDentista.BackgroundImage = Presentacion.Properties.Resources.IconoDentistaModificar;
                     AgregarDentista             = false;
                 }
             }
             else
             {
                 btnDentista.BackgroundImage = Presentacion.Properties.Resources.IconoDentistaAgregar;
                 AgregarDentista             = true;
             }
         }
         else
         {
             if (DialogResult.Yes == MessageBox.Show("Dentista registrado\n\n¿Desea rellenar campos faltantes?", "AVISO", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1))
             {
                 InitializeComponent4(temp);
                 btnDentista.BackgroundImage = Presentacion.Properties.Resources.IconoDentistaModificar;
             }
         }
     }
 }
Esempio n. 2
0
 private void btnDentista_Click(object sender, EventArgs e)
 {
     if (AgregarDentista)
     {
         PantallaAgregarDentista Pant = new PantallaAgregarDentista(ObtenerRegistroDentista);
         Pant.ShowDialog();
         if (Pant.AceptarCambios)
         {
             InitializeComponent4(Pant.ObtenerRegistroDentista);
             btnDentista.BackgroundImage = Presentacion.Properties.Resources.IconoDentistaModificar;
             AgregarDentista             = false;
         }
     }
     else
     {
         PantallaModificarDentista Pant = new PantallaModificarDentista(Interface.ObtenerUnDentista(tbCedula.Text));
         Pant.ShowDialog();
         if (Pant.AceptarCambios)
         {
             InitializeComponent4(Pant.ObtenerRegistroDentista);
         }
     }
 }