private string _getPeriodoVigente()
        {
            string strPV          = string.Empty;
            string periodoVigente = string.Empty;

            try{
                ProxySeguro.GestorAdministracionGeneral gag = new ProxySeguro.GestorAdministracionGeneral();
                gag.CookieContainer = new CookieContainer();
                gag.set_fUbicacion("");
                strPV = gag.getPeriodoVigente();

                periodoVigente = (!string.IsNullOrEmpty(strPV)) ? strPV
                                                                : this.strGetUltimoPeriodoRegistrado();
            }
            catch (Exception ex) {
                periodoVigente = string.Empty;

                Errores err = new Errores();
                err.SetError(ex, "getPeriodoVigente");
                err.setInfo("HomeController", ex.Message + " - " + UsuarioActual.Cedula.ToString() + " - " + UsuarioActual.CarreraActual.Nombre.ToString());
            }

            return(periodoVigente);
        }
        private WSGestorDeReportesMatriculacion.dtstHorario _horarioCursoParalelo(string strCodNivel, string strCodParalelo)
        {
            WSGestorDeReportesMatriculacion.dtstHorario hcp            = new WSGestorDeReportesMatriculacion.dtstHorario();
            WSGestorDeReportesMatriculacion.dtstHorario dsHorarioCurso = new WSGestorDeReportesMatriculacion.dtstHorario();

            try
            {
                ProxySeguro.GestorDeReportesMatriculacion rm = new ProxySeguro.GestorDeReportesMatriculacion();
                rm.CookieContainer = new System.Net.CookieContainer();
                rm.SetCodCarrera(UsuarioActual.CarreraActual.Codigo.ToString());

                hcp = rm.GetReporteHorarioCurso(strCodParalelo,
                                                _dsPeriodoVigente.Periodos[0]["strCodigo"].ToString(),
                                                strCodNivel);

                dsHorarioCurso = this._limpiarHorarioCurso(hcp);
            }
            catch (Exception ex) {
                Errores err = new Errores();
                err.SetError(ex, "_horarioCursoParalelo");
            }

            return(dsHorarioCurso);
        }
Exemple #3
0
        public bool estadoParcialEvRecuperacion()
        {
            bool ban = true;

            try
            {
                ProxySeguro.NotasEstudiante ne = new ProxySeguro.NotasEstudiante();

                //  true: acta impresa / false: acta NO impresa
                ban = ne.getActaImpresaEvFinalesRecuperacion(UsuarioActual.CarreraActual.Codigo.ToString(),
                                                             this._dtstPeriodoVigente.Periodos[0]["strCodigo"].ToString(),
                                                             this._strCodAsignatura,
                                                             this._strCodParalelo,
                                                             "S");
            }
            catch (Exception ex)
            {
                ban = true;
                Errores err = new Errores();
                err.SetError(ex, "parcialActivo");
            }

            return(ban);
        }
        private bool _getActaEvFinalImpresa(string codAsignatura, string strCodParalelo, string strTpoExamen)
        {
            bool rst    = true;
            int  numReg = default(int);

            try{
                ProxySeguro.NotasEstudiante ne = new ProxySeguro.NotasEstudiante();
                rst = (this._dtstPeriodoVigente.Periodos.Rows.Count > 0)
                            ? ne.getActaImpresaEvFinalesRecuperacion(this.UsuarioActual.CarreraActual.Codigo.ToString(),
                                                                     this._dtstPeriodoVigente.Periodos[0]["strCodigo"].ToString(),
                                                                     codAsignatura,
                                                                     strCodParalelo,
                                                                     strTpoExamen)
                            : true;
            }
            catch (Exception ex) {
                rst = true;

                Errores err = new Errores();
                err.SetError(ex, "_getActaEvAcumulativaImpresa");
            }

            return(rst);
        }
        // GET: Navigation
        public ActionResult Menu()
        {
            List <MenuViewModel> lstMVM = new List <MenuViewModel>();


            try
            {
                string rol = (UsuarioActual != null) ? UsuarioActual.RolActual.ID.ToString()
                                                    : "";

                switch (rol)
                {
                case "Estudiantes":
                    lstMVM      = this._getMenuEstudiantes();
                    this._urlMA = this._getUrlMatriculacionAntigua();
                    break;

                case "Docentes":
                    lstMVM = this._getMenuDocentes();
                    break;

                default:
                    lstMVM = new List <MenuViewModel>();
                    break;
                }

                return(PartialView("_Navigation", lstMVM));
            }
            catch (System.Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "NavigationController - Menu");

                return(PartialView("error", "Error"));
            }
        }
        public string getFchInicioEvaluacion(string dtaTpoEvaluacion)
        {
            string strFchInicio = "por definir";

            try{
                if (this._drDtaPeriodosEvaluacion != null && this._drDtaPeriodosEvaluacion.Length > 0)
                {
                    foreach (DataRow item in this._drDtaPeriodosEvaluacion)
                    {
                        if (this._fchRangoPeriodoAcademico(item["strValor"].ToString()) && item["strCodigo"].ToString().Replace("FN", "").CompareTo(dtaTpoEvaluacion.Replace("FN", "")) == 0)
                        {
                            DateTime dtFchInicio = Convert.ToDateTime(item["strValor"].ToString()).Date.AddDays(-8);
                            strFchInicio = dtFchInicio.ToString("dd/MM/yyyy");
                            break;
                        }
                    }
                }
            }catch (Exception ex) {
                Errores err = new Errores();
                err.SetError(ex, "getFchInicioEvaluacion");
            }

            return(strFchInicio);
        }
        private WSGestorEvaluacion.dtstEvaluacion_ImprimirActas _getDtaImpresionEvRecuperacion()
        {
            dtstEvaluacion_ImprimirActas rstEvRecuperacion = new dtstEvaluacion_ImprimirActas();
            dtstEvaluacion_ImprimirActas dsEvRecuperacion  = new dtstEvaluacion_ImprimirActas();

            try
            {
                this.UsarBaseDatos();
                rstEvRecuperacion = ge.getImprimirActaExSuspension(this._strCodPeriodo,
                                                                   this._strCodAsignatura,
                                                                   this._strCodNivel,
                                                                   this._strCodParalelo);
                dsEvRecuperacion = (rstEvRecuperacion != null)
                                        ? rstEvRecuperacion
                                        : new dtstEvaluacion_ImprimirActas();
                ge.Dispose();
            }
            catch (System.Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "_getDtaImpresionEvRecuperacion");
            }
            return(dsEvRecuperacion);
        }
Exemple #8
0
 public IEnumerable <Prestador> Prestadores()
 {
     try
     {
         var userId = User.Identity.Name;
         if (userId != null)
         {
             var prestadores = new PrestadorRepository();
             var p           = prestadores.Prestadores(userId);
             return(p);
         }
         else
         {
             //Si es null perdio la sesion
             return(null);
         }
     }
     catch (Exception ex)
     {
         var error = new Errores();
         error.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, string.Empty, string.Empty);
         return(null);
     }
 }
Exemple #9
0
 public List <Os> GetObrasSociales()
 {
     try
     {
         if (ModelState.IsValid)
         {
             var userId = User.Identity.Name;
             var os     = new OSRepository();
             return(os.List(Convert.ToInt32(userId)));
         }
         else
         {
             var error = new Errores();
             error.SetError("Getos", 0, string.Empty, string.Empty, null, "Modelo invalido");
             return(null);
         }
     }
     catch (Exception ex)
     {
         var error = new Errores();
         error.SetError("Getos", GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, null, "Modelo invalido");
         return(null);
     }
 }
        public bool checkSession()
        {
            bool status = true;

            try
            {
                Usuario usr = (Usuario)this.Session["UsuarioActual"];

                if (usr != null && usr.getIdleTime().CompareTo(Session.Timeout) > 0)
                {
                    status = false;
                }
                else
                {
                    usr.resetSessionTime();
                }
            }catch (Exception ex) {
                GestorErrores.Errores err = new Errores();
                err.SetError(ex, "checkSession");
                err.setInfo("homeController", "");
            }

            return(status);
        }
        public JsonResult impresionActas(string idActa, string idAsignatura)
        {
            try
            {
                string[] dtaActa       = idActa.Split('_');
                string[] dtaAsignatura = idAsignatura.Split('|');

                string nameFile = string.Empty;
                switch (dtaActa[0].ToString().ToUpper())
                {
                //  EVALUACION ACUMULATIVA ( Parcial 1 / Parcial 2 / Parcial 3 )
                case "PEA":
                    EvaluacionAcumulativaModel evAcumulativa = new EvaluacionAcumulativaModel(dtaAsignatura[1],
                                                                                              dtaAsignatura[0],
                                                                                              dtaAsignatura[2]);

                    nameFile = evAcumulativa.getDtaRptEvAcumulativa(dtaActa,
                                                                    dtaAsignatura,
                                                                    Server.MapPath("~/Reports"),
                                                                    Server.MapPath("~/Temp"));
                    break;

                //  EVALUACION FINAL
                case "PEF":
                    EvaluacionFinalModel evFinal = new EvaluacionFinalModel(dtaAsignatura[1],
                                                                            dtaAsignatura[0],
                                                                            dtaAsignatura[2]);

                    nameFile = evFinal.getDtaRptEvFinal(dtaActa,
                                                        dtaAsignatura,
                                                        Server.MapPath("~/Reports"),
                                                        Server.MapPath("~/Temp"));
                    break;

                //  EVALUACION RECUPERACION
                case "PER":
                    EvaluacionRecuperacionModel evRecuperacion = new EvaluacionRecuperacionModel(dtaAsignatura[1],
                                                                                                 dtaAsignatura[0],
                                                                                                 dtaAsignatura[2]);

                    nameFile = evRecuperacion.getDtaRptEvRecuperacion(dtaActa,
                                                                      dtaAsignatura,
                                                                      Server.MapPath("~/Reports"),
                                                                      Server.MapPath("~/Temp"));
                    break;
                }

                if (nameFile == "-1")
                {
                    return(Json(new { fileName = "", errorMessage = Language.es_ES.MSG_ERROR_GENERAR_ARCHIVO }));
                }
                else
                {
                    return(Json(new { fileName = nameFile, errorMessage = "" }));
                }
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "createFile");

                return(Json(new { fileName = "none", errorMessage = Language.es_ES.MSG_ERROR_GENERAR_ARCHIVO }));
            }
        }
Exemple #12
0
        private List <ReportParameter> _getDatosGeneralesReporte()
        {
            WSInfoCarreras.ParametrosCarrera pc = this._getParametrosCarrera();
            List <ReportParameter>           lstPrmRptHorarioAcademico = new List <ReportParameter>();

            string lblFacultad = "FACULTAD:";
            string lblCarrera  = "CARRERA:";
            string lblEscuela  = "ESCUELA:";

            string facultad = default(string);
            string carrera  = default(string);
            string escuela  = default(string);

            try
            {
                ReportParameter prmRptHorarioAcademico = new ReportParameter();

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strPeriodoAcademico",
                                                                  _dsPeriodoVigente.Periodos[0]["strCodigo"].ToString().ToUpper()));

                switch (UsuarioActual.CarreraActual.TipoEntidad.ToString())
                {
                case "CAR":
                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = pc.NombreEscuela;
                    break;

                case "CAA":
                    lblFacultad = "";
                    lblCarrera  = "";
                    lblEscuela  = "";

                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = "";
                    break;
                }


                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblFacultad",
                                                                  lblFacultad));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblCarrera",
                                                                  lblCarrera));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblEscuela",
                                                                  lblEscuela));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strFacultad",
                                                                  facultad));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strEscuela",
                                                                  carrera));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strCarrera",
                                                                  escuela));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strCurso",
                                                                  "PRUEBA CURSO"));

                lstPrmRptHorarioAcademico.Add(new ReportParameter("strFuente",
                                                                  "ESPOCH - DTIC"));
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "_getDatosGeneralesReporte");
            }

            return(lstPrmRptHorarioAcademico);
        }
        public string getDtaRptEvAcumulativa(string[] dtaActa, string[] dtaAsignatura, string pathReport, string pathTmp)
        {
            //  Creo el nombre del archivo
            string nameFile         = string.Empty;
            string reportPath       = string.Empty;
            string dtaParcial       = dtaActa[0];
            string nombreAsignatura = string.Empty;

            string idTypeFile = (dtaActa[1] == "pdf" || dtaActa[1] == "blc")
                                    ? "pdf"
                                    : (dtaActa[1] == "xls") ? "Excel"
                                                            : "";
            string strNameFile = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(idTypeFile))
                {
                    reportPath = (dtaActa[1] == "pdf" || dtaActa[1] == "xls")
                                    ? Path.Combine(pathReport, "rptActaEvaluacionesConNotas.rdlc")
                                    : Path.Combine(pathReport, "rptActaEvaluacionesSinNotas.rdlc");

                    LocalReport rptEvAcumulativa = this.getRptEvAcumulativa(reportPath);

                    string reportType = idTypeFile;
                    string mimeType;
                    string encoding;
                    string fileNameExtension;

                    string deviceInfo = "<DeviceInfo>" +
                                        "   <OutputFormat>" + idTypeFile + "</OutputFormat>" +
                                        "</DeviceInfo>";

                    Warning[] warnings;
                    string[]  streams;
                    byte[]    renderedBytes;

                    renderedBytes = rptEvAcumulativa.Render(reportType,
                                                            deviceInfo,
                                                            out mimeType,
                                                            out encoding,
                                                            out fileNameExtension,
                                                            out streams,
                                                            out warnings);

                    nombreAsignatura = this.getNombreAsignatura();

                    nombreAsignatura = this.getNombreAsignatura();
                    nameFile         = Language.es_ES.NF_EV_ACUMULATIVA + "_" + nombreAsignatura.Replace(" / ", "_").ToUpper() + ((dtaActa[1].ToUpper() == "PDF" || dtaActa[1].ToUpper() == "BLC") ? ".pdf" : ".xls");

                    //  Direcciono la creacion del archivo a una ubicacion temporal
                    string fullPath = Path.Combine(pathTmp, nameFile);

                    //  Creo el archivo en la ubicacion temporal
                    System.IO.File.WriteAllBytes(fullPath, renderedBytes);

                    if (!this.estadoParcialEvAcumulativa())
                    {
                        this.cierreGestionNotasParcial();
                    }
                }
            }
            catch (Exception ex)
            {
                nameFile = "-1";

                Errores err = new Errores();
                err.SetError(ex, "_getDtaRptEvAcumulativa");
            }

            return(nameFile);
        }
        public string getDtaRptEvFinal(string[] dtaActa, string[] dtaAsignatura, string pathReport, string pathTmp)
        {
            //  Creo el nombre del archivo
            string nameFile         = string.Empty;
            string reportPath       = string.Empty;
            string dtaParcial       = dtaActa[0];
            string nombreAsignatura = string.Empty;

            string idTypeFile = (dtaActa[1] == "pdf" || dtaActa[1] == "blc")
                                    ? "pdf"
                                    : (dtaActa[1] == "xls") ? "Excel"
                                                            : "";
            string strNameFile = string.Empty;

            try
            {
                if (!string.IsNullOrEmpty(idTypeFile))
                {
                    reportPath = (dtaActa[1] == "pdf" || dtaActa[1] == "xls")
                                    ? Path.Combine(pathReport, "rptActaExPrincipalConNotasR1.rdlc")
                                    : Path.Combine(pathReport, "rptActaExPrincipalSinNotasR1.rdlc");

                    LocalReport rptEvFinal = this.getRptEvFinal(reportPath);

                    string reportType = idTypeFile;
                    string mimeType;
                    string encoding;
                    string fileNameExtension;

                    string deviceInfo = "<DeviceInfo>" +
                                        "   <OutputFormat>" + idTypeFile + "</OutputFormat>" +
                                        "</DeviceInfo>";

                    Warning[] warnings;
                    string[]  streams;
                    byte[]    renderedBytes;

                    renderedBytes = rptEvFinal.Render(reportType,
                                                      deviceInfo,
                                                      out mimeType,
                                                      out encoding,
                                                      out fileNameExtension,
                                                      out streams,
                                                      out warnings);

                    nombreAsignatura = this.limpiarNombreAsignatura(this.getNombreAsignatura()).Replace("*", "").Replace(":", "");
                    nameFile         = Language.es_ES.NF_EV_FINAL + "_" + nombreAsignatura.Replace("/", "_").ToUpper() + ((dtaActa[1].ToUpper() == "PDF" || dtaActa[1].ToUpper() == "BLC") ? ".pdf" : ".xls");

                    //  Direcciono la creacion del archivo a una ubicacion temporal
                    string fullPath = Path.Combine(pathTmp, nameFile);

                    //  Creo el archivo en la ubicacion temporal
                    System.IO.File.WriteAllBytes(fullPath, renderedBytes);

                    //  verifico si el acta a sido impresa
                    if (!this.estadoParcialEvFinal())
                    {
                        //  Registro la impresion del acta en el sistema academico
                        this.regImpActaNotasEvFinal();
                    }
                }
            }
            catch (Exception ex)
            {
                nameFile = "-1";

                Errores err = new Errores();
                err.SetError(ex, "getDtaRptEvFinal");
            }

            return(nameFile);
        }
Exemple #15
0
        private bool _existeRolUsuario()
        {
            bool blnUsuarioValido = false;

            try
            {
                WSSeguridad.dtstUsuario dsUsuario = new WSSeguridad.dtstUsuario();
                string numIdentificacionUsr       = this._getNumeroIdentificacion();

                if (!string.IsNullOrEmpty(numIdentificacionUsr))
                {
                    string periodoVigente = this._getPeriodoVigente();
                    SitioWebOasis.ProxySeguro.Seguridad seg = new ProxySeguro.Seguridad();

                    //  GESTIONA EL ROL DE UN USUARIO REGISTRADO
                    blnUsuarioValido = seg.AutenticarUsuario(numIdentificacionUsr,
                                                             "e",
                                                             periodoVigente,
                                                             out dsUsuario);

                    //  Verificar si el usuario es válido
                    if (blnUsuarioValido)
                    {
                        //  Add objeto seguridad a la cache del usuario
                        this._addObjetoSeguridad();

                        // registrar datos del usuario en la sesión para futuras referencias
                        Usuario usr = this.RegistrarUsuarioEnSesion(dsUsuario);

                        // crear un ticket de autenticación
                        FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
                                                                                         usr.Login,
                                                                                         DateTime.Now,
                                                                                         DateTime.Now.AddMinutes(20),
                                                                                         false,
                                                                                         usr.RolActual.ID.ToString());

                        //  Encriptar el ticket
                        string encTicket = FormsAuthentication.Encrypt(ticket);

                        //  Crear una cookie y añadir el ticket encriptado como datos
                        HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);

                        //  Añadir la cookie a la respuesta
                        Response.Cookies.Add(cookie);

                        //  Seteo el tiempo de session en "20" minutos
                        Session.Timeout = 20;
                    }
                    else
                    {
                        this.Session["UsuarioActual"] = new Usuario();
                    }
                }
            }catch (Exception ex) {
                blnUsuarioValido = false;

                Errores err = new Errores();
                err.SetError(ex, "_existeRolUsuario");
            }

            return(blnUsuarioValido);
        }
        public string getDtaEvFinal_EvRecuperacion(string tpoExamen)
        {
            string alertaEquivalencia = "even";
            string lblEquivalencia    = "default";
            string smsEquivalencia    = "";
            string rst        = string.Empty;
            string notaFinal  = "";
            int    totalEvFR  = default(int);
            string tipoExamen = (tpoExamen == "P") ? "PRI"
                                                    : (tpoExamen == "S") ? "SUS"
                                                                        : "";

            rst += " <tr role='row' class='success'>";
            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;' colspan='9'>" + Language.es_ES.EST_LBL_SIN_REGISTROS + "</td>";
            rst += " </tr>";

            try
            {
                this._dsDetalleNotas = this._getDataNotasEstudiante(periodoEstudiante);
                if (this._dsDetalleNotas != null && this._dsDetalleNotas.EvFinal_EvFormativa.Rows.Count > 0 && !string.IsNullOrEmpty(tipoExamen))
                {
                    DataRow[] drEvF_EvR = this._dsDetalleNotas.EvFinal_EvFormativa.Select("strCodTipoExamen = '" + tipoExamen + "'", "asignatura");

                    if (drEvF_EvR.Length > 0)
                    {
                        int x = 0;
                        rst = string.Empty;

                        foreach (DataRow item in drEvF_EvR)
                        {
                            alertaEquivalencia = this.getAlertaFila(item["strCodEquiv"].ToString(),
                                                                    item["strCodMateria"].ToString(),
                                                                    ref alertaEquivalencia,
                                                                    ref lblEquivalencia,
                                                                    ref smsEquivalencia);

                            notaFinal = (string.IsNullOrEmpty(item["bytNota"].ToString()) || item["bytNota"].ToString().CompareTo("0") == 0)
                                            ? "0"
                                            : item["bytNota"].ToString();

                            totalEvFR = this._getTotalEvFR(item["bytAcumulado"].ToString(),
                                                           item["bytNota"].ToString());

                            rst += " <tr role='row'>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'>" + ++x + "</td>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: left;'>" + item["asignatura"].ToString() + "</ td >";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'>" + this.getNumOrdinal(item["nivel"].ToString(), "nivel") + "</td>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'>" + this.getNumOrdinal(item["numMatricula"].ToString(), "matricula") + "</td>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'>" + item["bytAcumulado"].ToString() + "</td>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'>" + notaFinal + "</td>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'><b>" + totalEvFR + "</b></td>";
                            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;'> <span class='label label-" + lblEquivalencia + "'>" + smsEquivalencia + "</span> </td>";
                            rst += " </tr>";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "_getHTMLNotasEVAcumulativa - Usuario: " + UsuarioActual.Cedula.ToString() + " / " + UsuarioActual.CarreraActual.ToString() + " / " + UsuarioActual.CarreraActual.Codigo.ToString());
            }

            return(rst);
        }
        public string getHTMLNotasEVAcumulativa()
        {
            string alertaEquivalencia = "even";
            string lblEquivalencia    = "default";
            string msgEquivalencia    = "---";
            string rst = string.Empty;

            rst += " <tr role='row' class='success'>";
            rst += "     <td style='align-content: center; vertical-align: middle; text-align: center;' colspan='11'>" + Language.es_ES.EST_LBL_SIN_REGISTROS + "</td>";
            rst += " </tr>";

            try
            {
                this._dsDetalleNotas = this._getDataNotasEstudiante(periodoEstudiante);
                bool esPeriodoActual = (periodoEstudiante.ToString().CompareTo(periodoVigente.Periodos[0]["strCodigo"].ToString()) == 0)
                                        ? true
                                        : false;

                if (this._dsDetalleNotas != null && this._dsDetalleNotas.EvAcumulativa.Rows.Count > 0)
                {
                    int x = 0;
                    rst = string.Empty;
                    string dtaEvActiva   = this.getDataEvaluacionActiva();
                    string estadoNota    = string.Empty;
                    string colorParcial1 = (dtaEvActiva == "1") ? "info" : "";
                    string colorParcial2 = (dtaEvActiva == "2") ? "info" : "";
                    string colorParcial3 = (dtaEvActiva == "3") ? "info" : "";

                    foreach (DataRow item in this._dsDetalleNotas.EvAcumulativa)
                    {
                        if (esPeriodoActual)
                        {
                            alertaEquivalencia = (dtaEvActiva.ToString().CompareTo("3") == 0 || dtaEvActiva.ToString().CompareTo("P") == 0 || dtaEvActiva.ToString().CompareTo("S") == 0)
                                                    ? this.getAlertaFila(item["strCodEquiv"].ToString(),
                                                                         item["strCodMateria"].ToString(),
                                                                         ref alertaEquivalencia,
                                                                         ref lblEquivalencia,
                                                                         ref msgEquivalencia)
                                                    : "";
                        }
                        else
                        {
                            alertaEquivalencia = this.getAlertaFila(item["strCodEquiv"].ToString(),
                                                                    item["strCodMateria"].ToString(),
                                                                    ref alertaEquivalencia,
                                                                    ref lblEquivalencia,
                                                                    ref msgEquivalencia);
                        }

                        string smsObservacion = (!string.IsNullOrEmpty(item["observaciones"].ToString()))
                                                    ? item["observaciones"].ToString()
                                                    : "---";

                        rst += " <tr role='row' style='align-content: center; vertical-align: middle; text-align: center;'>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'>" + ++x + "</td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: left;'>" + item["strNombre"].ToString() + "</ td >";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'>" + this.getNumOrdinal(item["numMatricula"].ToString(), "matricula") + "</td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'>" + this.getNumOrdinal(item["nivelAsignatura"].ToString(), "nivel") + "</td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'>" + item["strCodParalelo"].ToString() + "</ td >";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;' class='" + colorParcial1 + "'>" + item["bytNota1"].ToString() + "</td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;' class='" + colorParcial2 + "'>" + item["bytNota2"].ToString() + "</td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;' class='" + colorParcial3 + "'>" + item["bytNota3"].ToString() + "</td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'><b>" + item["acumulado"].ToString() + "</b></td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'> <span class='" + alertaEquivalencia + "'>" + msgEquivalencia + "</span></td>";
                        rst += "    <td style='align-content: center; vertical-align: middle; text-align: center;'> " + smsObservacion + "</span> </td>";
                        rst += " </tr>";
                    }
                }
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "_getHTMLNotasEVAcumulativa - Usuario: " + UsuarioActual.Cedula.ToString() + " / " + UsuarioActual.CarreraActual.ToString() + " / " + UsuarioActual.CarreraActual.Codigo.ToString());
            }

            return(rst);
        }
        public dynamic EstadisticaEvaluacionAcumulada()
        {
            // WSGestorEvaluacion.dtstEvaluacion_ImprimirAcumulados rstEvAcumulativa = new WSGestorEvaluacion.dtstEvaluacion_ImprimirAcumulados();
            dynamic json = string.Empty;

            try
            {
                //Para Actas Acumuladas
                int intExonerados        = 0;
                int intReprovadosFaltas  = 0;
                int intDarPrincipal      = 0;
                int intReprovadoBajaNota = 0;
                //Para Actas Final
                int intFinalReprobados = 0;
                int intFinalAprovados  = 0;
                int intFinalSuspension = 0;
                //Para Actas Recuperacion
                int intSuspensionReprobados = 0;
                int intSuspensionAprovados  = 0;

                UsarBaseDatos();

                WSGestorEvaluacion.dtstEvaluacion_ImprimirAcumulados rstEvAcumulativa = this._getDtaImpresionEvAcumulativa();
                dtstEvaluacion_ImprimirActas dtaEvFinal        = this.getReporteActasExPrincipal();
                dtstEvaluacion_ImprimirActas dtaEvRecuperacion = this._getDtaImpresionEvRecuperacion();

                if (dtaEvFinal != null && dtaEvFinal.Tables["Acta"].Rows.Count > 0)
                {
                    intReprovadosFaltas  = Convert.ToInt16(dtaEvFinal.Tables["Acta"].Compute("Count(Total)", "bytAsistencia<70"));
                    intExonerados        = Convert.ToInt16(dtaEvFinal.Tables["Acta"].Compute("Count(Total)", "strCodEquiv='E'"));
                    intReprovadoBajaNota = Convert.ToInt16(dtaEvFinal.Tables["Acta"].Compute("Count(Total)", "bytAcumulado<4 and bytAsistencia>=70"));

                    intFinalAprovados  = Convert.ToInt16(dtaEvFinal.Tables["Acta"].Compute("Count(Total)", "bytAcumulado>=16 and strCodEquiv ='A'and bytAsistencia>=70"));
                    intFinalReprobados = Convert.ToInt16(dtaEvFinal.Tables["Acta"].Compute("Count(Total)", "bytAcumulado>=4 and Total<16 and strCodEquiv ='R'and bytAsistencia>=70 "));//acum>=6
                }
                if (dtaEvRecuperacion != null && dtaEvRecuperacion.Tables["Acta"].Rows.Count > 0)
                {
                    intSuspensionAprovados  = Convert.ToInt16(dtaEvRecuperacion.Tables["Acta"].Compute("Count(Total)", "strCodEquiv ='A'"));
                    intSuspensionReprobados = Convert.ToInt16(dtaEvRecuperacion.Tables["Acta"].Compute("Count(Total)", "strCodEquiv ='R'"));
                }
                int TotalEstudiantes = Convert.ToInt16(rstEvAcumulativa.Tables["Acta"].Compute("Count(Total)", ""));
                json = new JavaScriptSerializer().Serialize(new
                {
                    PerdidosFalta          = intReprovadosFaltas,
                    Exonerados             = intExonerados,
                    ReprobadosPrincipal    = intFinalReprobados,
                    NotaBaja               = intReprovadoBajaNota,
                    TotalEstudiantes       = TotalEstudiantes,
                    PrincipalAprobados     = intFinalAprovados,
                    PrincipalReprobados    = intFinalReprobados,
                    PrincipalDarSuspension = intFinalSuspension,
                    SuspensionAprobados    = intSuspensionAprovados,
                    SuspensionReprovados   = intSuspensionReprobados
                });
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "EstadisticaEvaluacionAcumulada");
            }
            return(json);
        }
        private IEnumerable <ReportParameter> _getParametrosGeneralesReporte()
        {
            WSInfoCarreras.ParametrosCarrera pc = this._getParametrosCarrera();
            List <ReportParameter>           lstPrmRptEvAcumulativa = new List <ReportParameter>();

            string lblFacultad = "FACULTAD:";
            string lblCarrera  = "CARRERA:";
            string lblEscuela  = "ESCUELA:";

            string facultad = default(string);
            string carrera  = default(string);
            string escuela  = default(string);

            string strAsignatura = string.Empty;
            string strNivel      = string.Empty;
            string strPeriodo    = string.Empty;
            string strDocente    = string.Empty;
            string strSistema    = string.Empty;
            float  numCreditos   = default(float);
            byte   fHorasTeo     = default(byte);
            byte   fHorasPra     = default(byte);

            try
            {
                ReportParameter prmRptHorarioAcademico = new ReportParameter();
                this._getDatosMateria(ref strAsignatura,
                                      ref strNivel,
                                      ref strPeriodo,
                                      ref strDocente,
                                      ref strSistema,
                                      ref numCreditos,
                                      ref fHorasTeo,
                                      ref fHorasPra);

                switch (UsuarioActual.CarreraActual.TipoEntidad.ToString())
                {
                case "CAR":
                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = pc.NombreEscuela;
                    break;

                case "CAA":
                    lblFacultad = "";
                    lblCarrera  = "";
                    lblEscuela  = "";

                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = "";
                    break;
                }

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strInstitucion",
                                                               Language.es_ES.STR_INSTITUCION));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strPeriodoAcademico",
                                                               this._dtstPeriodoVigente.Periodos[0]["strDescripcion"].ToString()));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strLblFacultad",
                                                               lblFacultad));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strLblCarrera",
                                                               lblCarrera));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strLblEscuela",
                                                               lblEscuela));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strAsignatura",
                                                               strAsignatura));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strCodMateria",
                                                               this._strCodAsignatura.ToString().ToUpper()));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strCreditos",
                                                               Convert.ToString(numCreditos)));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strDocente",
                                                               this.UsuarioActual.Nombre.ToString().ToUpper()));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strNivel",
                                                               this._strCodNivel.ToString()));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strParalelo",
                                                               this._strCodParalelo.ToString()));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strFacultad",
                                                               facultad));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strEscuela",
                                                               escuela));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strCarrera",
                                                               carrera));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strURLImagen",
                                                               ""));

                lstPrmRptEvAcumulativa.Add(new ReportParameter("strURLImagenDTIC",
                                                               ""));
            }
            catch (Exception ex) {
                Errores err = new Errores();
                err.SetError(ex, "_getDatosGeneralesReporte");
            }

            return(lstPrmRptEvAcumulativa);
        }
        public void cierreGestionNotasParcial()
        {
            string parcial1 = "0";
            string parcial2 = "0";
            string parcial3 = "0";

            try{
                string dtaParcial = this._evaluacion.getDataEvaluacionActiva().Replace("FN", "");

                if (this._dsEvAcumulativa.Acta.Rows.Count > 0)
                {
                    switch (dtaParcial)
                    {
                    case "1":
                        parcial1 = "1";
                        break;

                    case "2":
                        parcial1 = "1";
                        parcial2 = "1";
                        break;

                    case "3":
                        parcial1 = "1";
                        parcial2 = "1";
                        parcial3 = "1";
                        break;
                    }

                    ProxySeguro.NotasEstudiante ne = new ProxySeguro.NotasEstudiante();
                    int numRegEA = ne.getNumRegistrosEvAcumulativo(this.UsuarioActual.CarreraActual.Codigo.ToString(),
                                                                   this._dtstPeriodoVigente.Periodos[0]["strCodigo"].ToString(),
                                                                   this._strCodAsignatura.ToString());

                    if (dtaParcial == "1")
                    {
                        if (numRegEA == 0)
                        {
                            this._addCerrarGestionParcial(parcial1, parcial2, parcial3);
                        }
                        else
                        {
                            this._updCerrarGestionParcial(parcial1, parcial2, parcial3);
                        }
                    }
                    else if (dtaParcial == "2" || dtaParcial == "3")
                    {
                        if (numRegEA == 0)
                        {
                            this._addCerrarGestionParcial(parcial1, parcial2, parcial3);
                        }
                        else
                        {
                            this._updCerrarGestionParcial(parcial1, parcial2, parcial3);
                        }
                    }
                }
            }
            catch (Exception ex) {
                Errores err = new Errores();
                err.SetError(ex, "cierreGestionNotasParcial");
            }
        }
        public LocalReport getReporteHorarios(string reportPath)
        {
            LocalReport rptHorarioDocente = new LocalReport();

            try
            {
                if (this.strTipoHorario.Equals("Clase"))
                {
                    WSGestorDeReportesMatriculacion.dtstHorario dtsHorario = _dsHorarioClase();
                    List <HorarioClaseDocente> lstHorarioDocente           = new List <HorarioClaseDocente>();
                    foreach (DataRow item in dtsHorario.Tables["Horario"].Rows)
                    {
                        HorarioClaseDocente objHorarioClase = new HorarioClaseDocente
                        {
                            StrCodHora         = item.ItemArray[0].ToString(),
                            StrDescripcionHora = item.ItemArray[1].ToString(),
                            StrInicioFinHora   = item.ItemArray[2].ToString(),
                            StrLunes           = item.ItemArray[3].ToString(),
                            StrMartes          = item.ItemArray[4].ToString(),
                            StrMiercoles       = item.ItemArray[5].ToString(),
                            StrJueves          = item.ItemArray[6].ToString(),
                            StrViernes         = item.ItemArray[7].ToString(),
                            StrSabado          = item.ItemArray[8].ToString(),
                            StrDomingo         = item.ItemArray[9].ToString()
                        };
                        lstHorarioDocente.Add(objHorarioClase);
                    }
                    ReportDataSource rds = new ReportDataSource();
                    rds.Name  = "dsHorarioClaseDocente";
                    rds.Value = lstHorarioDocente;
                    rptHorarioDocente.DataSources.Clear();
                    rptHorarioDocente.DataSources.Add(rds);
                    rptHorarioDocente.ReportPath = reportPath;
                    rptHorarioDocente.SetParameters(_getParametrosGeneralesReporte());
                    rptHorarioDocente.Refresh();
                }
                else
                {
                    WSGestorDeReportesEvaluacion.dtstHorarioExamenes dsHorarioExamenes = _dsHorarioExamenes();
                    List <HorarioExamenDocente> lstHorarioExDocente = new List <HorarioExamenDocente>();
                    foreach (DataRow item in dsHorarioExamenes.Tables["Materias"].Rows)
                    {
                        HorarioExamenDocente objHorarioExamen = new HorarioExamenDocente
                        {
                            StrCodMateria       = item.ItemArray[0].ToString(),
                            StrCodParalelo      = item.ItemArray[1].ToString(),
                            StrCodNivel         = item.ItemArray[2].ToString(),
                            StrDescripcionNivel = item.ItemArray[3].ToString(),
                            StrNombreMateria    = item.ItemArray[4].ToString(),
                            DtFechaExPrinc      = item.ItemArray[5].ToString(),
                            DtFechaExSusp       = item.ItemArray[6].ToString(),
                            StrCedula           = item.ItemArray[7].ToString(),
                            StrKeyMateria       = item.ItemArray[8].ToString()
                        };
                        lstHorarioExDocente.Add(objHorarioExamen);
                    }
                    ReportDataSource rds = new ReportDataSource();
                    rds.Name  = "dsHorarioExamenDocente";
                    rds.Value = lstHorarioExDocente;
                    rptHorarioDocente.DataSources.Clear();
                    rptHorarioDocente.DataSources.Add(rds);
                    rptHorarioDocente.ReportPath = reportPath;
                    rptHorarioDocente.SetParameters(_getParametrosGeneralesReporte());
                    rptHorarioDocente.Refresh();
                }
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "getReporteHorarios");
            }
            return(rptHorarioDocente);
        }
        public Persona(string dtaJsonPersona)
        {
            try
            {
                var dtaPersona = Json.Decode(dtaJsonPersona);

                if (dtaPersona != null)
                {
                    this.per_id             = dtaPersona.per_id;
                    this.carnetDiscapacidad = dtaPersona.carnetDiscapacidad;
                    this.cuenta             = dtaPersona.cuenta;
                    this.direccion          = dtaPersona.direccion;
                    this.documentoPersonal  = dtaPersona.documentoPersonal;
                    this.eci_id             = dtaPersona.eci_id;
                    this.estadoCivil        = dtaPersona.estadoCivil;
                    this.etn_id             = dtaPersona.etn_id;
                    this.etnia                = dtaPersona.etnia;
                    this.gen_id               = dtaPersona.gen_id;
                    this.genero               = dtaPersona.genero;
                    this.imagen               = dtaPersona.imagen;
                    this.instruccionFormal    = dtaPersona.instruccionFormal;
                    this.lugarprocedencia_id  = dtaPersona.lugarprocedencia_id;
                    this.nacionalidadPersona  = dtaPersona.nacionalidadPersona;
                    this.parroquia            = dtaPersona.parroquia;
                    this.per_afiliacionIESS   = dtaPersona.per_afiliacionIESS;
                    this.per_creadoPor        = dtaPersona.per_creadoPor;
                    this.per_email            = dtaPersona.per_email;
                    this.per_emailAlternativo = dtaPersona.per_emailAlternativo;

                    this.per_fechaCreacion = (!string.IsNullOrEmpty(Convert.ToString(dtaPersona.per_fechaCreacion)))
                                                ? Convert.ToDateTime(dtaPersona.per_fechaCreacion)
                                                : default(DateTime);

                    this.per_fechaModificacion = (!string.IsNullOrEmpty(Convert.ToString(dtaPersona.per_fechaModificacion)))
                                                    ? Convert.ToDateTime(dtaPersona.per_fechaModificacion)
                                                    : default(DateTime);

                    this.per_fechaNacimiento = (!string.IsNullOrEmpty(Convert.ToString(dtaPersona.per_fechaNacimiento)))
                                                ? Convert.ToDateTime(dtaPersona.per_fechaNacimiento)
                                                : default(DateTime);

                    this.per_modificadoPor        = dtaPersona.per_modificadoPor;
                    this.per_nombres              = dtaPersona.per_nombres;
                    this.per_primerApellido       = dtaPersona.per_primerApellido;
                    this.per_segundoApellido      = dtaPersona.per_segundoApellido;
                    this.per_telefonoCasa         = dtaPersona.per_telefonoCasa;
                    this.per_telefonoCelular      = dtaPersona.per_telefonoCelular;
                    this.per_telefonoOficina      = dtaPersona.per_telefonoOficina;
                    this.personaPlurinacionalidad = dtaPersona.personaPlurinacionalidad;
                    this.tipoSangre = dtaPersona.tipoSangre;
                    this.tsa_id     = dtaPersona.tsa_id;
                    this.sex_id     = (short)dtaPersona.sex_id;
                    this.sexo       = dtaPersona.sexo;
                }
                else
                {
                    this.per_id             = default(Int32);
                    this.carnetDiscapacidad = default(DynamicJsonArray);
                    this.cuenta             = default(DynamicJsonArray);
                    this.direccion          = default(DynamicJsonArray);
                    this.documentoPersonal  = default(DynamicJsonArray);
                    this.eci_id             = default(Int32);
                    this.estadoCivil        = string.Empty;
                    this.etn_id             = default(Int32);
                    this.etnia                    = string.Empty;
                    this.gen_id                   = default(Int32);
                    this.genero                   = string.Empty;
                    this.imagen                   = default(byte[]);
                    this.instruccionFormal        = default(DynamicJsonArray);
                    this.lugarprocedencia_id      = default(Int32);
                    this.nacionalidadPersona      = default(DynamicJsonArray);
                    this.parroquia                = string.Empty;
                    this.per_afiliacionIESS       = string.Empty;
                    this.per_creadoPor            = default(Int32);
                    this.per_email                = string.Empty;
                    this.per_emailAlternativo     = string.Empty;
                    this.per_fechaCreacion        = default(DateTime);
                    this.per_fechaModificacion    = default(DateTime);
                    this.per_fechaNacimiento      = default(DateTime);
                    this.per_modificadoPor        = default(Int32);
                    this.per_nombres              = string.Empty;
                    this.per_primerApellido       = string.Empty;
                    this.per_segundoApellido      = string.Empty;
                    this.per_telefonoCasa         = string.Empty;
                    this.per_telefonoCelular      = string.Empty;
                    this.per_telefonoOficina      = string.Empty;
                    this.personaPlurinacionalidad = default(DynamicJsonArray);
                    this.tipoSangre               = string.Empty;
                    this.tsa_id                   = default(Int32);
                }

                this.defaultImage = (this.imagen == null)
                                        ? (this.sex_id == 1)
                                                ? "~/Content/img/EstudianteMasculinoDefault.png"
                                                : (this.sex_id == 2)? "~/Content/img/EstudianteFemeninoDefault.png"
                                                                    : "~/Content/img/userDefault.png"
                                        : "";
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "Persona");
            }
        }
        static CacheConfig()
        {
            #region Load Configuration Section
            try{
                config = (NameValueCollection)System.Configuration.ConfigurationManager.GetSection(cacheSettingsConfigName);
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex,
                             "Configuration section " + cacheSettingsConfigName + " is not defined correctly in web.config.");
            }
            #endregion

            #region Load EnableCaching Flag
            try
            {
                EnableCaching = bool.Parse(config[EnableCachingKey]);
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex,
                             EnableCachingKey + " is not defined as either 'true' or 'false' in configuration section " + cacheSettingsConfigName);
            }
            #endregion

            #region Load RequireKeyDefinition flag
            // load RequireKeyDefinitionInConfig flag
            try
            {
                RequireKeyDefinitionInConfig = bool.Parse(config[RequireKeyDefinitionInConfigKey]);
            }
            catch (Exception ex)
            {
                throw new System.Configuration.ConfigurationErrorsException(RequireKeyDefinitionInConfigKey + " is not defined as either 'true' or 'false' in configuration section " + cacheSettingsConfigName, ex);
            }
            #endregion

            #region Load DefaultCacheDuration
            try
            {
                DefaultCacheDuration = GetTimeSpanFromUnits(config[DefaultCacheDurationUnitsKey],
                                                            Int32.Parse(config[DefaultCacheDurationValueKey]));
            }
            catch (ConfigurationException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw new System.Configuration.ConfigurationErrorsException("Invalid or missing value for " + DefaultCacheDurationUnitsKey + " in configuration.", ex);
            }
            #endregion

            #region Check HttpContext Available
            context = System.Web.HttpContext.Current;
            if (context == null)
            {
                EnableCaching = false;
            }
            #endregion
        }
Exemple #24
0
        private IEnumerable <ReportParameter> _getParametrosGeneralesReporte()
        {
            WSInfoCarreras.ParametrosCarrera pc = this._getParametrosCarrera();
            List <ReportParameter>           lstPrmRptMatriculaEstudiante = new List <ReportParameter>();

            string facultad   = default(string);
            string carrera    = default(string);
            string escuela    = default(string);
            string strDocente = default(string);

            ObtenerValoresUnidadAcademica();
            try
            {
                ReportParameter prmRptMatriculaEstudiante = new ReportParameter();
                switch (UsuarioActual.CarreraActual.TipoEntidad.ToString())
                {
                case "CAR":
                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = pc.NombreEscuela;
                    break;

                case "CAA":
                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = "";
                    break;
                }
                //Director
                if (this.fSexoDirector == "MAS")
                {
                    fFirmaDirector = "DIRECTOR ESCUELA DE " + carrera.Trim().ToUpper();
                }
                else
                {
                    if (this.fSexoDirector == "FEM")
                    {
                        fFirmaDirector = "DIRECTORA ESCUELA DE " + carrera.Trim().ToUpper();
                    }
                    else
                    {
                        fFirmaDirector = "DIRECTOR(A) ESCUELA DE " + carrera.Trim().ToUpper();
                    }
                }
                //Secretaria Académica
                fFirmaSecretaria = "SECRETARIA ACADÉMICA ESCUELA DE " + carrera.Trim().ToUpper();

                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strInstitucion",
                                                                     Language.es_ES.STR_INSTITUCION));

                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strFacultad",
                                                                     facultad));

                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strEscuela",
                                                                     carrera));

                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strCarrera",
                                                                     escuela));

                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strFuente",
                                                                     Language.es_ES.STR_FUENTE_REPORTE));

                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strDirectorEscuela",
                                                                     this.fDirectorEscuela.ToUpper().Trim()));
                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strFirmaDirector",
                                                                     fFirmaDirector.ToUpper().Trim()));
                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strSecretariaAcademica",
                                                                     this.fSecretariaAcademica.ToUpper().Trim()));
                lstPrmRptMatriculaEstudiante.Add(new ReportParameter("strFirmaSecretaria",
                                                                     fFirmaSecretaria.ToUpper().Trim()));
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "_getDatosGeneralesReporte");
            }
            return(lstPrmRptMatriculaEstudiante);
        }
Exemple #25
0
        public Afiliado Elegibilidad(Elegibilidad model)
        {
            try
            {
                var prestador = new PrestadorRepository();
                var matricula = 0;
                switch (model.OsId)
                {
                case 0:
                    break;

                case 1:    //Swiss Medical
                    var swiss = new OSSwiss();
                    return(swiss.Eligibilidad(model.Credencial));

                case 2:
                    var acaSalud = new OSAcaSalud();

                    matricula = prestador.GetMatriculaFromIdPre(model.IdPre);
                    return(acaSalud.Elegibilidad(model.Credencial, matricula));

                case 3:
                    break;

                case 4:
                    break;

                case 5:
                case 8:
                    var boreal = new OSBoreal();
                    return(boreal.Eligibilidad(model.Credencial));

                case 6:
                    var medife = new OSMedife();
                    return(medife.Eligibilidad(model.Credencial));

                case 7:
                    var redSeguros = new OSRedSeguros();
                    return(redSeguros.Eligibilidad(model.Credencial));

                case 9:
                    var sancor = new OSSancor();
                    matricula = prestador.GetMatriculaFromIdPre(model.IdPre);
                    return(sancor.Elegibilidad(model.Credencial));

                case 10:
                    var lyf   = new OSLuzFuerza();
                    var datos = prestador.GetInfoFromIdPre(model.IdPre);

                    Afiliado afiliado = lyf.Eligibilidad(model.Credencial, Convert.ToInt32(datos.Matricula)).Result;
                    if (!afiliado.HasError)
                    {
                        Authorize autoriza = new Authorize(model.OsId, model.IdPre, model.IdPre, model.Credencial, string.Empty, new List <Prestacion>(), model.UserId);

                        autoriza.AfiliadoNombre = afiliado.Name;
                        autoriza.AfiliadoPlan   = "";

                        autoriza.Efector           = new Efector();
                        autoriza.Efector.Matricula = matricula;
                        autoriza.Efector.Name      = datos.Name;

                        autoriza.Prestaciones = new List <Prestacion>();
                        var presta = new Prestacion();
                        presta.Cant        = 1;
                        presta.CodPres     = "420101";
                        presta.Descripcion = "CONSULTA MEDICA";

                        autoriza.Prestaciones.Add(presta);

                        var autorizacionOs = lyf.Autorizar(autoriza, afiliado.Plan);

                        if (!autorizacionOs.HasError)
                        {
                            var autorizacionRepository = new AutorizacionRepository();
                            var authNr = autorizacionRepository.Autorizar(autorizacionOs);
                            afiliado.Nr = authNr.ToString();
                        }
                    }
                    else
                    {
                        if (afiliado.Name == "afiliado inexistente")
                        {
                            afiliado.HasError = false;
                        }
                        else
                        {
                            if (afiliado.Name == "afiliado con 2 consultas realizadas en el mes")
                            {
                                afiliado.Name = "El afiliado supero el límite de consumo mensual. Por favor digerirse a las oficinas de la Obra Social para la autorización de la práctica. ";
                            }
                            else
                            {
                                if (afiliado.Name != "Error el formato del carnet es incorrecto! Ej. xx-xxxxx-x/xx")
                                {
                                    afiliado.SetError(GetType().Name, 0, "Luz y Fuerza: " + afiliado.Name, string.Empty, model.Credencial + ";" + datos.Matricula, string.Empty);
                                    afiliado.Name = "Se ha producido un error desconocido. Por favor comunicarse con el Área de Sistemas del Circulo Medico de Salta";
                                }
                            }
                        }
                    }

                    afiliado.Plan = "";
                    return(afiliado);
                    //case 11:
                    //    var os = new OSOspatrones();
                    //    matricula = prestador.GetMatriculaFromIdPre(model.IdPre);
                    //    return os.Eligibilidad(model.Credencial, matricula);
                }
            }
            catch (Exception ex)
            {
                var errors = new Errores();
                errors.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, model, string.Empty);
            }
            return(new Afiliado());
        }
        private IEnumerable <ReportParameter> _getParametrosGeneralesReporte()
        {
            WSInfoCarreras.ParametrosCarrera pc = this._getParametrosCarrera();
            List <ReportParameter>           lstPrmRptHorarioAcademico = new List <ReportParameter>();
            string lblFacultad = "FACULTAD:";
            string lblCarrera  = "CARRERA:";
            string lblEscuela  = "ESCUELA:";
            string facultad    = default(string);
            string carrera     = default(string);
            string escuela     = default(string);
            string strDocente  = default(string);

            try
            {
                ReportParameter prmRptHorarioAcademico = new ReportParameter();
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strPeriodoAcademico",
                                                                  _dsPeriodoVigente.Periodos[0]["strDescripcion"].ToString().ToUpper()));
                strDocente = getNombreDocente();
                switch (UsuarioActual.CarreraActual.TipoEntidad.ToString())
                {
                case "CAR":
                    facultad = pc.NombreFacultad;
                    carrera  = pc.NombreCarrera;
                    escuela  = pc.NombreEscuela;
                    break;

                case "CAA":
                    lblFacultad = "";
                    lblCarrera  = "";
                    lblEscuela  = "";
                    facultad    = pc.NombreFacultad;
                    carrera     = pc.NombreCarrera;
                    escuela     = "";
                    break;
                }
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strInstitucion",
                                                                  Language.es_ES.STR_INSTITUCION));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblHorarioAcademico",
                                                                  Language.es_ES.STR_HORARIO_ACADEMICO));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblHorarioExamenes",
                                                                  Language.es_ES.STR_HORARIO_EXAMENES));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblPeriodoAcademico",
                                                                  Language.es_ES.STR_PERIODO_ACADEMICO));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblFacultad",
                                                                  lblFacultad));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblCarrera",
                                                                  lblCarrera));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strLblEscuela",
                                                                  lblEscuela));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strFacultad",
                                                                  facultad));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strEscuela",
                                                                  carrera));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strCarrera",
                                                                  escuela));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strDocente",
                                                                  strDocente));
                lstPrmRptHorarioAcademico.Add(new ReportParameter("strFuente",
                                                                  Language.es_ES.STR_FUENTE_REPORTE));
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "_getDatosGeneralesReporte");
            }
            return(lstPrmRptHorarioAcademico);
        }
        public string getJson_EvaluacionActiva()
        {
            string ea                  = string.Empty;
            string opEdicionNota       = string.Empty;
            string opEdicionAsistencia = string.Empty;
            string opFormatoFila       = string.Empty;

            try
            {
                opEdicionNota       = ", \"editable\": true, \"edittype\": \"text\", \"editoptions\": { \"size\": \"2\", \"maxlength\": \"2\" }, \"editrules\": { \"custom\": \"true\", \"custom_func\": \"validarNota\" }";
                opEdicionAsistencia = ", \"editable\": true, \"edittype\": \"text\", \"editoptions\": { \"size\": \"2\", \"maxlength\": \"4\" }, \"editrules\": { \"custom\": \"true\", \"custom_func\": \"validarAsistencia\" }";
                opFormatoFila       = ", \"formatter\": { \"integer\" : { \"thousandsSeparator\": \"\" } }";

                ea += "[{ \"name\": \"No\", \"index\": \"No\", \"label\": \"No\", \"align\": \"center\", \"width\": \"30\", \"sortable\": false },";
                ea += "	{ \"name\": \"sintCodMatricula\", \"key\": true, \"hidden\": true },";
                ea += "	{ \"name\": \"NombreEstudiante\", \"label\": \"" + Language.es_ES.EST_TB_COL_ESTUDIANTE + "\", \"align\": \"left\", \"width\": \"300\", \"sortable\": false },";
                ea += "	{ \"name\": \"Nivel\", \"align\": \"center\", \"width\": \"70\", \"sortable\": false },";
                ea += "	{ \"name\": \"bytNumMat\", \"label\": \"" + Language.es_ES.EST_TB_COL_MATRICULA + "\", \"align\": \"center\", \"width\": \"70\", \"sortable\": false },";

                //  Gestion de Parcial 01
                if (this.parcialActivo == "1")
                {
                    ea += "	{ \"name\": \"bytNota1\", \"label\": \"" + Language.es_ES.EST_TB_COL_NOTA_UNO + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\"" + opFormatoFila + opEdicionNota + "},";
                }
                else
                {
                    ea += "	{ \"name\": \"bytNota1\", \"label\": \"" + Language.es_ES.EST_TB_COL_NOTA_UNO + "\", \"sortable\": false, \"align\": \"center\", \"width\": \"70\"},";
                }

                //  Gestion de Parcial 02
                if (this.parcialActivo == "2")
                {
                    ea += "	{ \"name\": \"bytNota2\", \"label\": \"" + Language.es_ES.EST_TB_COL_NOTA_DOS + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\" " + opEdicionNota + "},";
                }
                else
                {
                    ea += "	{ \"name\": \"bytNota2\", \"label\": \"" + Language.es_ES.EST_TB_COL_NOTA_DOS + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\"},";
                }

                //  Gestion de Parcial 03
                if (this.parcialActivo == "3")
                {
                    ea += "	{ \"name\": \"bytNota3\", \"label\": \"" + Language.es_ES.EST_TB_COL_NOTA_TRES + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\" " + opEdicionNota + "},";
                }
                else
                {
                    ea += "	{ \"name\": \"bytNota3\", \"label\": \"" + Language.es_ES.EST_TB_COL_NOTA_TRES + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\"},";
                }

                ea += "	{ \"name\": \"Total\", \"label\": \"" + Language.es_ES.EST_TB_COL_TOTAL + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\" },";

                //  Gestion de Porciento de asistencia
                ea += "	{ \"name\": \"bytAsistencia\", \"label\": \"" + Language.es_ES.EST_TB_COL_PORCIENTO_ASISTENCIA + "\", \"align\": \"center\", \"sortable\": false, \"width\": \"70\" " + opEdicionAsistencia + " },";

                ea += "	{ \"name\": \"strObservaciones\", \"label\": \"" + Language.es_ES.EST_TB_COL_OBSERVACION + "\", \"align\": \"left\", \"sortable\": false, \"width\": \"150\" }]";
            }
            catch (Exception ex)
            {
                Errores err = new Errores();
                err.SetError(ex, "getJson_EvaluacionActiva");
            }

            return(ea);
        }