コード例 #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
                    fecha = DateTime.Parse(
                        Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 0)
                        );
                    string horario       = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 1);
                    string prof_nombre   = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 2);
                    string prof_apellido = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 3);
                    string especialidad  = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 4);
                    int    afil_id       = BD_Afiliados.obtenerID_afiliado(usuario.nombre, usuario.apellido, usuario.id);

                    BD_Turnos.asignar_turno(prof_nombre, prof_apellido, fecha, horario, especialidad, afil_id);

                    MessageBox.Show("Turno Asignado.   Seleccionado Profesional: " + prof_nombre + " " + prof_apellido + "   Especialidad: " + especialidad, "ComprarBono", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    button_limpiar_Click(null, null);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al obtener Datos Afiliado. " + ex.Message, "ComprarBono", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
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);
            }
        }
コード例 #3
0
        private void dataGridView_resultados_filtros_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (dataGridView_resultados_filtros.Columns[e.ColumnIndex].Name == "seleccionar")
                {
                    //Hago cosas con los valores de la fila seleccionada
                    this.afiliado_id = Comunes.obtenerIntDataGrid(dataGridView_resultados_filtros, e.RowIndex, 0);


                    this.textBox_Nombre.Text    = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 1);
                    this.textBox_Apellido.Text  = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 2);
                    this.textBox_Documento.Text = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 3);

                    string mensaje = "¿Seguro desea Seleccionar el Afiliado: ";
                    if (siguiente.funcionalidad == ABM_AFILIADO.tipos_funcionalidad.BAJA)
                    {
                        mensaje = "¿Seguro desea Dar de Baja el Afiliado: ";
                    }

                    var choise = MessageBox.Show(mensaje + this.textBox_Nombre.Text + " " + this.textBox_Apellido.Text + "?", "Identificar Afiliado", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                    if (choise == DialogResult.Yes)
                    {
                        if (siguiente != null)
                        {
                            if (siguiente.funcionalidad != ABM_AFILIADO.tipos_funcionalidad.ALTA)
                            {
                                this.siguiente.afiliado.id = this.afiliado_id;
                            }
                            else
                            {
                                // SI es un alta sólo se pasa un id cuando es un nuevo afiliado a cargo del seleccionado
                                this.siguiente.afiliado_principal.id = ((int)this.afiliado_id / 100) * 100 + 1;
                            }
                            this.siguiente.ShowDialog();
                        }
                        this.Close();
                    }
                    ;
                }
                ;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al obtener Datos Columna. ERROR: " + ex.Message, "Identificar Afiliado", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
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
                    this.id_afiliado_que_compra = Comunes.obtenerIntDataGrid(dataGridView_resultados_filtros, e.RowIndex, 0);
                    string nombre   = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 1);
                    string apellido = Comunes.obtenerStringDataGrid(dataGridView_resultados_filtros, e.RowIndex, 2);


                    mostrar_plan();
                    habilitar_comprar();
                    //MessageBox.Show("Seleccionado Afiliado: " + nombre + " " + apellido, "ComprarBono", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error al Seleccionar: " + ex.Message, "ComprarBono", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }