コード例 #1
0
ファイル: ControlCursos.cs プロジェクト: schust3r/CENTEC
        /// <summary>
        /// Abrir cambio de estado o detalles de un curso
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GridCursos_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try {
                if (e.RowIndex != -1) {

                    string cod = GridCursos.Rows[e.RowIndex].Cells["Código"].Value.ToString();

                    switch (e.ColumnIndex)
                    {

                        // Click sobre el estado
                        case 0:
                            string estadoAnt = GridCursos.Rows[e.RowIndex].Cells["Estado"].Value.ToString();
                            string infoItem = GridCursos.Rows[e.RowIndex].Cells["Nombre del curso"].Value.ToString();
                            CambiarEstado estadoCurso = new CambiarEstado("curso", cod, estadoAnt, infoItem);
                            estadoCurso.ShowDialog();
                            CargarTablaCursos(new ECurso());
                            break;

                        // Click sobre el nombre
                        case 5:
                            CursoVerDetalles verDetalles = new CursoVerDetalles();
                            verDetalles.SetDatos(cod);
                            verDetalles.ShowDialog();
                            CargarTablaCursos(new ECurso());
                            break;
                    }
                }
            }
            catch { }
        }
コード例 #2
0
        private void GridPart_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try {
                if (e.RowIndex != -1)
                {
                    if (e.ColumnIndex == 1)
                    {
                        string idPart = GridPart.Rows[e.RowIndex]
                            .Cells["ID"].Value.ToString();

                        string estadoPart = GridPart.Rows[e.RowIndex]
                            .Cells["Estado"].Value.ToString();

                        string infoItem = GridPart.Rows[e.RowIndex]
                            .Cells["Identificación"].Value.ToString();

                        CambiarEstado estPart = new CambiarEstado("participante",
                                                     idPart, estadoPart, infoItem);
                        estPart.ShowDialog();
                        CargarTablaPart(new EParticipante());
                    }
                }
            }
            catch (Exception ex)
            {
                MainForm.NotificarExcepcion("CU MAT013", ex);
            }
        }
コード例 #3
0
ファイル: ControlOferta.cs プロジェクト: schust3r/CENTEC
        /// <summary>
        /// Responder a doble clic sobre estado o nombre subrayado
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void GridOferta_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1)
            {
                try
                {
                    switch (e.ColumnIndex)
                    {

                        case 2:
                            if (sesion.permisos.VerDetallesOferta)
                            {
                                var VerDetalles = new VerDetallesOferta();
                                int idOferta = Convert.ToInt16(GridOferta.Rows[e.RowIndex].Cells["ID"].Value.ToString());
                                VerDetalles.SetDatos(idOferta);
                                VerDetalles.ShowDialog();
                                CargarTablaOfertas(new EOferta());
                            }
                            break;

                        case 0:
                            if (sesion.permisos.CambiarEstadoOferta)
                            {
                                string idOfertaStr = GridOferta.Rows[e.RowIndex].Cells["ID"].Value.ToString();
                                var CambioEstado = new CambiarEstado("oferta", idOfertaStr,
                                                     GridOferta.Rows[e.RowIndex].Cells["Estado"].Value.ToString(),
                                                     GridOferta.Rows[e.RowIndex].Cells["Nombre"].Value.ToString());
                                CambioEstado.ShowDialog();
                                CargarTablaOfertas(new EOferta());
                            }
                            break;
                    }
                }
                catch (Exception ex)
                {
                    MainForm.NotificarExcepcion("CU MAT002", ex);
                }
            }
        }