public List <vwtb_sis_Documento_Tipo_x_Disenio_Report_Info> Get_List_sis_Documento_Tipo_x_Disenio_Report(int IdEmpresa, string ApareceCombo_FileReporte)
        {
            try
            {
                List <vwtb_sis_Documento_Tipo_x_Disenio_Report_Info> lstDoc = new List <vwtb_sis_Documento_Tipo_x_Disenio_Report_Info>();

                using (EntitiesGeneral listado = new EntitiesGeneral())
                {
                    var select = from q in listado.vwtb_sis_Documento_Tipo_x_Disenio_Report
                                 where q.IdEmpresa == IdEmpresa &&
                                 q.ApareceCombo_FileReporte == ApareceCombo_FileReporte
                                 select q;

                    foreach (var item in select)
                    {
                        vwtb_sis_Documento_Tipo_x_Disenio_Report_Info Info = new vwtb_sis_Documento_Tipo_x_Disenio_Report_Info();
                        Info.IdEmpresa                = item.IdEmpresa;
                        Info.codDocumentoTipo         = item.codDocumentoTipo;
                        Info.descripcion              = item.descripcion;
                        Info.File_Disenio_Reporte     = item.File_Disenio_Reporte;
                        Info.ApareceCombo_FileReporte = item.ApareceCombo_FileReporte;

                        lstDoc.Add(Info);
                    }
                }

                return(lstDoc);
            }
            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());
            }
        }
Exemple #2
0
        public bool AnularDB(Grupo_Info info)
        {
            try
            {
                using (EntitiesGeneral db = new EntitiesGeneral())
                {
                    Grupo Entity = db.Grupo.Where(q => q.IdLinea == info.IdLinea && q.IdGrupo == info.IdGrupo).FirstOrDefault();
                    if (Entity == null)
                    {
                        return(false);
                    }

                    Entity.gr_Estado = false;
                    db.SaveChanges();
                }
                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public List <Oferta_Info> GetList(bool mostrar_anulados)
 {
     try
     {
         List <Oferta_Info> Lista;
         using (EntitiesGeneral db = new EntitiesGeneral())
         {
             if (mostrar_anulados)
             {
                 Lista = db.Oferta.Select(q => new Oferta_Info
                 {
                     IdOferta       = q.IdOferta,
                     IdProveedor    = q.IdProveedor,
                     IdSubasta      = q.IdSubasta,
                     of_Observacion = q.of_Observacion,
                     of_Plazo       = q.of_Plazo,
                     of_Total       = q.of_Total
                 }).ToList();
             }
             else
             {
                 Lista = db.Oferta.Where(q => q.of_Estado == true).Select(q => new Oferta_Info
                 {
                     IdOferta       = q.IdOferta,
                     IdProveedor    = q.IdProveedor,
                     IdSubasta      = q.IdSubasta,
                     of_Observacion = q.of_Observacion,
                     of_Plazo       = q.of_Plazo,
                     of_Total       = q.of_Total
                 }).ToList();
             }
         }
         return(Lista);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #4
0
        public List <tb_sis_impuesto_Info> Get_List_impuesto(string IdTipoImpuesto)
        {
            try
            {
                List <tb_sis_impuesto_Info> lst = new List <tb_sis_impuesto_Info>();

                EntitiesGeneral oEnti = new EntitiesGeneral();

                var bancos = from q in oEnti.tb_sis_Impuesto
                             where q.IdTipoImpuesto == IdTipoImpuesto
                             select q;
                foreach (var item in bancos)
                {
                    tb_sis_impuesto_Info info = new tb_sis_impuesto_Info();

                    info.IdCod_Impuesto   = item.IdCod_Impuesto;
                    info.nom_impuesto     = item.nom_impuesto;
                    info.Usado_en_Ventas  = item.Usado_en_Ventas;
                    info.Usado_en_Compras = item.Usado_en_Compras;
                    info.porcentaje       = item.porcentaje;
                    info.IdCodigo_SRI     = item.IdCodigo_SRI;
                    info.estado           = item.estado;
                    info.IdTipoImpuesto   = item.IdTipoImpuesto;


                    lst.Add(info);
                }
                return(lst);
            }
            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());
            }
        }
Exemple #5
0
        public List <Cl_NaturalezaPerso> Get_List_NaturalezaPer()
        {
            try
            {
                List <Cl_NaturalezaPerso> lEstC     = new List <Cl_NaturalezaPerso>();
                EntitiesGeneral           OCatalogo = new EntitiesGeneral();
                var Doc = from C in OCatalogo.tb_Catalogo
                          where C.IdTipoCatalogo == 5
                          orderby C.ca_orden
                          select C;


                foreach (var item in Doc)
                {
                    Cl_NaturalezaPerso Cbt = new Cl_NaturalezaPerso();
                    Cbt.id          = item.IdCatalogo;
                    Cbt.codigo      = item.CodCatalogo;
                    Cbt.descripcion = item.ca_descripcion;



                    lEstC.Add(Cbt);
                }



                return(lEstC);
            }
            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());
            }
        }
 public DataTable Get_DataSet_SQL(string sqlQuerry)
 {
     try
     {
         EntitiesGeneral EntitiesB  = new EntitiesGeneral();
         string          connString = ((System.Data.EntityClient.EntityConnection)EntitiesB.Database.Connection).StoreConnection.ConnectionString;
         SqlDataAdapter  da         = new SqlDataAdapter(sqlQuerry, connString);
         DataTable       ds         = new DataTable();
         da.Fill(ds);
         return(ds);
     }
     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());
     }
 }
        public List <tb_sis_Documento_Tipo_x_Empresa_Info> Get_List_sis_Documento_Tipo_x_Empresa(int IdEmpresa)
        {
            try
            {
                List <tb_sis_Documento_Tipo_x_Empresa_Info> lst = new List <tb_sis_Documento_Tipo_x_Empresa_Info>();
                tb_sis_Documento_Tipo_x_Empresa_Info        Info;
                EntitiesGeneral context = new EntitiesGeneral();
                var             address = from q in context.tb_sis_Documento_Tipo_x_Empresa
                                          where q.IdEmpresa == IdEmpresa
                                          orderby q.Posicion
                                          select q;

                foreach (var item in address)
                {
                    Info                          = new tb_sis_Documento_Tipo_x_Empresa_Info();
                    Info.IdEmpresa                = item.IdEmpresa;
                    Info.codDocumentoTipo         = item.codDocumentoTipo;
                    Info.ApareceComboFac_TipoFact = item.ApareceComboFac_TipoFact;
                    Info.ApareceComboFac_Import   = item.ApareceComboFac_Import;
                    Info.ApareceTalonario         = item.ApareceTalonario;
                    Info.Descripcion              = item.Descripcion;
                    Info.Posicion                 = item.Posicion;
                    Info.ApareceCombo_FileReporte = item.ApareceCombo_FileReporte;
                    lst.Add(Info);
                }
                return(lst);
            }
            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());
            }
        }
Exemple #8
0
        public Boolean Guardar_DB(tb_parroquia_Info Info_Pro, ref string IdParroquia, ref string msjError)
        {
            try
            {
                using (EntitiesGeneral Context = new EntitiesGeneral())
                {
                    var Address = new tb_parroquia();


                    Address.IdParroquia   = Info_Pro.IdParroquia = IdParroquia = GetId();
                    Address.cod_parroquia = (Info_Pro.cod_parroquia == "" || Info_Pro.cod_parroquia == null) ? Info_Pro.IdParroquia : Info_Pro.cod_parroquia;
                    Address.nom_parroquia = Info_Pro.nom_parroquia;
                    Address.estado        = true;

                    Address.IdCiudad_Canton = Info_Pro.IdCiudad_Canton;

                    Address.IdUsuario     = Info_Pro.IdUsuario;
                    Address.Fecha_Transac = Info_Pro.Fecha_Transac;
                    Address.nom_pc        = Info_Pro.nom_pc;
                    Address.ip            = Info_Pro.ip;

                    Context.tb_parroquia.Add(Address);
                    Context.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.ToString() + " " + ex.Message;
                msjError = mensaje;
                throw new Exception(ex.ToString());
            }
        }
Exemple #9
0
        public List <Tabla_Info> ObtenerTabla()
        {
            try
            {
                List <Tabla_Info> lM     = new List <Tabla_Info>();
                EntitiesGeneral   Otabla = new EntitiesGeneral();


                var selecttable = from A in Otabla.tb_Tabla
                                  select A;



                foreach (var item in selecttable)
                {
                    Tabla_Info t = new Tabla_Info();
                    t.IdTabla     = item.IdTabla;
                    t.Nombre      = item.Nombre;
                    t.IdModulo    = Convert.ToInt32(item.IdModulo);
                    t.TablaDB     = item.TablaDB;
                    t.NameControl = item.NameControl;
                    lM.Add(t);
                }

                return(lM);
            }

            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());
            }
        }
        public List <tb_transportista_Info> Get_List_transportista(int IdEmpresa)
        {
            try
            {
                List <tb_transportista_Info> lista = new List <tb_transportista_Info>();
                using (EntitiesGeneral context = new EntitiesGeneral())
                {
                    EntitiesGeneral ListTrans = new EntitiesGeneral();
                    var             datos     = from T in ListTrans.tb_transportista
                                                where T.IdEmpresa == IdEmpresa
                                                select T;
                    foreach (var item in datos)
                    {
                        tb_transportista_Info info = new tb_transportista_Info();
                        info.IdEmpresa         = item.IdEmpresa;
                        info.IdTransportista   = item.IdTransportista;
                        info.Cedula            = item.Cedula;
                        info.Nombre            = item.Nombre;
                        info.Estado            = item.Estado;
                        info.Placa             = item.Placa;
                        info.pe_nombreCompleto = 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());
            }
        }
Exemple #11
0
        public List <tb_parroquia_Info> Get_List_Parroquia()
        {
            try
            {
                List <tb_parroquia_Info> lstProvincia = new List <tb_parroquia_Info>();
                using (EntitiesGeneral Base = new EntitiesGeneral())
                {
                    var vProvincia = from p in Base.tb_parroquia
                                     select p;

                    foreach (var item in vProvincia)
                    {
                        tb_parroquia_Info infoParroquia = new tb_parroquia_Info();


                        infoParroquia.IdParroquia     = item.IdParroquia;
                        infoParroquia.cod_parroquia   = item.cod_parroquia;
                        infoParroquia.nom_parroquia   = item.nom_parroquia;
                        infoParroquia.estado          = item.estado;
                        infoParroquia.IdCiudad_Canton = item.IdCiudad_Canton;


                        lstProvincia.Add(infoParroquia);
                    }
                }
                return(lstProvincia);
            }
            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());
            }
        }
        public List <tb_sis_formulario_Info> Get_List_formulario(string CodModulo)
        {
            try
            {
                List <tb_sis_formulario_Info> Lst = new List <tb_sis_formulario_Info>();
                EntitiesGeneral oEnti             = new EntitiesGeneral();
                var             Query             = from q in oEnti.tb_sis_formulario
                                                    where q.CodModulo == CodModulo
                                                    select q;

                foreach (var item in Query)
                {
                    tb_sis_formulario_Info Obj = new tb_sis_formulario_Info();

                    Obj.IdFormulario   = item.IdFormulario;
                    Obj.cod_Formulario = item.cod_Formulario;
                    Obj.nom_Formulario = item.nom_Formulario;
                    Obj.CodModulo      = item.CodModulo;
                    Obj.Text           = item.Text;
                    Obj.observacion    = item.observacion;
                    Obj.estado         = item.estado;
                    Obj.nom_Asembly    = item.nom_Asembly;

                    Lst.Add(Obj);
                }
                return(Lst);
            }
            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;
                return(new List <tb_sis_formulario_Info>());
            }
        }
Exemple #13
0
        public List <tb_transportista_Info> Get_List_transportista(int IdEmpresa)
        {
            try
            {
                List <tb_transportista_Info> lista = new List <tb_transportista_Info>();
                using (EntitiesGeneral context = new EntitiesGeneral())
                {
                    EntitiesGeneral ListTrans = new EntitiesGeneral();
                    var             datos     = ListTrans.tb_transportista.Where(T => T.IdEmpresa == IdEmpresa).ToList();

                    foreach (var item in datos)
                    {
                        lista.Add(new tb_transportista_Info
                        {
                            IdEmpresa         = item.IdEmpresa,
                            IdTransportista   = item.IdTransportista,
                            Cedula            = item.Cedula,
                            Nombre            = item.Nombre,
                            Estado            = item.Estado,
                            Placa             = item.Placa,
                            pe_nombreCompleto = item.Nombre,
                        });
                    }
                }

                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());
            }
        }
Exemple #14
0
        public List <tb_sis_iconos_Info> Get_List_iconos()
        {
            try
            {
                List <tb_sis_iconos_Info> lM             = new List <tb_sis_iconos_Info>();
                EntitiesGeneral           OEselecEmpresa = new EntitiesGeneral();

                var selectEmpresa = from C in OEselecEmpresa.tb_sis_iconos
                                    select C;

                foreach (var item in selectEmpresa)
                {
                    tb_sis_iconos_Info Cbt = new tb_sis_iconos_Info();
                    Cbt.IdIcono       = item.IdIcono;
                    Cbt.Icono         = item.Icono;
                    Cbt.Icono_image   = Funciones.ArrayAImage(item.Icono);
                    Cbt.descripcion   = item.descripcion;
                    Cbt.DirectoryName = item.DirectoryName;
                    Cbt.Extencion     = item.Extencion;
                    Cbt.FullName      = item.FullName;
                    Cbt.Length        = item.Length;
                    lM.Add(Cbt);
                }

                return(lM);
            }

            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());
            }
        }
Exemple #15
0
        public List <Usuario_Info> get_list(bool mostrar_anulados)
        {
            try
            {
                List <Usuario_Info> Lista;

                using (EntitiesGeneral Context = new EntitiesGeneral())
                {
                    if (mostrar_anulados)
                    {
                        Lista = (from q in Context.Usuario
                                 select new Usuario_Info
                        {
                            IdUsuario = q.IdUsuario,
                            Estado = q.Estado,
                            Nombre = q.Nombre
                        }).ToList();
                    }
                    else
                    {
                        Lista = (from q in Context.Usuario
                                 where q.Estado == true
                                 select new Usuario_Info
                        {
                            IdUsuario = q.IdUsuario,
                            Estado = q.Estado,
                            Nombre = q.Nombre
                        }).ToList();
                    }
                }

                return(Lista);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #16
0
 public bool GuardarDB(Grupo_Info info)
 {
     try
     {
         using (EntitiesGeneral db = new EntitiesGeneral())
         {
             db.Grupo.Add(new Grupo
             {
                 IdLinea        = info.IdLinea,
                 IdGrupo        = info.IdGrupo = GetId(),
                 gr_Codigo      = info.gr_Codigo,
                 gr_Descripcion = info.gr_Descripcion,
                 gr_Estado      = true
             });
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #17
0
        public string Get_Nombre_mes(int idmes)
        {
            try
            {
                EntitiesGeneral Otabla = new EntitiesGeneral();

                var selectmes = from A in Otabla.tb_mes
                                where A.idMes == idmes
                                select A.smes.Trim();

                return(selectmes.ToString());
            }
            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());
            }
        }
Exemple #18
0
        public List <Dispositivo_Info> get_list()
        {
            try
            {
                List <Dispositivo_Info> Lista;

                using (EntitiesGeneral db = new EntitiesGeneral())
                {
                    Lista = db.Dispositivo.Select(q => new Dispositivo_Info
                    {
                        IdDispositivo  = q.IdDispositivo,
                        Dispositivo1   = q.Dispositivo1,
                        di_Descripcion = q.di_Descripcion
                    }).ToList();
                }

                return(Lista);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #19
0
 public bool GuardarDB(LogError_Info info)
 {
     try
     {
         using (EntitiesGeneral db = new EntitiesGeneral())
         {
             db.LogError.Add(new LogError
             {
                 ID          = GetID(),
                 Controlador = info.Controlador ?? " ",
                 Error       = info.Error ?? " ",
                 IdUsuario   = info.IdUsuario ?? " ",
                 Fecha       = DateTime.Now
             });
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #20
0
 public DataTable Get_DataTable_Tabla(string nombreTabla)
 {
     try
     {
         EntitiesGeneral EntitiesB  = new EntitiesGeneral();
         string          connString = ((System.Data.EntityClient.EntityConnection)EntitiesB.Database.Connection).StoreConnection.ConnectionString;
         string          sql        = "Select COLUMN_NAME,DATA_TYPE From INFORMATION_SCHEMA.columns where table_name ='" + nombreTabla + "'";
         SqlDataAdapter  da         = new SqlDataAdapter(sql, connString);
         DataTable       ds         = new DataTable();
         da.Fill(ds);
         return(ds);
     }
     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());
     }
 }
Exemple #21
0
 public bool GuardarDB(Linea_Info info)
 {
     try
     {
         using (EntitiesGeneral db = new EntitiesGeneral())
         {
             db.Linea.Add(new Linea
             {
                 IdLinea        = info.IdLinea = GetId(),
                 IdCategoria    = info.IdCategoria,
                 li_Codigo      = info.li_Codigo,
                 li_Descripcion = info.li_Descripcion,
                 li_Estado      = true
             });
             db.SaveChanges();
         }
         return(true);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #22
0
        public bool anularDB(Usuario_Info info)
        {
            try
            {
                using (EntitiesGeneral Context = new EntitiesGeneral())
                {
                    Usuario Entity = Context.Usuario.FirstOrDefault(q => q.IdUsuario == info.IdUsuario);
                    if (Entity == null)
                    {
                        return(false);
                    }
                    Entity.Estado = false;

                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Exemple #23
0
        public FiltroModel GET(string USUARIO = "")
        {
            try
            {
                FiltroModel model = db.VW_FILTROS_APP.Where(q => q.USUARIO.ToLower() == USUARIO.ToLower()).Select(q => new FiltroModel
                {
                    USUARIO     = q.USUARIO,
                    BARCO       = q.BARCO,
                    VIAJE       = q.VIAJE,
                    SOLICITANTE = q.SOLICITANTE,
                    BODEGA      = q.BODEGA,

                    NOMBREBARCO       = q.NOMBREBARCO,
                    NOMBREBODEGA      = q.NOMBREBODEGA,
                    NOMBRESOLICITANTE = q.NOMBRESOLICITANTE,
                    NOMBREVIAJE       = q.NOMBREVIAJE
                }).FirstOrDefault();
                return(model ?? new FiltroModel());
            }
            catch (Exception ex)
            {
                using (EntitiesGeneral Error = new EntitiesGeneral())
                {
                    long ID = Error.APP_LOGERROR.Count() > 0 ? (Error.APP_LOGERROR.Select(q => q.SECUENCIA).Max() + 1) : 1;
                    Error.APP_LOGERROR.Add(new APP_LOGERROR
                    {
                        ERROR     = ex == null ? string.Empty : (ex.Message.Length > 1000 ? ex.Message.Substring(0, 1000) : ex.Message),
                        INNER     = ex.InnerException == null ? string.Empty : (ex.InnerException.Message.Length > 1000 ? ex.InnerException.Message.Substring(0, 1000) : ex.InnerException.Message),
                        FECHA     = DateTime.Now,
                        PROCESO   = "Filtro/GET",
                        SECUENCIA = ID
                    });
                    Error.SaveChanges();
                    return(new FiltroModel());
                }
            }
        }
Exemple #24
0
        public Proveedor_Info get_info(string Tipo, string Codigo)
        {
            try
            {
                Proveedor_Info info = new Proveedor_Info();
                using (EntitiesGeneral Context = new EntitiesGeneral())
                {
                    Context.SetCommandTimeOut(3000);
                    Proveedor Entity = Context.Proveedor.Where(q => q.Tipo == Tipo && q.Codigo == Codigo).FirstOrDefault();

                    if (Entity == null)
                    {
                        return(null);
                    }
                    info = new Proveedor_Info
                    {
                        Tipo           = Entity.Tipo,
                        Codigo         = Entity.Codigo,
                        Nombre         = Entity.Nombre,
                        Ruc            = Entity.Ruc,
                        ConceptoCompra = Entity.ConceptoCompra
                    };
                }

                return(info);
            }
            catch (Exception EX)
            {
                data_log.GuardarDB(new LogError_Info
                {
                    Controlador = "Proveedor_Data",
                    Error       = "Error: " + EX.ToString() + " " + string.Format("get_info: " + Tipo + " " + Codigo),
                    IdUsuario   = ""
                });
                return(null);
            }
        }
Exemple #25
0
 public Boolean GrabarDB(tb_ubicacion_Info info, ref string id, ref string msg)
 {
     try
     {
         using (EntitiesGeneral context = new EntitiesGeneral())
         {
             var    address = new tb_ubicacion();
             string idsucur = Get_Id(info.IdUbicacion_Padre);
             id = idsucur;
             address.IdUbicacion       = idsucur;
             address.IdUbicacion_Padre = info.IdUbicacion_Padre;
             address.ub_descripcion    = info.ub_descripcion;
             address.ub_nivel          = info.ub_nivel;
             address.ub_posicion       = info.ub_posicion;
             address.IdUsuario         = info.IdUsuario;
             address.Fecha_Transac     = info.Fecha_Transac;
             address.nom_pc            = info.nom_pc;
             address.ip     = info.ip;
             address.Estado = "A";
             context.tb_ubicacion.Add(address);
             context.SaveChanges();
             msg = "Se ha procedido a grabar el registro de la Ubbicación #: " + id.ToString() + " para la ubicación: " + info.ub_descripcion + " 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;
         msg     = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
Exemple #26
0
        public Boolean Documento_talonario_esta_Usado(tb_sis_Documento_Tipo_Talonario_Info Info, ref string mensajeError, ref string mensajeDocumentoDupli)
        {
            try
            {
                List <tb_sis_Documento_Tipo_Talonario_Info> lm = new List <tb_sis_Documento_Tipo_Talonario_Info>();
                EntitiesGeneral OEGeneral = new EntitiesGeneral();
                var             q         = (from A in OEGeneral.tb_sis_Documento_Tipo_Talonario
                                             where A.IdEmpresa == Info.IdEmpresa &&
                                             A.PuntoEmision == Info.PuntoEmision &&
                                             A.CodDocumentoTipo == Info.CodDocumentoTipo &&
                                             A.Establecimiento == Info.Establecimiento &&
                                             A.NumDocumento == Info.NumDocumento &&
                                             A.Usado == true
                                             select A);

                if (q.Count() != 0)
                {
                    mensajeDocumentoDupli = "El numero de documento ya se encuentra en uso";
                    return(true);
                }
                else
                {
                    mensajeDocumentoDupli = "";
                    return(false);
                }
            }
            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 mensajeErrorLog);
                mensajeError = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemple #27
0
 public List <Linea_Info> GetList(int IdCategoria, bool mostrar_anulados)
 {
     try
     {
         List <Linea_Info> Lista;
         using (EntitiesGeneral db = new EntitiesGeneral())
         {
             if (mostrar_anulados)
             {
                 Lista = db.Linea.Where(q => q.IdCategoria == IdCategoria).Select(q => new Linea_Info
                 {
                     IdLinea        = q.IdLinea,
                     IdCategoria    = q.IdCategoria,
                     li_Codigo      = q.li_Codigo,
                     li_Descripcion = q.li_Descripcion,
                     li_Estado      = q.li_Estado
                 }).ToList();
             }
             else
             {
                 Lista = db.Linea.Where(q => q.IdCategoria == IdCategoria && q.li_Estado == true).Select(q => new Linea_Info
                 {
                     IdLinea        = q.IdLinea,
                     IdCategoria    = q.IdCategoria,
                     li_Codigo      = q.li_Codigo,
                     li_Descripcion = q.li_Descripcion,
                     li_Estado      = q.li_Estado
                 }).ToList();
             }
         }
         return(Lista);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemple #28
0
        public Boolean ExisteCedula(string cedula, ref string mensaje)
        {
            try
            {
                Boolean Existe;

                string scedula;

                scedula = cedula.Trim();
                mensaje = "";
                Existe  = false;

                EntitiesGeneral OECbtecble = new EntitiesGeneral();

                var selectCbtecble = from CbtCble in OECbtecble.tb_persona
                                     where CbtCble.pe_cedulaRuc == scedula
                                     select CbtCble;

                foreach (var item in selectCbtecble)
                {
                    mensaje = mensaje + " " + item.pe_apellido + " " + item.pe_nombre;
                    Existe  = true;
                }

                return(Existe);
            }
            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());
            }
        }
        public int getId(int IdBanco)
        {
            int Id = 0;

            try
            {
                using (EntitiesGeneral context = new EntitiesGeneral())
                {
                    //var contact = from q in context.tb_banco_procesos_bancarios
                    //              where q.IdBanco==IdBanco
                    //              select q;

                    //if (contact.ToList().Count < 1)
                    //{
                    //    Id = 1;
                    //}
                    //else
                    //{
                    //    var contact1 = (from q in context.tb_banco_procesos_bancarios
                    //                    where q.IdBanco == IdBanco
                    //                    select q.IdProceso_bancario).Max();
                    //    Id = Convert.ToInt32(contact1.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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
        public List <tb_banco_procesos_bancarios_Info> Get_List(int IdBanco)
        {
            try
            {
                List <tb_banco_procesos_bancarios_Info> lista = new List <tb_banco_procesos_bancarios_Info>();

                using (EntitiesGeneral context = new EntitiesGeneral())
                {
                    var contact = from c in context.vwtb_tb_banco_procesos_bancarios
                                  where c.IdBanco == IdBanco
                                  select c;

                    foreach (var item in contact)
                    {
                        tb_banco_procesos_bancarios_Info Info = new tb_banco_procesos_bancarios_Info();
                        Info.IdBanco              = item.IdBanco;
                        Info.IdProceso_bancario   = item.IdProceso_bancario;
                        Info.cod_banco            = item.cod_banco;
                        Info.nom_proceso_bancario = item.nom_proceso_bancario;
                        Info.EstaEnBase           = true;
                        Info.Nombre_Archivo       = item.Iniciales_Archivo;
                        Info.Codigo_Empresa       = item.Codigo_Empresa;
                        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());
            }
        }