Exemplo n.º 1
0
 public bool ActualizarDB(List <Aca_Estudiante_x_Alergia_Info> lstAlergia, ref string msj)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             foreach (var item in lstAlergia)
             {
                 var vwalergia = Base.vwAca_estudiante_x_Alergia.FirstOrDefault(a => a.IdInstitucion == item.IdInstitucion &&
                                                                                a.IdEstudiante == item.IdEstudiante &&
                                                                                a.IdAlergia_catalogo == item.IdAlergiaCatalogo);
                 if (item.Esta_en_Base == "S")
                 {// Actualizar vwalergia
                     var alergia = Base.Aca_estudiante_x_Alergia.FirstOrDefault(a => a.IdInstitucion == item.IdInstitucion &&
                                                                                a.IdEstudiante == item.IdEstudiante &&
                                                                                a.IdAlergia_catalogo == item.IdAlergiaCatalogo);
                     alergia.activo      = item.Activo;
                     alergia.descripcion = item.Comentario;
                     Base.SaveChanges();
                 }
                 else
                 {
                     // Insertar
                     if (item.Activo == true)
                     {
                         Aca_estudiante_x_Alergia estAlergia = new Aca_estudiante_x_Alergia();
                         estAlergia.IdInstitucion      = item.IdInstitucion;
                         estAlergia.IdEstudiante       = item.IdEstudiante;
                         estAlergia.descripcion        = item.Comentario;
                         estAlergia.activo             = item.Activo;
                         estAlergia.IdAlergia_catalogo = item.IdAlergiaCatalogo;
                         Base.Aca_estudiante_x_Alergia.Add(estAlergia);
                         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());
     }
 }
Exemplo n.º 2
0
        public Boolean ActualizarDB(Aca_Beca_Info info, ref string msj)
        {
            try
            {
                using (Entities_Academico context = new Entities_Academico())
                {
                    var iBeca = context.Aca_Beca.FirstOrDefault(obj => obj.IdInstitucion == info.IdInstitucion &&
                                                                obj.IdBeca == info.IdBeca);

                    if (iBeca != null)
                    {
                        iBeca.nom_beca   = info.nom_beca;
                        iBeca.porcentaje = info.porcentaje;
                        iBeca.estado     = info.estado;

                        iBeca.Fecha_UltMod    = DateTime.Now;
                        iBeca.IdUsuarioUltMod = info.IdUsuarioUltMod;

                        context.SaveChanges();
                        msj = "Se ha procedido actualizar la beca #: " + info.IdBeca.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);
                msj = ex.InnerException + " " + ex.Message;
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msj);
                msj = "Se ha producido el siguiente error: " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
 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());
     }
 }
Exemplo n.º 4
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());
            }
        }
Exemplo n.º 5
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());
     }
 }
Exemplo n.º 6
0
        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());
            }
        }
Exemplo n.º 7
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());
     }
 }
Exemplo n.º 8
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());
     }
 }
Exemplo n.º 9
0
 public bool GrabarDB(Aca_Catalogo_Info info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_Catalogo addressCatal = new Aca_Catalogo();
             addressCatal.IdCatalogo      = info.IdCatalogo;
             addressCatal.IdTipoCatalogo  = info.IdTipoCatalogo;
             addressCatal.Descripcion     = info.Descripcion;
             addressCatal.Orden           = info.Orden;
             addressCatal.Estado          = info.Estado;
             addressCatal.FechaUltMod     = DateTime.Now;
             addressCatal.IdUsuarioUltMod = info.IdUsuarioUltMod;
             Base.Aca_Catalogo.Add(addressCatal);
             Base.SaveChanges();
             mensaje = "Se ha procedido a grabar el Catálogo #: " + info.IdCatalogo.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;
         mensaje = "Error no se grabó ";
         throw new Exception(ex.ToString());
     }
 }
Exemplo n.º 10
0
 public bool GrabarDB(Aca_RubroTipo_Info info, ref int idTipoRubro, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_Rubro_Tipo addressRubro = new Aca_Rubro_Tipo();
             idTipoRubro = GetId();
             addressRubro.IdTipoRubro               = idTipoRubro;
             addressRubro.codTipoRubro              = string.IsNullOrEmpty(info.CodTipoRubro) ? idTipoRubro.ToString() : info.CodTipoRubro;
             addressRubro.descripcion_tipo          = info.DescripcionTipoRubro;
             addressRubro.estado                    = info.Estado;
             addressRubro.IdRubroComportamiento_cat = info.IdRubroComportamiento_cat;
             addressRubro.FechaCreacion             = DateTime.Now;
             addressRubro.UsuarioCreacion           = info.UsuarioCreacion;
             Base.Aca_Rubro_Tipo.Add(addressRubro);
             Base.SaveChanges();
             mensaje = "Se ha procedido a grabar el Tipo Rubro #: " + idTipoRubro.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());
     }
 }
Exemplo n.º 11
0
        public bool ActualizarDB(Aca_RubroTipo_Info info, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vRubro = Base.Aca_Rubro_Tipo.FirstOrDefault(j => j.IdTipoRubro == info.IdTipoRubro);

                    if (vRubro != null)
                    {
                        vRubro.codTipoRubro              = string.IsNullOrEmpty(info.CodTipoRubro) ? info.IdTipoRubro.ToString() : info.CodTipoRubro == "0" ? info.IdTipoRubro.ToString() : info.CodTipoRubro;
                        vRubro.descripcion_tipo          = info.DescripcionTipoRubro;
                        vRubro.IdRubroComportamiento_cat = info.IdRubroComportamiento_cat;
                        vRubro.UsuarioModificacion       = info.UsuarioModificacion;
                        vRubro.FechaModificacion         = DateTime.Now;
                        vRubro.estado = info.Estado;
                        Base.SaveChanges();
                        mensaje = "Se ha procedido actualizar el Tipo Rubro #: " + info.IdTipoRubro.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());
            }
        }
 public bool GuardarDB(Aca_InstitucionFinanciera_Info info, ref int idInstitucionFinanciera, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_InstitucionFinanciera vInstitucionF = new Aca_InstitucionFinanciera();
             vInstitucionF.IdTipoCuenta_catalogo  = info.IdTipoCuentaCatalogo;
             idInstitucionFinanciera              = GetId();
             vInstitucionF.IdInstitucionFinaciera = idInstitucionFinanciera;
             vInstitucionF.CodigoInstitucion      = info.CodigoInstitucion;
             vInstitucionF.CodAlterno             = info.CodigoAlterno;
             vInstitucionF.NombreAlterno          = info.NombreAlterno;
             vInstitucionF.NombreInstitucion      = info.NombreInstitucion;
             vInstitucionF.Porc_comision          = info.Porc_comision;
             vInstitucionF.Estado          = info.Estado;
             vInstitucionF.UsuarioCreacion = info.UsuarioCreacion;
             vInstitucionF.FechaCreacion   = DateTime.Now;
             Base.Aca_InstitucionFinanciera.Add(vInstitucionF);
             Base.SaveChanges();
             mensaje = "Se ha procedido a grabar la Institución Financiera " + idInstitucionFinanciera.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 = "";
         throw new Exception(ex.InnerException.ToString());
     }
 }
Exemplo n.º 13
0
        public Boolean GuardarDB(Aca_curso_x_Aca_Rubro_Info Info, ref string mensaje)
        {
            bool resultado = false;

            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    Aca_curso_x_Aca_Rubro _Info = new Aca_curso_x_Aca_Rubro();
                    _Info.IdCurso     = Info.IdCurso;
                    _Info.IdRubro     = Info.IdRubro;
                    _Info.observacion = (Info.observacion == null) ? "" : Info.observacion;
                    Base.Aca_curso_x_Aca_Rubro.Add(_Info);
                    Base.SaveChanges();
                    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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemplo n.º 14
0
 public bool AnularDB(fa_factura_aca_Info info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             var address = Base.fa_factura_aca.FirstOrDefault(o => o.IdInstitucion == info.IdInstitucion && o.IdCbteVta == info.IdCbteVta);
             if (address != null)
             {
                 Base.SaveChanges();
                 mensaje = "Se ha procedido actualizar el periodo lectivo 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());
     }
 }
Exemplo n.º 15
0
        public bool AnularBD(Aca_contrato_x_estudiante_det_beca_Info Info)
        {
            try
            {
                bool resultado = false;
                using (Entities_Academico context = new Entities_Academico())
                {
                    var Select = context.Aca_Contrato_x_Estudiante_det_Beca.FirstOrDefault(a => a.IdInstitucion == Info.IdInstitucion && a.IdContrato == Info.IdContrato &&
                                                                                           a.IdRubro == Info.IdRubro && a.IdDescuento == Info.IdDescuento && a.IdAnioLectivo_Per == Info.IdAnioLectivo_Per && a.IdBeca == Info.IdBeca);

                    if (Select != null)
                    {
                        Select.IdUsuarioUltAnulo = Info.IdUsuarioUltAnulo;
                        Select.FechaAnulacion    = DateTime.Now;
                        Select.estado            = false;
                        context.SaveChanges();
                        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);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref msj);
                msj = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        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());
            }
        }
Exemplo n.º 17
0
 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());
     }
 }
Exemplo n.º 18
0
 public bool ActualizarDB(Aca_Catalogo_Info info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             var vcatalogo = Base.Aca_Catalogo.FirstOrDefault(c => c.IdCatalogo == info.IdCatalogo);
             if (vcatalogo != null)
             {
                 vcatalogo.IdTipoCatalogo  = info.IdTipoCatalogo;
                 vcatalogo.Descripcion     = info.Descripcion;
                 vcatalogo.Orden           = info.Orden;
                 vcatalogo.FechaUltMod     = info.FechaUltMod;
                 vcatalogo.IdUsuarioUltMod = info.IdUsuarioUltMod;
                 vcatalogo.Estado          = info.Estado;
                 Base.SaveChanges();
                 mensaje = "Se ha procedido actualizar el Catálogo #: " + info.IdTipoCatalogo.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;
         mensaje = "Error no se grabó ";
         throw new Exception(ex.ToString());
     }
 }
Exemplo n.º 19
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());
     }
 }
Exemplo n.º 20
0
 public bool AnularDB(Aca_Catalogo_Info info, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             var address = Base.Aca_Catalogo.FirstOrDefault(a => a.IdCatalogo == info.IdCatalogo);
             if (address != null)
             {
                 address.Estado          = "I";
                 address.Fecha_UltAnu    = DateTime.Now;
                 address.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                 address.MotiAnula       = info.MotiAnula;
                 Base.SaveChanges();
                 mensaje = "Se ha procedido anular Catálogo #: " + info.IdCatalogo.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;
         mensaje = "Error no se anulo ";
         throw new Exception(ex.ToString());
     }
 }
Exemplo n.º 21
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());
     }
 }
Exemplo n.º 22
0
        public bool ActualizarDB(Aca_Contrato_x_Estudiante_det_Info info, ref string mensaje)
        {
            try
            {
                using (Entities_Academico Base = new Entities_Academico())
                {
                    var vSeccion = Base.Aca_Contrato_x_Estudiante_det.FirstOrDefault(j => j.IdInstitucion == info.IdInstitucion && j.IdContrato == info.IdContrato && j.IdRubro == info.IdRubro && j.IdInstitucion_Per == info.IdInstitucion_Per && j.IdAnioLectivo_Per == info.IdAnioLectivo_Per && j.IdPeriodo_Per == info.IdPeriodo_Per);
                    if (vSeccion != null)
                    {
                        //vSeccion.IdSede = info.IdSede;

                        vSeccion.estado              = info.estado_rubro_contrato;
                        vSeccion.FechaModificacion   = DateTime.Now;
                        vSeccion.UsuarioModificacion = info.UsuarioModificacion;

                        Base.SaveChanges();
                        mensaje = "Se ha procedido actualizar el Contrato_x_Estudiante #: " + info.IdContrato.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());
            }
        }
Exemplo n.º 23
0
 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());
     }
 }
Exemplo n.º 24
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());
     }
 }
Exemplo n.º 25
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());
            }
        }
Exemplo n.º 26
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());
     }
 }
 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());
     }
 }
Exemplo n.º 28
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());
            }
        }
 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());
     }
 }
 public bool GrabarDB(Aca_Matricula_Tipo_Documento_Info info, ref int IdTipoDocumento, ref string mensaje)
 {
     try
     {
         using (Entities_Academico Base = new Entities_Academico())
         {
             Aca_matricula_Tipo_documento matriTipoDoc = new Aca_matricula_Tipo_documento();
             IdTipoDocumento = GetId();
             matriTipoDoc.IdTipoDocumento     = IdTipoDocumento;
             matriTipoDoc.codTipoDocumento    = string.IsNullOrEmpty(info.CodTipoDocumento) ? IdTipoDocumento.ToString() : info.CodTipoDocumento;
             matriTipoDoc.descripcion         = info.Descripcion;
             matriTipoDoc.Archivo             = info.Archivo;
             matriTipoDoc.FechaCreacion       = DateTime.Now;
             matriTipoDoc.UsuarioCreacion     = info.UsuarioCreacion;
             matriTipoDoc.FechaModificacion   = DateTime.Now;
             matriTipoDoc.UsuarioModificacion = info.UsuarioModificacion;
             matriTipoDoc.Estado = info.Estado;
             Base.Aca_matricula_Tipo_documento.Add(matriTipoDoc);
             Base.SaveChanges();
             mensaje = "Se ha procedido a grabar tipo documento #: " + IdTipoDocumento.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());
     }
 }