コード例 #1
0
        //Handler para Cuando se Selecciona un Boton del DataGrid
        //IMPORTANTE: Se genera haciendo doble click en el DataGrid
        private void dataGridView_resultados_filtros_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView_resultados_filtros.Columns[e.ColumnIndex].Name == nombre_boton_datagrid)
                {
                    //Hago cosas con los valores de la fila seleccionada
                    string afiliado_nombre   = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 0);
                    string afiliado_apellido = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 1);
                    hora_seleccionada = TimeSpan.Parse(
                        Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 3)
                        );
                    string profesional_nombre   = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 4);
                    string profesional_apellido = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 5);

                    id_turno    = Comunes.obtenerIntDataGrid(dataGridView_resultados_filtros, e.RowIndex, 6);
                    id_afiliado = Comunes.obtenerIntDataGrid(dataGridView_resultados_filtros, e.RowIndex, 7);
                    plan_id     = Comunes.obtenerIntDataGrid(dataGridView_resultados_filtros, e.RowIndex, 8);


                    this.label_profesional.Text = "PROF.: " + profesional_nombre + " " + profesional_apellido;
                    this.label_Afiliado.Text    = "AFILIADO: " + afiliado_nombre + " " + afiliado_apellido;
                    var bonos = Base_de_Datos.BD_Bonos.getBonos(id_afiliado);
                    ComboData.llenarCombo(combo_Bono, bonos);

                    this.combo_Bono.Enabled = true;
                    //MessageBox.Show("Seleccionado Afiliado: " + nombre + " " + apellido, "RegistrarLlegada", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                btnLimpiar_Click(null, null);
                MessageBox.Show("Error al Seleccionar: " + ex.Message, "RegistrarLlegada", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
 private void PedirTurno_Load(object sender, EventArgs e)
 {
     try
     {
         this.comboEspecialidades.DropDownStyle = ComboBoxStyle.DropDownList;
         ComboData.llenarCombo(comboEspecialidades, InteraccionDB.obtener_todas_especialidades());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Pedir Turno", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #3
0
 private void llenarHorariosHasta(ComboBox horarioComboBox, Boolean isSabado)
 {
     if (isSabado)
     {
         ComboData.llenarCombo(horarioComboBox, this.horariosSabado);
     }
     else
     {
         ComboData.llenarCombo(horarioComboBox, this.horariosComun);
     }
     horarioComboBox.Items.RemoveAt(0);
 }
コード例 #4
0
        private void AgendaMedico_Load(object sender, EventArgs e)
        {
            diasAgenda.Clear();
            especialidadCombo.Items.Clear();
            diasSemanaCombo.Items.Clear();
            horariosPorDiaList.Items.Clear();

            List <string> keyList = new List <string>(this.diasSemana.Keys);

            ComboData.llenarCombo(diasSemanaCombo, keyList);
            diasSemanaCombo.SelectedItem = diasSemanaCombo.Items[0];

            horarioDesdeCombo.Items.Clear();
            horarioHastaCombo.Items.Clear();
            this.llenarHorariosDesde(horarioDesdeCombo, false);
            this.llenarHorariosHasta(horarioHastaCombo, false);
            horarioDesdeCombo.SelectedItem = horarioDesdeCombo.Items[0];
            horarioHastaCombo.SelectedItem = horarioHastaCombo.Items[0];

            try
            {
                this.idProfesional = Base_de_Datos.BD_Profesional.obtenerID_profesional(usuario.id);
                List <string> especialidades = Base_de_Datos.BD_Profesional.getEspecialidadesProfesional(this.idProfesional);
                ComboData.llenarCombo(especialidadCombo, especialidades);
                especialidadCombo.SelectedItem = especialidadCombo.Items[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show("No se obtuvieron las especialidades del profesional. " + ex.Message, "Agenda Medico", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            DateTime maxFechaAgendaExistente = Base_de_Datos.BD_Profesional.getUltimaFechaAgenda(this.idProfesional);

            if (maxFechaAgendaExistente != null)
            {
                DateTime minDate = maxFechaAgendaExistente.AddDays(1);
                fechaDesdePicker.MinDate = minDate;
                fechaDesdePicker.Value   = minDate;
                fechaHastaPicker.MinDate = minDate;
                fechaHastaPicker.Value   = minDate;
            }
            else
            {
                DateTime tomorrow = DateTime.ParseExact(Configuracion_Global.fecha_actual, "yyyy.MM.dd", System.Globalization.CultureInfo.InvariantCulture).AddDays(1);
                fechaDesdePicker.MinDate = tomorrow;
                fechaDesdePicker.Value   = tomorrow;
                fechaHastaPicker.MinDate = tomorrow;
                fechaHastaPicker.Value   = tomorrow;
            }
        }
コード例 #5
0
 private void actualizar_turnos_cancelables()
 {
     try {
         comboCancelarTurno.Items.Clear();
         List <string> turnosCancelables = Base_de_Datos.BD_Turnos.obtener_turnos_cancelables(usuario);
         ComboData.llenarCombo(comboCancelarTurno, turnosCancelables);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Actualizar Datos: " + ex.Message, "Cancelar Turno", MessageBoxButtons.OK, MessageBoxIcon.Information);
         this.comboCancelarTurno.Enabled  = false;
         this.cancelarTurnoButton.Enabled = false;
     }
 }
コード例 #6
0
 private void RegistrarAtencion_Load(object sender, EventArgs e)
 {
     try
     {
         profesional_id             = Base_de_Datos.BD_Profesional.obtenerID_profesional(usuario_profesional.id);
         profesional_especialidades = Base_de_Datos.BD_Profesional.getEspecialidadesProfesional(profesional_id);
         ComboData.llenarCombo(comboEspecialidades, profesional_especialidades);
         this.combo_Bono.DropDownStyle          = ComboBoxStyle.DropDown;
         this.comboEspecialidades.DropDownStyle = ComboBoxStyle.DropDown;
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error al Cargar Ventana: " + ex.Message, "RegistrarLlegada", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
コード例 #7
0
        private void ModificarRol_Load(object sender, EventArgs e)
        {
            try
            {
                id_rol    = 0;
                nombreRol = null;
                funcionalidades_del_rol  = new List <string>();
                funcionalidades_posibles = InteraccionDB.obtener_todas_funcionalidades();

                var lista = BD_Roles.obtener_roles();
                ComboData.llenarCombo(this.comboBox_rol, lista);
                this.comboBox_rol.DropDownStyle = ComboBoxStyle.DropDownList;

                resetear_botones();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Cargar Ventana:" + ex.Message, "Modificar Rol", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #8
0
        private void Form1_Load(object sender, EventArgs e)
        {
            deshabilitar_componentes();
            this.AcceptButton = boton_loguear;

            Configuracion_Global.cargar_archivo_configuracion();
            label_fecha.Text = "Fecha Actual: " + Configuracion_Global.fecha_actual;

            try
            {
                var lista = BD_Roles.obtener_roles();
                ComboData.llenarCombo(this.comboBox_rol, lista);
                this.comboBox_rol.DropDownStyle = ComboBoxStyle.DropDownList;
                this.comboBox_rol.Text          = "ADMINISTRADOR GENERAL";
            }
            catch (Exception ex)
            {
                InteraccionDB.ImprimirExcepcion(ex);
                MessageBox.Show("Error al Pedir Roles contra la Base. Compruebe que la Base de Datos este Poblada. " + ex.Message, "Log_In", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }