コード例 #1
0
        public void Eliminar()
        {
            if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
            {
                int   idGeneral = Convert.ToInt32(DgvGeneral.GetFocusedRowCellValue("Id"));
                Curso curso     = new Curso();
                curso.Id = idGeneral;


                if (XtraMessageBox.Show("¿Esta seguro que desea eliminar el curso?", "Eliminar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    CtrlCursos.Eliminar(curso);

                    if (!BkgwBuscar.IsBusy)
                    {
                        PrgBuscar.Visible = true;
                        BkgwBuscar.RunWorkerAsync();
                    }
                }
            }
            else
            {
                XtraMessageBox.Show("Debe seleccionar un registro.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #2
0
        public void Eliminar()
        {
            if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
            {
                int      idGeneral = Convert.ToInt32(DgvGeneral.GetFocusedRowCellValue("Id"));
                Profesor profesor  = new Profesor();
                profesor.Persona.Id = idGeneral;


                if (XtraMessageBox.Show("Si elimina el profesor se perderan todos los datos y registros de este, ingresados en el sistema.\n ¿Desea continuar?", "Advertencia", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                {
                    if (XtraMessageBox.Show("¿Esta seguro que desea eliminar el profesor?", "Eliminar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        CtrlProfesores.Eliminar(profesor);

                        if (!BkgwBuscar.IsBusy)
                        {
                            PrgBuscar.Visible = true;
                            BkgwBuscar.RunWorkerAsync();
                        }
                    }
                }
            }
            else
            {
                XtraMessageBox.Show("Debe seleccionar un registro.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #3
0
        public void Editar()
        {
            if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
            {
                int          idGeneral = Convert.ToInt32(DgvGeneral.GetFocusedRowCellValue("Id"));
                FrmGetCursos cursos    = new FrmGetCursos();
                cursos.Database = Database;
                cursos.Modo     = "E";
                cursos.Id       = idGeneral;
                cursos.ShowDialog();

                if (cursos.DialogResult == DialogResult.OK)
                {
                    if (!BkgwBuscar.IsBusy)
                    {
                        PrgBuscar.Visible = true;
                        BkgwBuscar.RunWorkerAsync();
                    }
                }
            }
            else
            {
                XtraMessageBox.Show("Debe seleccionar un registro.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #4
0
 public void Accept()
 {
     if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
     {
         CodigoCurso  = DgvGeneral.GetFocusedRowCellDisplayText(DgvGeneral.Columns["CodigoCurso"]);
         DialogResult = DialogResult.OK;
     }
     else
     {
         XtraMessageBox.Show("Debe seleccionar un curso.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #5
0
        private void Guardar()
        {
            try
            {
                for (int i = 0; i < DgvGeneral.RowCount; i++)
                {
                    string  codAlumno = DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["CodigoAlum"]).ToString();
                    decimal nota1     = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["SerConvi"]));
                    decimal porcN1    = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Nota1"]));
                    decimal nota2     = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Hacer"]));
                    decimal porcN2    = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Nota2"]));
                    decimal nota3     = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Conocer"]));
                    decimal porcN3    = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Nota3"]));
                    decimal nota4     = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Saber"]));
                    decimal porcN4    = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Nota4"]));
                    decimal notaFinal = Convert.ToDecimal(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["NotaFinal"]));
                    int     fallas    = Convert.ToInt32(DgvGeneral.GetRowCellValue(i, DgvGeneral.Columns["Fallas"]));

                    RegistroNota regNot = new RegistroNota();
                    regNot.Alumno.CodigoAlum       = codAlumno;
                    regNot.Profesor.CodigoProfesor = CodProfesor;
                    regNot.Curso.CodigoCurso       = CodCurso;
                    regNot.Materia.CodMateria      = CodMateria;
                    regNot.Periodo.CodigoPeriodo   = CodPeriodo;
                    regNot.Nota1       = nota1;
                    regNot.PorcN1      = porcN1;
                    regNot.Nota2       = nota2;
                    regNot.PorcN2      = porcN2;
                    regNot.Nota3       = nota3;
                    regNot.PorcN3      = porcN3;
                    regNot.Nota4       = nota4;
                    regNot.PorcN4      = porcN4;
                    regNot.NotaFinal   = notaFinal;
                    regNot.Fallas      = fallas;
                    regNot.AñoElectivo = Año;

                    if (modo == "INSERT")
                    {
                        CtrlRegistroNotas.Insertar(regNot);
                    }
                    else
                    {
                        CtrlRegistroNotas.Actualizar(regNot);
                    }
                }

                XtraMessageBox.Show("Proceso realizado con exito", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show("Error en el proceso por favor comuniquese con el Admin del programa:\n " + ex.Message, Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #6
0
        public void Imprimir()
        {
            if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
            {
                DataSet dsImprimir = dsConsulta;

                //dsImprimir.WriteXmlSchema(System.Windows.Forms.Application.StartupPath + @"/Temp/RptCursosAll.xsd");
                RptCursos report = new RptCursos();
                report.DataSource = dsImprimir;
                report.Database   = Database;
                report.Año        = Año.ToString();
                report.Empresa();

                ReportPrintTool rpt = new ReportPrintTool(report);
                report.CreateDocument(true);
                rpt.ShowRibbonPreviewDialog();
            }
        }
コード例 #7
0
        public void Eliminar()
        {
            if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
            {
                int    idGeneral   = Convert.ToInt32(DgvGeneral.GetFocusedRowCellValue("Id"));
                string tipoUsuario = DgvGeneral.GetFocusedRowCellValue("CodTipoUsuario").ToString();
                int    idPersona   = Convert.ToInt32(DgvGeneral.GetFocusedRowCellValue("IdPersona").ToString());

                if (tipoUsuario == "01" || tipoUsuario == "04")
                {
                    Usuario usua = new Usuario();
                    usua.Id         = idGeneral;
                    usua.Persona.Id = idPersona;

                    if (XtraMessageBox.Show("¿Esta seguro que desea eliminar el usuario?", "Eliminar", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        CtrlUsuarios.Eliminar(usua);

                        if (!BkgwBuscar.IsBusy)
                        {
                            PrgBuscar.Visible = true;
                            BkgwBuscar.RunWorkerAsync();
                        }
                    }
                }
                else
                {
                    if (tipoUsuario == "02")
                    {
                        XtraMessageBox.Show("El usuario que intenta eliminar es un profesor; debe eliminarlo por Perfiles/Profesores.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    if (tipoUsuario == "03")
                    {
                        XtraMessageBox.Show("El usuario que intenta eliminar es un alumno; debe eliminarlo por Perfiles/Alumnos.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            else
            {
                XtraMessageBox.Show("Debe seleccionar un registro.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
コード例 #8
0
        public void LlenarGridConsulta2()
        {
            DgvGeneral.Columns.Clear();
            DgvGeneral.OptionsView.ColumnAutoWidth = false;
            DataViewManager dvm    = new DataViewManager(dsConsulta2);
            DataView        dvMain = dvm.CreateDataView(dsConsulta2.Tables[0]);

            DgvGeneral.OptionsBehavior.AutoPopulateColumns = false;
            GctrlGeneral.DataSource = dvMain;

            string[] captions = new[] { "CodArea", "Area", "CodMateria", "Materia", "Nota P1", "Porc. P1", "Nota P2", "Porc. P2",
                                        "Nota P3", "Porc. P3", "Nota P4", "Porc. P4", "Acumulado", "Fallas" };

            GridColumn[] col = new GridColumn[dsConsulta2.Tables[0].Columns.Count];
            for (int i = 0; i < dsConsulta2.Tables[0].Columns.Count; i++)
            {
                col[i] = DgvGeneral.Columns.AddField(dsConsulta2.Tables[0].Columns[i].Caption.Trim());
                col[i].VisibleIndex = i;
                col[i].Caption      = captions[i];
                col[i].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

                if (i == 0 || i == 2)
                {
                    col[i].Visible = false;
                }
            }

            DevExpress.XtraEditors.Repository.RepositoryItemTextEdit numerico = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            //numerico.ReadOnly = true;
            numerico.Mask.EditMask = "n0";
            numerico.Mask.UseMaskAsDisplayFormat = true;
            numerico.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;

            DevExpress.XtraEditors.Repository.RepositoryItemTextEdit numerico1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            //numerico2.ReadOnly = true;
            numerico1.Mask.EditMask = "n1";
            numerico1.Mask.UseMaskAsDisplayFormat = true;
            numerico1.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;

            DevExpress.XtraEditors.Repository.RepositoryItemTextEdit numerico2 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            //numerico2.ReadOnly = true;
            numerico2.Mask.EditMask = "n";
            numerico2.Mask.UseMaskAsDisplayFormat = true;
            numerico2.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;

            DgvGeneral.Columns[4].ColumnEdit  = numerico2;
            DgvGeneral.Columns[5].ColumnEdit  = numerico2;
            DgvGeneral.Columns[6].ColumnEdit  = numerico2;
            DgvGeneral.Columns[7].ColumnEdit  = numerico2;
            DgvGeneral.Columns[8].ColumnEdit  = numerico2;
            DgvGeneral.Columns[9].ColumnEdit  = numerico2;
            DgvGeneral.Columns[10].ColumnEdit = numerico2;
            DgvGeneral.Columns[11].ColumnEdit = numerico2;
            DgvGeneral.Columns[12].ColumnEdit = numerico2;


            DgvGeneral.Columns[13].ColumnEdit = numerico;


            //DgvGeneral.Columns[0].AppearanceCell.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;

            Font fuenteNegrita = new Font("Tahoma", 8.25F, FontStyle.Bold);

            DgvGeneral.Columns[1].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[4].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[5].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[6].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[7].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[8].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[9].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[10].AppearanceCell.Font = fuenteNegrita;
            //DgvGeneral.Columns[11].AppearanceCell.Font = fuenteNegrita;
            DgvGeneral.Columns[12].AppearanceCell.Font = fuenteNegrita;
            DgvGeneral.Columns[13].AppearanceCell.Font = fuenteNegrita;



            DgvGeneral.Columns[4].AppearanceCell.BackColor  = Color.FromArgb(0xFE, 0xF0, 0xE7);
            DgvGeneral.Columns[5].AppearanceCell.BackColor  = Color.FromArgb(0xFC, 0xED, 0xE3);
            DgvGeneral.Columns[6].AppearanceCell.BackColor  = Color.FromArgb(0xE2, 0xFA, 0xE7);
            DgvGeneral.Columns[7].AppearanceCell.BackColor  = Color.FromArgb(0xDD, 0xF6, 0xE2);
            DgvGeneral.Columns[8].AppearanceCell.BackColor  = Color.FromArgb(0xF9, 0xE3, 0xFA);
            DgvGeneral.Columns[9].AppearanceCell.BackColor  = Color.FromArgb(0xF2, 0xDD, 0xF6);
            DgvGeneral.Columns[10].AppearanceCell.BackColor = Color.FromArgb(0xEA, 0xEA, 0xFD);
            DgvGeneral.Columns[11].AppearanceCell.BackColor = Color.FromArgb(0xE1, 0xE1, 0xFF);
            DgvGeneral.Columns[12].AppearanceCell.BackColor = Color.FromArgb(0xBF, 0xD4, 0xEF);
            DgvGeneral.Columns[13].AppearanceCell.BackColor = Color.FromArgb(0xF8, 0xC6, 0xC6);

            //DgvGeneral.Columns[10].AppearanceCell.BackColor = Color.FromArgb(0xCA, 0xE6, 0xCF);
            //DgvGeneral.Columns[11].AppearanceCell.BackColor = Color.FromArgb(0xCA, 0xE6, 0xCF);
            //DgvGeneral.Columns[12].AppearanceCell.BackColor = Color.FromArgb(0xCA, 0xE6, 0xCF);
            //DgvGeneral.Columns[13].AppearanceCell.BackColor = Color.FromArgb(0xCA, 0xE6, 0xCF);
            //DgvGeneral.Columns[14].AppearanceCell.BackColor = Color.FromArgb(0xCA, 0xE6, 0xCF);
            //DgvGeneral.Columns[15].AppearanceCell.BackColor = Color.FromArgb(0xE6, 0xBB, 0xBB);

            DgvGeneral.Columns[0].Width = 70;
            DgvGeneral.Columns[1].Width = 365;
            DgvGeneral.Columns[2].Width = 70;
            DgvGeneral.Columns[3].Width = 365;

            DgvGeneral.Columns[4].Width  = 75;
            DgvGeneral.Columns[5].Width  = 75;
            DgvGeneral.Columns[6].Width  = 75;
            DgvGeneral.Columns[7].Width  = 75;
            DgvGeneral.Columns[8].Width  = 75;
            DgvGeneral.Columns[9].Width  = 75;
            DgvGeneral.Columns[10].Width = 75;
            DgvGeneral.Columns[11].Width = 75;
            DgvGeneral.Columns[12].Width = 75;

            DgvGeneral.Columns[13].Width = 60;

            Funciones.getInstancia().Configurar_Grid(DgvGeneral);
            DgvGeneral.OptionsBehavior.Editable       = false;
            DgvGeneral.OptionsCustomization.AllowSort = false;
            DgvGeneral.OptionsView.ColumnAutoWidth    = false;

            DgvGeneral.OptionsCustomization.AllowGroup = true;

            DgvGeneral.OptionsView.ShowGroupPanel = false;

            DgvGeneral.Columns["NombreArea"].GroupIndex = 0;
            DgvGeneral.ExpandAllGroups();
        }
コード例 #9
0
        private void DgvGeneral_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            if (e.Value != null)
            {
                if (e.Value.ToString() != "")
                {
                    if (e.Column == DgvGeneral.Columns["SerConvi"])
                    {
                        if (Convert.ToDecimal(e.Value) > 5)
                        {
                            DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, 5);
                        }
                        else
                        {
                            if (Convert.ToDecimal(e.Value) < 0)
                            {
                                DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, Math.Abs(Convert.ToDecimal(e.Value)));
                            }
                        }

                        if (Convert.ToDecimal(e.Value) <= 5 && Convert.ToDecimal(e.Value) >= 0)
                        {
                            decimal nota1     = Decimal.Round(Convert.ToDecimal(e.Value) * Convert.ToDecimal(0.3), 1);
                            decimal nota4     = Decimal.Round(Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota4"])), 1);
                            decimal notaFinal = Decimal.Round(nota1 + nota4, 1);

                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota1"], nota1);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["NotaFinal"], notaFinal);
                        }
                    }

                    if (e.Column == DgvGeneral.Columns["Hacer"])
                    {
                        if (Convert.ToDecimal(e.Value) > 5)
                        {
                            DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, 5);
                        }
                        else
                        {
                            if (Convert.ToDecimal(e.Value) < 0)
                            {
                                DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, Math.Abs(Convert.ToDecimal(e.Value)));
                            }
                        }


                        if (Convert.ToDecimal(e.Value) <= 5 && Convert.ToDecimal(e.Value) >= 0)
                        {
                            decimal nota2 = Decimal.Round(Convert.ToDecimal(e.Value) * Convert.ToDecimal(0.3), 1);
                            decimal nota3 = Decimal.Round(Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Conocer"])) * Convert.ToDecimal(0.4), 1);
                            decimal saber = Decimal.Round((Convert.ToDecimal(e.Value) + Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Conocer"]))) / 2, 1);
                            decimal nota4 = Decimal.Round(nota2 + nota3, 1);

                            decimal nota1     = Decimal.Round(Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota1"])), 1);
                            decimal notaFinal = Decimal.Round(nota1 + nota4, 1);

                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota2"], nota2);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Saber"], saber);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota4"], nota4);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["NotaFinal"], notaFinal);
                        }
                    }

                    if (e.Column == DgvGeneral.Columns["Conocer"])
                    {
                        if (Convert.ToDecimal(e.Value) > 5)
                        {
                            DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, 5);
                        }
                        else
                        {
                            if (Convert.ToDecimal(e.Value) < 0)
                            {
                                DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, Math.Abs(Convert.ToDecimal(e.Value)));
                            }
                        }


                        if (Convert.ToDecimal(e.Value) <= 5 && Convert.ToDecimal(e.Value) >= 0)
                        {
                            decimal nota2 = Decimal.Round(Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Hacer"])) * Convert.ToDecimal(0.3), 1);
                            decimal nota3 = Decimal.Round(Convert.ToDecimal(e.Value) * Convert.ToDecimal(0.4), 1);
                            decimal saber = Decimal.Round((Convert.ToDecimal(e.Value) + Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Hacer"]))) / 2, 1);
                            decimal nota4 = Decimal.Round(nota2 + nota3, 1);

                            decimal nota1     = Decimal.Round(Convert.ToDecimal(DgvGeneral.GetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota1"])), 1);
                            decimal notaFinal = Decimal.Round(nota1 + nota4, 1);

                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota3"], nota3);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Saber"], saber);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["Nota4"], nota4);
                            DgvGeneral.SetRowCellValue(e.RowHandle, DgvGeneral.Columns["NotaFinal"], notaFinal);
                        }
                    }
                }
                else
                {
                    DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, 0);
                }
            }
            else
            {
                DgvGeneral.SetRowCellValue(e.RowHandle, e.Column, 0);
            }
        }
コード例 #10
0
        public void RecogerDatosExcel()
        {
            string rutaArchivo = "";

            using (var openDialog = new OpenFileDialog())
            {
                openDialog.Filter = "Excel (2003)(.xls)|*.xls|Excel (2010) (.xlsx)|*.xlsx";//
                if (openDialog.ShowDialog() == DialogResult.OK)
                {
                    rutaArchivo = openDialog.FileName;
                }
                else
                {
                    return;
                }
            }

            int numHoja = 1;

            switch (CodPeriodo)
            {
            case "02":
                numHoja = 2;
                break;

            case "03":
                numHoja = 3;
                break;

            case "04":
                numHoja = 4;
                break;

            default: numHoja = 1;
                break;
            }

            Excel.Application excelAplicacion;
            Excel._Workbook   libroTrabajo;
            Excel._Worksheet  hojaTrabajo;

            //Start Excel and get Application object.
            excelAplicacion         = new Excel.Application();
            excelAplicacion.Visible = false;

            try
            {
                //Get a new workbook.
                libroTrabajo = (Excel._Workbook)(excelAplicacion.Workbooks.Open(rutaArchivo, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing));


                hojaTrabajo = (Excel._Worksheet)libroTrabajo.Sheets[numHoja];

                hojaTrabajo.Unprotect("cargape");

                string periodoAño = (string)hojaTrabajo.get_Range("G" + 4, Missing.Value).Text;
                periodoAño = periodoAño.Remove(0, 10);

                string periodo = (periodoAño.Split('-'))[0].Trim();
                string año     = (periodoAño.Split('-'))[2].Trim();

                if (Año.ToString() != año)
                {
                    XtraMessageBox.Show("La planilla que intenta importar no corresponde al año electivo (" + Año.ToString() + ").", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                string curso = (string)hojaTrabajo.get_Range("C" + 6, Missing.Value).Text;
                curso = curso.Remove(0, 8);
                string codCurso = (curso.Split('-'))[0].Trim();

                if (CodCurso != codCurso)
                {
                    XtraMessageBox.Show("La planilla que intenta importar no corresponde al curso seleccionado (" + NomCurso + ").", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                string priAlum = (string)hojaTrabajo.get_Range("A" + 8, Missing.Value).Text;

                if (string.IsNullOrEmpty(priAlum) || priAlum.Substring(0, 3) != "ALU" || priAlum.Length != 8)
                {
                    XtraMessageBox.Show("La planilla que intenta importar no posee los códigos de los alumnos.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                for (int i = 8; i < 42; i++)
                {
                    string codAlum = (string)hojaTrabajo.get_Range("A" + i, Missing.Value).Text;
                    if (string.IsNullOrEmpty(codAlum))
                    {
                        break;
                    }

                    int indice = -1;
                    for (int l = 0; l < DgvGeneral.RowCount; l++)
                    {
                        if (DgvGeneral.GetRowCellDisplayText(l, DgvGeneral.Columns["CodigoAlum"]) == codAlum)
                        {
                            indice = l;
                            break;
                        }
                    }

                    if (indice != -1)
                    {
                        string serConvivir = (string)hojaTrabajo.get_Range("G" + i, Missing.Value).Text;
                        string hacer       = (string)hojaTrabajo.get_Range("I" + i, Missing.Value).Text;
                        string conocer     = (string)hojaTrabajo.get_Range("K" + i, Missing.Value).Text;
                        string fallas      = (string)hojaTrabajo.get_Range("P" + i, Missing.Value).Text;

                        DgvGeneral.SetRowCellValue(indice, DgvGeneral.Columns["SerConvi"], serConvivir);
                        DgvGeneral.SetRowCellValue(indice, DgvGeneral.Columns["Hacer"], hacer);
                        DgvGeneral.SetRowCellValue(indice, DgvGeneral.Columns["Conocer"], conocer);
                        DgvGeneral.SetRowCellValue(indice, DgvGeneral.Columns["Fallas"], fallas);
                    }
                    else
                    {
                        XtraMessageBox.Show("El alumno con codigo (" + codAlum + "), no existe actualmente en el sistema o no se encuentra activo.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }

                //Cerrar el Libro
                libroTrabajo.Close(false, Missing.Value, Missing.Value);
                //Cerrar la Aplicación
                excelAplicacion.Quit();
            }
            catch (Exception exc)
            {
                String errorMessage;
                errorMessage = "Error: ";
                errorMessage = String.Concat(errorMessage, exc.Message);
                errorMessage = String.Concat(errorMessage, " Line: ");
                errorMessage = String.Concat(errorMessage, exc.Source);

                MessageBox.Show(errorMessage, "Error");
            }
        }