コード例 #1
0
ファイル: Historial.cs プロジェクト: rober81/KineApp
 private void Historial_Load(object sender, EventArgs e)
 {
     //Estilo.Buscar(btnBuscar);
     //this.AcceptButton = this.btnBuscar;
     gp            = new GestionarPaciente();
     listaPaciente = gp.Listar();
     ActualizarLista(listaPaciente);
 }
コード例 #2
0
ファイル: AbmPaciente.cs プロジェクト: rober81/KineApp
 private void AbmPaciente_Load(object sender, EventArgs e)
 {
     gestor = new GestionarPaciente();
     Estilo.Guardar(btnAceptar);
     Estilo.Cancelar(btnCancelar);
     btnAceptar.DialogResult  = DialogResult.OK;
     btnCancelar.DialogResult = DialogResult.Cancel;
     this.AcceptButton        = this.btnAceptar;
     Actualizar();
     dtFecha.MaxDate = DateTime.Now;
 }
コード例 #3
0
ファイル: ConsultarPaciente.cs プロジェクト: rober81/KineApp
 private void ConsultarPaciente_Load(object sender, EventArgs e)
 {
     Estilo.Nuevo(btnNuevo);
     Estilo.Guardar(btnAceptar);
     Estilo.Cancelar(btnCancelar);
     Estilo.Modificar(btnModificar);
     btnAceptar.DialogResult  = DialogResult.OK;
     btnCancelar.DialogResult = DialogResult.Cancel;
     gestor = new GestionarPaciente();
     ActualizarLista(gestor.Listar());
     if (this.Owner != null)
     {
         btnModificar.Visible = false;
         btnNuevo.Visible     = false;
     }
 }
コード例 #4
0
ファイル: AbmPaciente.cs プロジェクト: rober81/KineApp
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            int respuesta;

            if (Seleccionado == null)
            {
                Seleccionado = new Paciente();
            }
            try
            {
                if (this.ValidarTextbox())
                {
                    Seleccionado.Dni             = int.Parse(txtDni.Text.Trim());
                    Seleccionado.Nombre          = txtNombre.Text.Trim();
                    Seleccionado.Apellido        = txtApellido.Text.Trim();
                    Seleccionado.FechaNacimiento = dtFecha.Value;

                    Paciente existe = GestionarPaciente.Buscar(Seleccionado);
                    if (existe == null)
                    {
                        respuesta = gestor.Insertar(Seleccionado);
                    }
                    else
                    {
                        respuesta = gestor.Modificar(Seleccionado);
                    }
                    if (respuesta == 0)
                    {
                        Mensaje("msgErrorAlta", "msgError");
                    }
                    else
                    {
                        Mensaje("msgOperacionOk");
                        this.Close();
                    }
                }
                else
                {
                    this.DialogResult = DialogResult.None;
                }
            }
            catch (Exception ex)
            {
                GestionarError.loguear(ex.ToString());
                Mensaje("errorDatoMal", "msgFaltaCompletarTitulo");
            }
        }