コード例 #1
0
        public Boolean ExistePeriodo(int IdInstitucion, int IdPeriodo)
        {
            try
            {
                Boolean            Existe  = false;
                Entities_Academico context = new Entities_Academico();

                var select = from A in context.Aca_Pre_Facturacion
                             where A.IdInstitucion == IdInstitucion
                             //&& A.ip == IdPeriodo
                             select A;

                if (select.Count() == 0)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                string array = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", array, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #2
0
 public Boolean Get_List_Rubro_Grupo_FE_Existe(Aca_RubroGrupoFE_Info Info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico context = new Entities_Academico())
         {
             var select = from q in context.Aca_Rubro_Grupo_FE
                          where q.CodGrupoFE == Info.CodGrupoFE
                          select q;
             if (select.Count() > 0)
             {
                 return(false);
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         string arreglo      = ToString();
         string MensajeError = string.Empty;
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         MensajeError = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         throw new Exception(ex.ToString());
     }
 }
コード例 #3
0
 public bool GrabarDB(Aca_Matricula_x_Documento_Info info, Aca_Matricula_Info infoMatricula, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_matricula_x_documento matriculaDoc = new Aca_matricula_x_documento();
             matriculaDoc.IdInstitucion   = info.IdInstitucion == 0?infoMatricula.IdInstitucion:info.IdInstitucion;
             matriculaDoc.IdMatricula     = info.IdMatricula == 0?infoMatricula.IdMatricula:info.IdMatricula;
             matriculaDoc.IdSede          = info.IdSede == 0?infoMatricula.IdSede:info.IdSede;
             matriculaDoc.IdTipoDocumento = info.IdTipoDocumento;
             matriculaDoc.Observacion     = info.Observacion;
             matriculaDoc.UsuarioCreacion = infoMatricula.UsuarioCreacion;
             matriculaDoc.FechaCreacion   = DateTime.Now;
             matriculaDoc.Estado          = info.Estado;
             Base.Aca_matricula_x_documento.Add(matriculaDoc);
             Base.SaveChanges();
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         //saca la exceopción controlada a la proxima capa
         throw new Exception(ex.ToString());
     }
 }
コード例 #4
0
 public Boolean AnularDB(Aca_RubroGrupoFE_Info Info, ref string msg)
 {
     try
     {
         using (Entities_Academico context = new Entities_Academico())
         {
             var address = context.Aca_Rubro_Grupo_FE.FirstOrDefault(a => a.IdGrupoFE == Info.IdGrupoFE);
             if (address != null)
             {
                 address.estado           = "I";
                 address.UsuarioAnulacion = Info.UsuarioAnulacion;
                 address.FechaAnulacion   = DateTime.Now;
                 address.MotivoAnulacion  = Info.MotivoAnulacion;
                 context.SaveChanges();
                 msg = "Se ha anulado el registro: " + Info.IdGrupoFE.ToString() + " satisfactoriamente";
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         msg = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         msg = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #5
0
        public Boolean ActualizarDB(Aca_RubroGrupoFE_Info Info, ref string msg)
        {
            try
            {
                using (Entities_Academico contexto = new Entities_Academico())
                {
                    var rubros = contexto.Aca_Rubro_Grupo_FE.FirstOrDefault(a => a.IdGrupoFE == Info.IdGrupoFE);

                    if (rubros != null)
                    {
                        rubros.CodGrupoFE          = string.IsNullOrEmpty(Info.CodGrupoFE) ? Info.IdGrupoFE.ToString() : Info.CodGrupoFE == "0" ? Info.IdGrupoFE.ToString() : Info.CodGrupoFE;
                        rubros.nom_GrupoFe         = Info.nom_GrupoFe;
                        rubros.FechaModificacion   = DateTime.Now;
                        rubros.UsuarioModificacion = Info.UsuarioModificacion;
                        rubros.estado = Info.estado;
                        contexto.SaveChanges();
                        msg = "Se ha modificado el registro: " + Info.IdGrupoFE.ToString() + " exitosamente";
                    }
                    return(true);
                }
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                msg = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                msg = "Se ha producido el siguiente error: " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #6
0
 public bool AnularDB(Aca_Anio_Lectivo_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Academico context = new Entities_Academico())
         {
             var address = context.Aca_Anio_Lectivo.FirstOrDefault(a => a.IdInstitucion == info.IdInstitucion && a.IdAnioLectivo == info.IdAnioLectivo);
             if (address != null)
             {
                 address.Estado           = "I";
                 address.FechaAnulacion   = DateTime.Now;
                 address.UsuarioAnulacion = info.UsuarioAnulacion;
                 address.MotivoAnulacion  = info.MotivoAnulacion;
                 context.SaveChanges();
                 mensaje   = "Se ha procedido anular el periodo leactivo: " + info.IdAnioLectivo.ToString() + " exitosamente.";
                 resultado = true;
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #7
0
ファイル: Aca_Curso_Data.cs プロジェクト: arocajorge/ERPFJ
        public bool ActualizarDB(Aca_Curso_Info info, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vSeccion = Base.Aca_curso.FirstOrDefault(j => j.IdCurso == info.IdCurso);
                    if (vSeccion != null)
                    {
                        vSeccion.IdSeccion           = info.IdSeccion;
                        vSeccion.CodCurso            = string.IsNullOrEmpty(info.CodCurso) ? info.IdCurso.ToString() : info.CodCurso;
                        vSeccion.CodAlternoCur       = string.IsNullOrEmpty(info.CodAlternoCurso) ? "" : info.CodAlternoCurso;
                        vSeccion.Descripcion_cur     = info.DescripcionCurso;
                        vSeccion.estado              = info.Estado;
                        vSeccion.FechaModificacion   = DateTime.Now;
                        vSeccion.UsuarioModificacion = info.UsuarioModificacion;

                        Base.SaveChanges();
                        mensaje = "Se ha procedido actualizar el Curso #: " + info.IdCurso.ToString() + " exitosamente.";
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #8
0
        public bool ActualizarDB(int IdInstitucion, decimal IdContrato, bool estado_contrato_pago_garantizado)
        {
            try
            {
                using (Entities_Academico Context = new Entities_Academico())
                {
                    Aca_Contrato_x_Estudiante Entity = Context.Aca_Contrato_x_Estudiante.FirstOrDefault(q => q.IdInstitucion == IdInstitucion && q.IdContrato == IdContrato);
                    if (Entity != null)
                    {
                        Entity.estado_contrato_pago_garantizado = estado_contrato_pago_garantizado;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #9
0
        public decimal GetId_RepresentateEconomico_x_Estudiante(decimal IdEstudiante)
        {
            decimal IdPersona_RepEco = 0;

            try
            {
                Entities_Academico db = new Entities_Academico();
                var select            = (from F in db.vwAca_Familiar_x_Estudiante_RepEco
                                         where F.IdEstudiante == IdEstudiante && F.activo == true
                                         orderby F.IdEstudiante
                                         select new { F.IdPersona }).SingleOrDefault();
                if (select != null)
                {
                    IdPersona_RepEco = Convert.ToDecimal(select.IdPersona);
                }
                return(IdPersona_RepEco);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                MensajeError = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                throw new Exception(ex.InnerException.ToString());
            }
        }
コード例 #10
0
        public bool ActualizarDB(Aca_Jornada_Info info, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vjornada = Base.Aca_Jornada.FirstOrDefault(j => j.IdSede == info.IdSede && j.IdJornada == info.IdJornada);

                    if (vjornada != null)
                    {
                        vjornada.Descripcion_Jor     = info.DescripcionJornada;
                        vjornada.CodAlternoJor       = string.IsNullOrEmpty(info.CodAternoJornada) ? "" : info.CodAternoJornada;
                        vjornada.estado              = info.Estado;
                        vjornada.FechaModificacion   = DateTime.Now;
                        vjornada.UsuarioModificacion = info.UsuarioModificacion;

                        Base.SaveChanges();
                        mensaje = "Se ha procedido actualizar la Jornada #: " + info.IdJornada.ToString() + " exitosamente.";
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #11
0
        public int GetIdJornada(int idSeccion)
        {
            int idJornada = 0;

            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var seccion = from j in Base.Aca_Seccion
                                  where j.IdSeccion == idSeccion
                                  select j;
                    foreach (var item in seccion)
                    {
                        idJornada = item.IdJornada;
                    }
                }
                return(idJornada);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                string mensaje = string.Empty;
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #12
0
        public Aca_Tipo_mecanismo_de_pago_Info Get_Info_tipo_mecanismo_Pago(int IdTipoMecaPago)
        {
            try
            {
                Aca_Tipo_mecanismo_de_pago_Info infoTipo = new Aca_Tipo_mecanismo_de_pago_Info();
                Entities_Academico conex = new Entities_Academico();

                var meca = from q in conex.Aca_Tipo_Mecanismo_Pago
                           where q.Id_tipo_meca_pago == IdTipoMecaPago
                           select q;
                foreach (var item in meca)
                {
                    infoTipo.Id_tipo_meca_pago     = item.Id_tipo_meca_pago;
                    infoTipo.Id_tb_banco_x_mgbanco = item.Id_tb_banco_x_mgbanco;
                    infoTipo.nombre = item.Nombre;
                }
                return(infoTipo);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #13
0
        public List <Aca_Tipo_mecanismo_de_pago_Info> Get_Lista_tipo_mecanismo_Pago_x_Banco(decimal idBanco)
        {
            try
            {
                List <Aca_Tipo_mecanismo_de_pago_Info> Lista = new List <Aca_Tipo_mecanismo_de_pago_Info>();
                Entities_Academico conex = new Entities_Academico();

                var meca = from q in conex.Aca_Tipo_Mecanismo_Pago
                           where q.Id_tb_banco_x_mgbanco == idBanco
                           select q;
                foreach (var item in meca)
                {
                    Aca_Tipo_mecanismo_de_pago_Info info = new Aca_Tipo_mecanismo_de_pago_Info();
                    info.Id_tipo_meca_pago     = item.Id_tipo_meca_pago;
                    info.Id_tb_banco_x_mgbanco = item.Id_tb_banco_x_mgbanco;
                    info.nombre = item.Nombre;
                    Lista.Add(info);
                }
                return(Lista);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #14
0
 public bool GrabarDB(List <Aca_Estudiante_x_Alergia_Info> lstAlergia, decimal idEstudiante, int IdInstitucion, ref string msj)
 {
     try
     {
         Aca_estudiante_x_Alergia addressAlergia = new Aca_estudiante_x_Alergia();
         using (Entities_Academico Base = new Entities_Academico())
         {
             foreach (var item in lstAlergia)
             {
                 if (item.Activo == true)
                 {
                     addressAlergia = new Aca_estudiante_x_Alergia();
                     addressAlergia.IdInstitucion      = IdInstitucion;
                     addressAlergia.IdEstudiante       = idEstudiante;
                     addressAlergia.IdAlergia_catalogo = item.IdAlergiaCatalogo;
                     addressAlergia.descripcion        = item.Comentario;
                     addressAlergia.activo             = item.Activo;
                     Base.Aca_estudiante_x_Alergia.Add(addressAlergia);
                     Base.SaveChanges();
                 }
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msj);
         msj = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #15
0
 public bool Grabar(Aca_Anio_Lectivo_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_Anio_Lectivo address = new Aca_Anio_Lectivo();
             address.IdInstitucion   = info.IdInstitucion;
             address.IdAnioLectivo   = info.IdAnioLectivo;
             address.Descripcion     = info.Descripcion;
             address.FechaInicio     = info.FechaInicio;
             address.FechaFin        = info.FechaFin;
             address.Estado          = "A";
             address.FechaCreacion   = info.FechaCreacion;
             address.UsuarioCreacion = info.UsuarioCreacion;
             Base.Aca_Anio_Lectivo.Add(address);
             Base.SaveChanges();
             mensaje   = "Se ha procedido ingresar un nuevo periodo lectivo exitosamente ";
             resultado = true;
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #16
0
        public int getId(int IdInstitucion)
        {
            int Id = 0;

            try
            {
                Entities_Academico OEEstudiante = new Entities_Academico();
                int select = (from q in OEEstudiante.Aca_estudiante
                              where q.IdInstitucion == IdInstitucion
                              select q).Count();

                if (select == 0)
                {
                    Id = 1;
                }
                else
                {
                    var select_em = (from q in OEEstudiante.Aca_estudiante
                                     where q.IdInstitucion == IdInstitucion
                                     select q.IdEstudiante).Max();
                    Id = Convert.ToInt32(select_em.ToString()) + 1;
                }
                return(Id);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                //saca la exceopción controlada a la proxima capa
                throw new Exception(ex.ToString());
            }
        }
コード例 #17
0
 public bool Actualizar(Aca_Anio_Lectivo_Info info, ref string mensaje)
 {
     try
     {
         bool resultado = false;
         using (Entities_Academico Base = new Entities_Academico())
         {
             var anioLectivo = Base.Aca_Anio_Lectivo.FirstOrDefault(o => o.IdInstitucion == info.IdInstitucion && o.IdAnioLectivo == info.IdAnioLectivo);
             if (anioLectivo != null)
             {
                 anioLectivo.Descripcion         = info.Descripcion;
                 anioLectivo.FechaInicio         = info.FechaInicio;
                 anioLectivo.FechaFin            = info.FechaFin;
                 anioLectivo.Estado              = info.Estado;
                 anioLectivo.FechaModificacion   = info.FechaModificacion;
                 anioLectivo.UsuarioModificacion = info.UsuarioModificacion;
                 Base.SaveChanges();
                 mensaje   = "Se ha procedido actualizar el periodo lectivo exitosamente ";
                 resultado = true;
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #18
0
        public int GetIdInstitucion(int IdEmpresa)
        {
            int IdInstitucion = 0;

            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vIntitucion = Base.Aca_Institucion.FirstOrDefault(i => i.IdEmpresa == IdEmpresa);
                    if (vIntitucion != null)
                    {
                        IdInstitucion = vIntitucion.IdInstitucion;
                    }
                    else
                    {
                        IdInstitucion = 0;
                    }
                }
                return(IdInstitucion);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                string mensaje = string.Empty;
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #19
0
 public Aca_Anio_Lectivo_Info Get_Info_Lectivo_Activo(int IdInstitucion)
 {
     try
     {
         Aca_Anio_Lectivo_Info Info = new Aca_Anio_Lectivo_Info();
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_Anio_Lectivo Anio = Base.Aca_Anio_Lectivo.FirstOrDefault(v => v.IdInstitucion == v.IdInstitucion && v.Estado == "A");
             if (Anio != null)
             {
                 Info.IdInstitucion = Anio.IdInstitucion;
                 Info.IdAnioLectivo = Anio.IdAnioLectivo;
                 Info.Descripcion   = Anio.Descripcion;
                 Info.FechaInicio   = Anio.FechaInicio;
                 Info.FechaFin      = Anio.FechaFin;
             }
         }
         return(Info);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         //saca la exceopción controlada a la proxima capa
         throw new Exception(ex.ToString());
     }
 }
コード例 #20
0
 public bool  ExisteInstitucion(int idEmpresa)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             int valida = (from v in Base.Aca_Institucion
                           where v.IdEmpresa == idEmpresa && v.Estado != "I"
                           select v).Count();
             if (valida == 0)
             {
                 return(true);
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         string mensaje = string.Empty;
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #21
0
ファイル: Aca_Curso_Data.cs プロジェクト: arocajorge/ERPFJ
 public Boolean AnularDB(Aca_Curso_Info info, ref string msg)
 {
     try
     {
         using (Entities_Academico context = new Entities_Academico())
         {
             var address = context.Aca_curso.FirstOrDefault(a => a.IdCurso == info.IdCurso);
             if (address != null)
             {
                 address.estado           = "I";
                 address.FechaAnulacion   = DateTime.Now;
                 address.UsuarioAnulacion = info.UsuarioAnulacion;
                 address.MotivoAnulacion  = info.MotivoAnulacion;
                 context.SaveChanges();
                 msg = "Se ha procedido anular Curso #: " + info.IdCurso.ToString() + " exitosamente.";
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         msg = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         msg = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #22
0
ファイル: Aca_Seccion_Data.cs プロジェクト: arocajorge/ERPFJ
 public bool GrabarDB(Aca_Seccion_Info info, ref int idSeccion, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_Seccion addressSecc = new Aca_Seccion();
             addressSecc.IdJornada           = info.IdJornada;
             idSeccion                       = GetId();
             addressSecc.IdSeccion           = idSeccion;
             addressSecc.CodSeccion          = string.IsNullOrEmpty(info.CodSeccion)?idSeccion.ToString():info.CodSeccion;
             addressSecc.CodAlterno_Sec      = string.IsNullOrEmpty(info.CodAlternoSeccion)?"":info.CodAlternoSeccion;
             addressSecc.Descripcion_secc    = info.DescripcionSeccion;
             addressSecc.estado              = info.Estado;
             addressSecc.FechaCreacion       = DateTime.Now;
             addressSecc.FechaModificacion   = DateTime.Now;
             addressSecc.UsuarioCreacion     = info.UsuarioCreacion;
             addressSecc.UsuarioModificacion = info.UsuarioModificacion;
             Base.Aca_Seccion.Add(addressSecc);
             Base.SaveChanges();
             mensaje = "Se ha procedido a grabar la Sección #: " + idSeccion.ToString() + " exitosamente.";
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #23
0
        public int GetIdRubro_Grupo_Fe()
        {
            int Id = 0;

            try
            {
                Entities_Academico Base = new Entities_Academico();
                int select = (from q in Base.Aca_Rubro_Grupo_FE
                              select q).Count();

                if (select == 0)
                {
                    Id = 1;
                }
                else
                {
                    var select_as = (from q in Base.Aca_Rubro_Grupo_FE
                                     select q.IdGrupoFE).Max();
                    Id = Convert.ToInt32(select_as.ToString()) + 1;
                }
                return(Id);
            }
            catch (Exception ex)
            {
                string arreglo      = ToString();
                string MensajeError = string.Empty;
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                MensajeError = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
                throw new Exception(ex.ToString());
            }
        }
コード例 #24
0
ファイル: Aca_Seccion_Data.cs プロジェクト: arocajorge/ERPFJ
        public int GetIdSeccion(int IdCurso)
        {
            int IdSeccion = 0;

            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var curso = from c in Base.Aca_curso
                                where c.IdCurso == IdCurso
                                select c;
                    foreach (var item in curso)
                    {
                        IdSeccion = item.IdSeccion;
                    }
                }
                return(IdSeccion);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                string mensaje = string.Empty;
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #25
0
        public Boolean GrabarDB(Aca_RubroGrupoFE_Info Info, ref int IdRubroGrupo, ref string msg)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    Aca_Rubro_Grupo_FE addressRubro = new Aca_Rubro_Grupo_FE();

                    IdRubroGrupo = GetIdRubro_Grupo_Fe();
                    addressRubro.IdInstitucion   = Info.IdInstitucion;
                    addressRubro.IdGrupoFE       = IdRubroGrupo;
                    addressRubro.CodGrupoFE      = string.IsNullOrEmpty(Info.CodGrupoFE) ? IdRubroGrupo.ToString() : Info.CodGrupoFE;
                    addressRubro.nom_GrupoFe     = Info.nom_GrupoFe;
                    addressRubro.estado          = Info.estado;
                    addressRubro.FechaCreacion   = DateTime.Now;
                    addressRubro.UsuarioCreacion = Info.UsuarioCreacion;
                    Base.Aca_Rubro_Grupo_FE.Add(addressRubro);
                    Base.SaveChanges();
                    msg = "El nuevo registro se guardo sin problema y se guargo con el número: " + IdRubroGrupo.ToString();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                msg = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
                msg = "Se ha producido el siguiente error: " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #26
0
 public bool GrabarDB(Aca_Documento_Bancario_x_Rep_Economico_x_estudiante_x_Matricula_Info info, ref string mensaje)
 {
     try
     {
         Eliminar(info, ref mensaje);
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_Documento_Bancario_x_Rep_Economico_x_estudiante_x_Matricula matriTipoDoc = new Aca_Documento_Bancario_x_Rep_Economico_x_estudiante_x_Matricula();
             matriTipoDoc.IdInstitucion         = info.IdInstitucion;
             matriTipoDoc.IdFamiliar            = info.IdFamiliar;
             matriTipoDoc.IdParentesco_cat      = info.IdParentesco_cat;
             matriTipoDoc.IdDocumento_Bancario  = info.IdDocumento_Bancario;
             matriTipoDoc.Id_tb_banco_x_mgbanco = info.Id_tb_banco_x_mgbanco;
             matriTipoDoc.Id_tipo_meca_pago     = info.Id_tipo_meca_pago;
             matriTipoDoc.IdMatricula           = info.IdMatricula;
             matriTipoDoc.IdEstudiante          = info.IdEstudiante;
             matriTipoDoc.Observacion           = info.Observacion;
             Base.Aca_Documento_Bancario_x_Rep_Economico_x_estudiante_x_Matricula.Add(matriTipoDoc);
             Base.SaveChanges();
             mensaje = "Se ha procedido a grabar   exitosamente.";
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #27
0
 public bool AnularDB(Aca_Matricula_x_Documento_Info info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             var matriculaDoc = Base.Aca_matricula_x_documento.FirstOrDefault(m => m.IdInstitucion == info.IdInstitucion &&
                                                                              m.IdMatricula == info.IdMatricula &&
                                                                              m.IdSede == info.IdSede &&
                                                                              m.IdTipoDocumento == info.IdTipoDocumento);
             if (matriculaDoc != null)
             {
                 matriculaDoc.Estado           = "I";
                 matriculaDoc.FechaAnulacion   = DateTime.Now;
                 matriculaDoc.UsuarioAnulacion = info.UsuarioAnulacion;
                 Base.SaveChanges();
                 mensaje = "Se ha procedido anular documento de la matricula #: " + info.IdMatricula.ToString() + " exitosamente.";
             }
             return(true);
         }
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         mensaje = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
コード例 #28
0
        public Aca_Aspirante_Info Get_Info_Aspirante(decimal IdPersona, ref string msj)
        {
            try
            {
                Entities_Academico Base = new Entities_Academico();
                var select_             = from C in Base.Aca_Aspirante
                                          where C.IdPersona == IdPersona
                                          select C;


                Aca_Aspirante_Info AspInfo = new Aca_Aspirante_Info();

                foreach (var item in select_)
                {
                    AspInfo.IdAspirante            = item.IdAspirante;
                    AspInfo.Persona_Info.IdPersona = item.IdPersona;
                    AspInfo.CodAspirante           = item.cod_aspirante;
                }

                return(AspInfo);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msj);
                msj = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
コード例 #29
0
 public bool ActualizarDB(Aca_Matricula_x_Documento_Info info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             var matriculaDoc = Base.Aca_matricula_x_documento.FirstOrDefault(m => m.IdInstitucion == info.IdInstitucion &&
                                                                              m.IdMatricula == info.IdMatricula &&
                                                                              m.IdSede == info.IdSede &&
                                                                              m.IdTipoDocumento == info.IdTipoDocumento);
             if (matriculaDoc != null)
             {
                 matriculaDoc.Archivo             = info.Archivo;
                 matriculaDoc.Observacion         = info.Observacion;
                 matriculaDoc.UsuarioModificacion = info.UsuarioModificacion;
                 matriculaDoc.FechaModificacion   = DateTime.Now;
                 Base.SaveChanges();
             }
         }
         return(true);
     }
     catch (Exception ex)
     {
         string arreglo      = ToString();
         string MensajeError = string.Empty;
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         MensajeError = ex.InnerException + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref MensajeError);
         throw new Exception(ex.InnerException.ToString());
     }
 }
コード例 #30
0
 public Boolean Modificar_Estado_Prefacturacion_DB(Aca_Pre_Facturacion_Info Info, ref string msg)
 {
     try
     {
         Boolean resultado = false;
         using (Entities_Academico context = new Entities_Academico())
         {
             var address = context.Aca_Pre_Facturacion.FirstOrDefault(
                 minfo => minfo.IdInstitucion == Info.IdInstitucion &&
                 minfo.IdPreFacturacion == Info.IdPreFacturacion
                 );
             if (address != null)
             {
                 address.Estado_Pre_factutacion_Cat = "FAC";
                 context.SaveChanges();
                 resultado = true;
             }
             else
             {
                 msg = "No se pudo modificar, ya que la consulta regreso vacia";
             }
         }
         return(resultado);
     }
     catch (Exception ex)
     {
         string array = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", array, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }