Exemplo n.º 1
0
        public Boolean Actualizar_registro(ba_Archivo_Transferencia_Det_Info Info)
        {
            try
            {
                try
                {
                    using (EntitiesBanco Conexion = new EntitiesBanco())
                    {
                        ba_Archivo_Transferencia_Det Entity = Conexion.ba_Archivo_Transferencia_Det.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdArchivo == Info.IdArchivo && q.Secuencia == Info.Secuencia);
                        if (Entity != null)
                        {
                            Entity.Id_Item = Info.Id_Item;
                            Entity.IdEstadoRegistro_cat = Info.IdEstadoRegistro_cat == null ? "REG_COBR" : Info.IdEstadoRegistro_cat;
                            Entity.Valor_cobrado        = Info.Valor_cobrado;
                            Entity.Fecha_proceso        = Info.Fecha_Proceso;
                            Entity.Contabilizado        = Info.Contabilizado;
                            Conexion.SaveChanges();
                        }
                    }
                }
                catch (DbEntityValidationException ex)
                {
                    string arreglo = ToString();
                    foreach (var item in ex.EntityValidationErrors)
                    {
                        foreach (var item_validaciones in item.ValidationErrors)
                        {
                            mensaje = "Propiedad: " + item_validaciones.PropertyName + " Mensaje: " + item_validaciones.ErrorMessage + "\n";
                        }
                    }
                    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(mensaje, "", arreglo, "", "", "", "", "", DateTime.Now);
                    oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                    throw new Exception(mensaje);
                }

                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.º 2
0
        public List <ba_TipoFlujo_Info> Get_List_TipoFlujo(int IdEmpresa)
        {
            try
            {
                List <ba_TipoFlujo_Info> Lst = new List <ba_TipoFlujo_Info>();
                try
                {
                    EntitiesBanco oEnti = new EntitiesBanco();

                    Lst = (from q in oEnti.vwba_TipoFlujo
                           where q.IdEmpresa == IdEmpresa
                           select new ba_TipoFlujo_Info
                    {
                        IdEmpresa = q.IdEmpresa,
                        IdTipoFlujo = q.IdTipoFlujo,
                        cod_flujo = q.cod_flujo == null ? "0" : q.cod_flujo,
                        IdTipoFlujoPadre = q.IdTipoFlujoPadre,
                        Descricion = q.Descricion,
                        DescricionPadre = q.DescricionPadre,
                        Estado = q.Estado,
                        Tipo = q.Tipo,
                    }).ToList();

                    Lst.ForEach(q => q.Descricion2 = "[" + q.cod_flujo.Trim() + "]-" + q.Descricion);

                    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.InnerException + " " + ex.Message;
                    throw new Exception(ex.InnerException.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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 3
0
        public ba_parametros_Info Get_Info_Banco_Otros_Parametros(int IdEmpresa)
        {
            ba_parametros_Info lM         = new ba_parametros_Info();
            EntitiesBanco      param_Info = new EntitiesBanco();

            try
            {
                var selectBaParam = from C in param_Info.ba_parametros
                                    where C.IdEmpresa == IdEmpresa
                                    select C;
                foreach (var item in selectBaParam)
                {
                    lM.IdEmpresa = item.IdEmpresa;
                    lM.El_Diario_Contable_es_modificable  = item.El_Diario_Contable_es_modificable;
                    lM.IdTipoCbte_x_Prestamo              = item.IdTipoCbte_x_Prestamo;
                    lM.IdTipoNota_ND_Can_Cuotas           = item.IdTipoNota_ND_Can_Cuotas;
                    lM.Ruta_descarga_fila_x_PreAviso_cheq = item.Ruta_descarga_fila_x_PreAviso_cheq;
                    lM.CiudadDefaultParaCrearCheques      = item.CiudadDefaultParaCrearCheques;

                    lM.IdUsuario       = item.IdUsuario;
                    lM.IdUsuarioUltMod = item.IdUsuarioUltMod;
                    lM.FechaUltMod     = Convert.ToDateTime(item.FechaUltMod);
                    lM.nom_pc          = item.nom_pc;
                    lM.ip = item.ip;
                    lM.IdCtaCble_Interes   = item.IdCtaCble_Interes;
                    lM.IdCtaCble_prestamos = item.IdCtaCble_prestamos;

                    lM.MailUsuario     = item.MailUsuario;
                    lM.MailClave       = item.MailClave;
                    lM.MailAsunto      = item.MailAsunto;
                    lM.MailCuerpo      = item.MailCuerpo;
                    lM.MailPuerto      = item.MailPuerto;
                    lM.MailHost        = item.MailHost;
                    lM.MailPermitirSSL = item.MailPermitirSSL;
                    lM.MailCorreoCopia = item.MailCorreoCopia;
                }
                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());
            }
        }
Exemplo n.º 4
0
        public Boolean GuardarDB(ba_prestamo_Info Item, ref decimal Id, ref string msg)
        {
            try
            {
                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    ba_prestamo Cabe = new ba_prestamo();

                    Cabe.IdEmpresa         = Item.IdEmpresa;
                    Cabe.IdPrestamo        = Id = GetIdPrestamo(Item.IdEmpresa);
                    Cabe.IdBanco           = Item.IdBanco;
                    Cabe.CodPrestamo       = Item.CodPrestamo;
                    Cabe.IdMotivo_Prestamo = Item.IdMotivo_Prestamo;
                    Cabe.Fecha             = Convert.ToDateTime(Item.Fecha.ToShortDateString());
                    Cabe.MontoSol          = Item.MontoSol;
                    Cabe.TasaInteres       = Item.TasaInteres;
                    Cabe.TotalPrestamo     = Item.TotalPrestamo;
                    Cabe.NumCuotas         = Item.NumCuotas;
                    Cabe.IdTipo_Pago       = Item.IdTipo_Pago;
                    Cabe.IdMetCalc         = Item.IdMetCalc;
                    Cabe.Fecha_PriPago     = Item.Fecha_PriPago;
                    Cabe.Observacion       = Item.Observacion;
                    Cabe.IdUsuario         = Item.IdUsuario;
                    Cabe.Estado            = "A";
                    Cabe.Fecha_Transac     = Item.Fecha_Transac;
                    Cabe.nom_pc            = Item.nom_pc;
                    Cabe.ip           = Item.ip;
                    Cabe.Pago_contado = Item.Pago_contado;
                    Cabe.IdTipoFlujo  = Item.IdTipoFlujo;
                    Cabe.IdCtaCble    = Item.IdCtaCble;
                    Cabe.IdCliente    = Item.IdCliente;
                    Context.ba_prestamo.Add(Cabe);
                    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.InnerException + " " + ex.Message;
                msg     = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public List <vwba_ordenGiroPendientes_Info> Get_List_ordenGiroPendientes(int IdEmpresa)
        {
            try
            {
                List <vwba_ordenGiroPendientes_Info> lM = new List <vwba_ordenGiroPendientes_Info>();
                EntitiesBanco b = new EntitiesBanco();

                var select_ = from T in b.vwba_ordenGiroPendientes
                              where T.IdEmpresa == IdEmpresa && T.saldo > 0.0
                              select T;

                foreach (var item in select_)
                {
                    vwba_ordenGiroPendientes_Info dat_ = new vwba_ordenGiroPendientes_Info();

                    dat_.IdEmpresa        = item.IdEmpresa;
                    dat_.IdProveedor      = item.IdProveedor;
                    dat_.co_fechaOg       = item.co_fechaOg;
                    dat_.co_observacion   = item.co_observacion;
                    dat_.IdCbteCble_Ogiro = item.IdCbteCble_Ogiro;
                    dat_.IdTipoCbte_Ogiro = item.IdTipoCbte_Ogiro;
                    dat_.valorAPagar      = Convert.ToDouble(item.valorAPagar);
                    dat_.TotalPagado      = item.TotalPagado;
                    dat_.saldo            = item.saldo;
                    dat_.saldo2           = item.saldo;
                    dat_.valorAplicado    = 0;
                    dat_.NFactura         = item.NFactura;
                    dat_.Proveedor        = item.Proveedor;
                    dat_.CtaProveedor     = item.CtaProveedor;
                    dat_.GiraCheque       = item.GiraCheque;


                    dat_.chek = false;
                    lM.Add(dat_);
                }
                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());
            }
        }
Exemplo n.º 6
0
        public List <vwba_TransaccionesAConciliar_Info> Get_List_Transacciones_x_Conciliar(int IdEmpresa, string IdCtaCble, DateTime F_inicio, DateTime F_fin, int IdConciliacion, int IdBanco)
        {
            try
            {
                List <vwba_TransaccionesAConciliar_Info> lM = new List <vwba_TransaccionesAConciliar_Info>();
                using (EntitiesBanco b = new EntitiesBanco())
                {
                    var lst = b.SPBAN_TransaccionesAConciliar(IdEmpresa, IdCtaCble, F_fin, IdConciliacion).ToList();

                    foreach (var q in lst)
                    {
                        lM.Add(new vwba_TransaccionesAConciliar_Info
                        {
                            IdEmpresa         = q.IdEmpresa,
                            IdConciliacion    = q.IdConciliacion,
                            IdBanco           = q.IdBanco,
                            IdCtaCble         = q.IdCtaCble,
                            ba_descripcion    = q.ba_descripcion,
                            dc_Observacion    = q.dc_Observacion,
                            cb_Fecha          = q.cb_Fecha,
                            nom_IdTipoCbte    = q.nom_IdTipoCbte,
                            dc_Valor          = q.dc_Valor ?? 0,
                            fechaConciliacion = q.fechaConciliacion,
                            Estado            = q.IdEstado_Concil_Cat,
                            SecuenciaCbteCble = q.secuencia,
                            cb_Cheque         = q.cb_Cheque,

                            IdTipocbte = q.IdTipoCbte,

                            IdCbteCble = q.IdCbteCble,
                            Tipo       = q.Tipo,
                            chk        = q.Seleccionado ?? false
                        });
                    }
                }
                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());
            }
        }
Exemplo n.º 7
0
        public Boolean ModificarDB(ba_Inversion_Info Info, ref string msg)
        {
            Boolean res = false;

            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    ba_Inversion item = new ba_Inversion();

                    item = context.ba_Inversion.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdInversion == Info.IdInversion);
                    if (item != null)
                    {
                        item.Capital         = Info.Capital;
                        item.Cod_Inversion   = Info.Cod_Inversion;
                        item.Fecha           = Info.Fecha;
                        item.Fecha_Transac   = Info.Fecha_Transac;
                        item.Fecha_Vct       = Info.Fecha_Vct;
                        item.Monto           = Info.Monto;
                        item.Observacion     = Info.Observacion;
                        item.Otros           = Info.Otros;
                        item.Plazo           = Info.Plazo;
                        item.Por_Retencion   = Convert.ToDouble(Info.Por_Retencion);
                        item.Tasa            = Convert.ToDouble(Info.Tasa);
                        item.Tasa_interes    = Info.Tasa_interes;
                        item.Total_recibir   = Info.Total_recibir;
                        item.Valor_interes   = Info.Valor_interes;
                        item.Valor_retencion = Info.Valor_retencion;
                        item.Estado          = Info.Estado;
                        context.SaveChanges();
                        res = true;
                    }
                }
                return(res);
            }
            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 = ex.Message + ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
Exemplo n.º 8
0
        public List <ba_prestamo_detalle_Info> Get_List_prestamo_detalle(int IdEmpresa, decimal IdPrestamo)
        {
            try
            {
                //List<ba_prestamo_detalle_Info> Lst = new List<ba_prestamo_detalle_Info>();
                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    IQueryable <ba_prestamo_detalle_Info> Consulta = from q in Context.ba_prestamo_detalle
                                                                     where q.IdEmpresa == IdEmpresa && q.IdPrestamo == IdPrestamo
                                                                     select new ba_prestamo_detalle_Info
                    {
                        IdEmpresa       = IdEmpresa,
                        IdPrestamo      = IdPrestamo,
                        NumCuota        = q.NumCuota,
                        SaldoInicial    = q.SaldoInicial,
                        Interes         = q.Interes,
                        AbonoCapital    = q.AbonoCapital,
                        TotalCuota      = q.TotalCuota,
                        Saldo           = q.Saldo,
                        FechaPago       = q.FechaPago,
                        EstadoPago      = q.EstadoPago,
                        Estado          = q.Estado,
                        Observacion_det = q.Observacion_det,
                        IdUsuario       = q.IdUsuario,
                        Fecha_Transac   = q.Fecha_Transac,
                        IdUsuarioUltMod = q.IdUsuarioUltMod,
                        // Fecha_UltMod = Convert.ToDateTime(q.Fecha_UltMod),
                        IdUsuarioUltAnu = q.IdUsuarioUltAnu,
                        //  Fecha_UltAnu = Convert.ToDateTime(q.Fecha_UltAnu),
                        nom_pc    = q.nom_pc,
                        ip        = q.ip,
                        MotiAnula = q.MotiAnula
                    };
                    return(Consulta.ToList());
                }
            }

            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.º 9
0
        public ba_parametros_Info Get_List_parametros(int IdEmpresa)
        {
            try
            {
                using (EntitiesBanco entity = new EntitiesBanco())
                {
                    ba_parametros parametros = entity.ba_parametros.FirstOrDefault(v => v.IdEmpresa == IdEmpresa);
                    if (parametros != null)
                    {
                        return(new ba_parametros_Info()
                        {
                            CiudadDefaultParaCrearCheques = parametros.CiudadDefaultParaCrearCheques,
                            El_Diario_Contable_es_modificable = parametros.El_Diario_Contable_es_modificable,
                            IdTipoCbte_x_Prestamo = parametros.IdTipoCbte_x_Prestamo,
                            IdTipoNota_ND_Can_Cuotas = parametros.IdTipoNota_ND_Can_Cuotas,
                            IdEmpresa = parametros.IdEmpresa,
                            Ruta_descarga_fila_x_PreAviso_cheq = parametros.Ruta_descarga_fila_x_PreAviso_cheq,
                            IdCtaCble_Interes = parametros.IdCtaCble_Interes,
                            IdCtaCble_prestamos = parametros.IdCtaCble_prestamos,

                            MailUsuario = parametros.MailUsuario,
                            MailClave = parametros.MailClave,
                            MailAsunto = parametros.MailAsunto,
                            MailCuerpo = parametros.MailCuerpo,
                            MailPuerto = parametros.MailPuerto,
                            MailHost = parametros.MailHost,
                            MailPermitirSSL = parametros.MailPermitirSSL,
                            MailCorreoCopia = parametros.MailCorreoCopia
                        });
                    }
                    else
                    {
                        return(new ba_parametros_Info());
                    }
                }
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
        public ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Get_Info_Archivo_Transferencia(int idEmpresa, decimal idArchivo)
        {
            try
            {
                ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Archivo = new ba_Archivo_Transferencia_x_PreAviso_Cheq_Info();

                using (EntitiesBanco Conexion = new EntitiesBanco())
                {
                    ba_Archivo_Transferencia_x_PreAviso_Cheq item = Conexion.ba_Archivo_Transferencia_x_PreAviso_Cheq.FirstOrDefault(q => q.IdArchivo_preaviso_cheq == idArchivo && q.IdEmpresa == idEmpresa);

                    if (item != null)
                    {
                        Archivo.IdEmpresa = item.IdEmpresa;
                        Archivo.IdArchivo_preaviso_cheq = item.IdArchivo_preaviso_cheq;
                        Archivo.IdBanco         = item.IdBanco;
                        Archivo.Nom_Archivo     = item.Nom_Archivo;
                        Archivo.Fecha           = item.Fecha;
                        Archivo.Archivo         = item.Archivo;
                        Archivo.Estado          = item.Estado;
                        Archivo.IdUsuario       = item.IdUsuario;
                        Archivo.Fecha_Transac   = item.Fecha_Transac;
                        Archivo.Observacion     = item.Observacion;
                        Archivo.IdUsuarioUltMod = item.IdUsuarioUltMod;
                        Archivo.Fecha_UltMod    = item.Fecha_UltMod;
                        Archivo.IdUsuarioUltAnu = item.IdUsuarioUltAnu;
                        Archivo.Fecha_UltAnu    = item.Fecha_UltAnu;
                        Archivo.Nom_pc          = item.Nom_pc;
                        Archivo.Ip = item.Ip;
                        Archivo.Motivo_anulacion = item.Motivo_anulacion;
                    }

                    //ba_Archivo_Transferencia_Det_Data oData_det = new ba_Archivo_Transferencia_Det_Data();
                    //Archivo.Lst_Archivo_Transferencia_Det = oData_det.Get_List_Archivo_transferencia_Det(Archivo.IdEmpresa, Archivo.IdProceso_bancario, Archivo.IdArchivo);
                }
                return(Archivo);
            }
            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 Boolean ModificarDB(ba_Archivo_Transferencia_Det_Info Info)
        {
            try
            {
                try
                {
                    using (EntitiesBanco Conexion = new EntitiesBanco())
                    {
                        ba_Archivo_Transferencia_Det Entity = Conexion.ba_Archivo_Transferencia_Det.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa && q.IdArchivo == Info.IdArchivo && q.Secuencia == Info.Secuencia);
                        if (Entity != null)
                        {
                            Entity.IdEmpresa_pago  = Info.IdEmpresa_pago;
                            Entity.IdTipoCbte_pago = Info.IdTipoCbte_pago;
                            Entity.IdCbteCble_pago = Info.IdCbteCble_pago;
                            Conexion.SaveChanges();
                        }
                    }
                }
                catch (DbEntityValidationException ex)
                {
                    string arreglo = ToString();
                    foreach (var item in ex.EntityValidationErrors)
                    {
                        foreach (var item_validaciones in item.ValidationErrors)
                        {
                            mensaje = "Propiedad: " + item_validaciones.PropertyName + " Mensaje: " + item_validaciones.ErrorMessage + "\n";
                        }
                    }
                    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(mensaje, "", arreglo, "", "", "", "", "", DateTime.Now);
                    oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                    throw new Exception(mensaje);
                }

                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 AnularDB(ba_Archivo_Transferencia_Info info)
        {
            try
            {
                try
                {
                    List <ba_Archivo_Transferencia_Info> Lista = new List <ba_Archivo_Transferencia_Info>();

                    using (EntitiesBanco context = new EntitiesBanco())
                    {
                        var contact = context.ba_Archivo_Transferencia.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdArchivo == info.IdArchivo);

                        contact.Estado           = false;
                        contact.IdUsuarioUltAnu  = info.IdUsuarioUltAnu;
                        contact.Fecha_UltAnu     = info.Fecha_UltAnu;
                        contact.Motivo_anulacion = info.Motivo_anulacion;
                        context.SaveChanges();
                        return(true);
                    }
                }
                catch (DbEntityValidationException ex)
                {
                    string arreglo = ToString();
                    foreach (var item in ex.EntityValidationErrors)
                    {
                        foreach (var item_validaciones in item.ValidationErrors)
                        {
                            mensaje = "Propiedad: " + item_validaciones.PropertyName + " Mensaje: " + item_validaciones.ErrorMessage + "\n";
                        }
                    }
                    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(mensaje, "", arreglo, "", "", "", "", "", DateTime.Now);
                    oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                    throw new Exception(mensaje);
                }
            }
            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 List <vwba_Cbte_Ban_detallePagos_Info> Get_List_Cbte_Ban_detallePagos(int IdEmpresa, int IdTipocbte, decimal IdCbteCble)
        {
            try
            {
                List <vwba_Cbte_Ban_detallePagos_Info> lM = new List <vwba_Cbte_Ban_detallePagos_Info>();
                EntitiesBanco b = new EntitiesBanco();

                var select_ = from T in b.vwba_Cbte_Ban_detallePagos
                              where T.IdEmpresa == IdEmpresa && T.IdCbteCble_cbte == IdCbteCble && T.IdTipocbte_cbte == IdTipocbte
                              select T;

                foreach (var item in select_)
                {
                    vwba_Cbte_Ban_detallePagos_Info dat_ = new vwba_Cbte_Ban_detallePagos_Info();

                    dat_.IdEmpresa        = item.IdEmpresa;
                    dat_.IdCbteCble_Ogiro = item.IdCbteCble_Ogiro;
                    dat_.IdTipoCbte_Ogiro = item.IdTipoCbte_Ogiro;
                    dat_.co_fechaOg       = item.co_fechaOg;
                    dat_.co_observacion   = item.co_observacion;
                    dat_.co_valorpagar    = item.co_valorpagar;
                    dat_.pg_MontoAplicado = item.pg_MontoAplicado;
                    dat_.IdProveedor      = item.IdProveedor;
                    dat_.IdCbteCble_cbte  = item.IdCbteCble_cbte;
                    dat_.IdTipocbte_cbte  = item.IdTipocbte_cbte;
                    dat_.pg_saldoAnterior = item.pg_saldoAnterior;
                    dat_.IdCancelacion    = item.IdCancelacion;
                    dat_.IdEmpresa_cbte   = item.IdEmpresa_cbte;
                    dat_.NFactura         = item.NFactura;



                    lM.Add(dat_);
                }
                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());
            }
        }
Exemplo n.º 14
0
 public Boolean AnularDB(ba_transferencia_Info info, ref string msg)
 {
     try
     {
         Boolean res = true;
         try
         {
             using (EntitiesBanco Context = new EntitiesBanco())
             {
                 var contact = Context.ba_transferencia.FirstOrDefault(A => A.IdEmpresa_origen == info.IdEmpresa_origen &&
                                                                       A.IdTransferencia == info.IdTransferencia);
                 if (contact != null)
                 {
                     contact.tr_estado          = "I";
                     contact.IdUsuario_Anu      = info.IdUsuario_Anu;
                     contact.tr_MotivoAnulacion = info.tr_MotivoAnulacion;
                     contact.FechaAnulacion     = info.FechaAnulacion;
                     contact.tr_observacion     = info.tr_observacion;
                     Context.SaveChanges();
                     msg = "Grabación exitosa..";
                 }
             }
             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 msg);
             msg = ex.ToString() + " " + ex.Message;
             res = false;
         }
         return(res);
     }
     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.º 15
0
        public Boolean GrabarDB(ba_transferencia_Info info, ref decimal IdTranf)
        {
            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    EntitiesBanco EDB = new EntitiesBanco();

                    var address = new ba_transferencia();

                    address.IdTransferencia = GetId(info.IdEmpresa_origen);
                    IdTranf = address.IdTransferencia;
                    address.IdEmpresa_origen   = info.IdEmpresa_origen;
                    address.IdTipocbte_origen  = info.IdTipocbte_origen;
                    address.IdCbteCble_origen  = info.IdCbteCble_origen;
                    address.IdEmpresa_destino  = info.IdEmpresa_destino;
                    address.IdTipocbte_destino = info.IdTipocbte_destino;
                    address.IdCbteCble_destino = info.IdCbteCble_destino;
                    address.tr_observacion     = info.tr_observacion;
                    address.tr_valor           = info.tr_valor;
                    address.tr_fecha           = info.tr_fecha;
                    address.Fecha_Transac      = info.Fecha_Transac;
                    address.IdUsuario          = info.IdUsuario;
                    address.ip        = info.ip;
                    address.nom_pc    = info.nom_pc;
                    address.tr_estado = "A";

                    address.IdBanco_origen  = info.IdBanco_origen;
                    address.IdBanco_destino = info.IdBanco_destino;


                    context.ba_transferencia.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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Get_List_Archivo_transferencia(int IdEmpresa, DateTime FechaInicio, DateTime Fecha_Fin)
        {
            try
            {
                DateTime fi = Convert.ToDateTime(FechaInicio.ToShortDateString());
                DateTime Ff = Convert.ToDateTime(Fecha_Fin.ToShortDateString());
                List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Lista = new List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info>();

                using (EntitiesBanco Conexion = new EntitiesBanco())
                {
                    var lst = (from q in Conexion.vwba_Archivo_Transferencia_x_PreAviso_Cheq
                               where q.IdEmpresa == IdEmpresa &&
                               q.Fecha >= fi &&
                               q.Fecha <= Ff
                               select q);

                    foreach (var item in lst)
                    {
                        ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Info = new ba_Archivo_Transferencia_x_PreAviso_Cheq_Info();

                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdArchivo_preaviso_cheq = item.IdArchivo_preaviso_cheq;
                        Info.IdBanco     = item.IdBanco;
                        Info.Nom_Archivo = item.Nom_Archivo;
                        Info.Fecha       = item.Fecha;
                        Info.Estado      = item.Estado;
                        Info.Observacion = item.Observacion;
                        Info.Estado      = item.Estado;

                        Info.nom_banco = item.nom_banco;

                        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.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
        public List <ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info> Get_List_Archivo_Transferencia_x_PreAviso_Cheq_det(int idEmpresa, decimal idArchivo)
        {
            try
            {
                List <ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info> Lista = new List <ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info>();

                using (EntitiesBanco Conexion = new EntitiesBanco())
                {
                    var lst = (from q in Conexion.vwba_Archivo_Transferencia_x_PreAviso_Cheq_det
                               where idEmpresa == q.IdEmpresa && idArchivo == q.IdArchivo_preaviso_cheq
                               select q);

                    foreach (var item in lst)
                    {
                        ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info Info = new ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info();

                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdArchivo_preaviso_cheq = item.IdArchivo_preaviso_cheq;
                        Info.secuencia       = item.secuencia;
                        Info.observacion_det = item.observacion_det;
                        Info.IdEmpresa_mvba  = item.IdEmpresa_mvba;
                        Info.IdCbteCble_mvba = item.IdCbteCble_mvba;
                        Info.IdTipocbte_mvba = item.IdTipocbte_mvba;
                        Info.cb_Fecha        = item.cb_Fecha;
                        Info.cb_Observacion  = item.cb_Observacion;
                        Info.cb_Cheque       = item.cb_Cheque;
                        Info.cb_Valor        = item.cb_Valor;
                        Info.CodTipoCbte     = item.CodTipoCbte;
                        Info.cb_giradoA      = item.cb_giradoA;
                        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.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
        public List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Get_List_Archivo_transferencia(int IdEmpresa, DateTime fechaIni, DateTime fechaFin, int idBancoIni, int idBancoFin)

        {
            try
            {
                List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Lista = new List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info>();

                idBancoIni = (idBancoIni == 0) ? 1 : idBancoIni;
                idBancoFin = (idBancoFin == 0) ? 99999999 : idBancoFin;


                using (EntitiesBanco Conexion = new EntitiesBanco())
                {
                    var lst = (from q in Conexion.vwba_Archivo_Transferencia_x_PreAviso_Cheq
                               where fechaIni <= q.Fecha && q.Fecha <= fechaFin &&
                               idBancoIni <= q.IdBanco && q.IdBanco <= idBancoFin
                               select q);

                    foreach (var item in lst)
                    {
                        ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Info = new ba_Archivo_Transferencia_x_PreAviso_Cheq_Info();

                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdArchivo_preaviso_cheq = item.IdArchivo_preaviso_cheq;
                        Info.Nom_Archivo             = item.Nom_Archivo;
                        Info.IdBanco       = item.IdBanco;
                        Info.Fecha         = item.Fecha;
                        Info.Observacion   = item.Observacion;
                        Info.Fecha_Proceso = item.Fecha_Proceso;
                        Info.nom_banco     = item.nom_banco;
                        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.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemplo n.º 19
0
        public ba_Config_Diseno_Cheque_Info Get_List_Config_Diseno_Cheque(ba_Banco_Cuenta_Info Cheque_I)
        {
            try
            {
                ba_Config_Diseno_Cheque_Info cf;
                using (EntitiesBanco OEBan = new EntitiesBanco())
                {
                    var q = from t in OEBan.ba_Config_Diseno_Cheque
                            where t.IdBanco == Cheque_I.IdBanco && t.IdEmpresa == Cheque_I.IdEmpresa
                            select t;
                    foreach (var item in q)
                    {
                        cf = new ba_Config_Diseno_Cheque_Info();
                        cf.Area_Imprimir_X     = item.Area_Imprimir_X;
                        cf.Area_Imprimir_Y     = item.Area_Imprimir_Y;
                        cf.Fecha_X             = item.Fecha_X;
                        cf.Fecha_Y             = item.Fecha_Y;
                        cf.idBanco             = item.IdBanco;
                        cf.idEmpresa           = item.IdEmpresa;
                        cf.PagueseA_X          = item.PagueseA_X;
                        cf.PagueseA_Y          = item.PagueseA_Y;
                        cf.Tama_Cheque_X       = item.Tama_Cheque_X;
                        cf.Tama_Cheque_Y       = item.Tama_Cheque_Y;
                        cf.ValorCheque_X       = item.ValorCheque_X;
                        cf.ValorCheque_Y       = item.ValorCheque_Y;
                        cf.ValorLetra_Cheque_X = item.ValorLetra_Cheque_X;
                        cf.ValorLetra_Cheque_Y = item.ValorLetra_Cheque_Y;
                        cf.Pto_Impresora       = item.Pto_Impresora;
                        cf.Nom_Impresora       = item.Nom_Impresora;
                        return(cf);
                    }
                }

                return(new ba_Config_Diseno_Cheque_Info());
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 20
0
        public Boolean GrabarDB(ba_Config_Diseno_Cheque_Info Cheque_I, ref string mensaje)
        {
            try
            {
                using (EntitiesBanco Contex = new EntitiesBanco())
                {
                    string q  = "delete ba_Config_Diseno_Cheque where IdEmpresa = {0} and IdBanco = {1}";
                    string qy = string.Format(q, Cheque_I.idEmpresa, Cheque_I.idBanco);
                    Contex.Database.ExecuteSqlCommand(qy);

                    EntitiesBanco EDChueqe = new EntitiesBanco();
                    //var contac = ba_Config_Diseno_Cheque.Createba_Config_Diseno_Cheque(0,0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
                    var address = new ba_Config_Diseno_Cheque();
                    address.IdEmpresa           = Cheque_I.idEmpresa;
                    address.IdBanco             = Cheque_I.idBanco;
                    address.Area_Imprimir_X     = Cheque_I.Area_Imprimir_X;
                    address.Area_Imprimir_Y     = Cheque_I.Area_Imprimir_Y;
                    address.Tama_Cheque_X       = Cheque_I.Tama_Cheque_X;
                    address.Tama_Cheque_Y       = Cheque_I.Tama_Cheque_Y;
                    address.PagueseA_X          = Cheque_I.PagueseA_X;
                    address.PagueseA_Y          = Cheque_I.PagueseA_Y;
                    address.ValorCheque_X       = Cheque_I.ValorCheque_X;
                    address.ValorCheque_Y       = Cheque_I.ValorCheque_Y;
                    address.ValorLetra_Cheque_X = Cheque_I.ValorLetra_Cheque_X;
                    address.ValorLetra_Cheque_Y = Cheque_I.ValorLetra_Cheque_Y;
                    address.Fecha_X             = Cheque_I.Fecha_X;
                    address.Fecha_Y             = Cheque_I.Fecha_Y;
                    address.Nom_Impresora       = Cheque_I.Nom_Impresora;
                    address.Pto_Impresora       = Cheque_I.Pto_Impresora;
                    //contac = address;
                    Contex.ba_Config_Diseno_Cheque.Add(address);
                    Contex.SaveChanges();
                    mensaje = "Grabado Ok";
                } 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.º 21
0
 // MIGRADO  ba_prestamo_detalle_cancelacion
 public Boolean AnularDetallePrestamosCancelados(ba_prestamo_detalle_Info Info, ref string msg)
 {
     try
     {
         Boolean resu = false;
         try
         {
             using (EntitiesBanco Entity = new EntitiesBanco())
             {
                 ba_prestamo_detalle_cancelacion cancelacion = Entity.ba_prestamo_detalle_cancelacion.First(v => v.IdPrestamo == Info.IdPrestamo && v.IdEmpresa == Info.IdEmpresa && v.NumCuota == Info.NumCuota && v.Secuencia == Info.Secuencia);
                 if (cancelacion != null)
                 {
                     cancelacion.Monto_Canc       = 0;
                     cancelacion.Observacion_canc = "**ANULADO**" + Info.Observacion_canc;
                     cancelacion.MotiAnula        = Info.MotiAnula;
                     cancelacion.IdUsuarioUltAnu  = Info.IdUsuarioUltAnu;
                     cancelacion.Fecha_UltAnu     = Info.Fecha_UltAnu;
                     Entity.SaveChanges();
                     resu = true;
                 }
             }
             return(resu);
         }
         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     = ex.Message + ex.ToString();
             throw new Exception(ex.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.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
Exemplo n.º 22
0
        public Boolean GuardarDB(List <ba_notasDebCre_masivo_Info> Lis, ref decimal IdTran, int IdEmpresa)
        {
            try
            {
                IdTran = Id(IdEmpresa);

                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    foreach (var item in Lis)
                    {
                        ba_notasDebCre_masivo_Info Info = new ba_notasDebCre_masivo_Info();
                        Info = item;

                        ba_notasDebCre_masivo Address = new ba_notasDebCre_masivo();

                        Address.IdEmpresa     = Info.IdEmpresa;
                        Address.IdTransaccion = IdTran;
                        Address.IdEmpresa_cb  = Info.IdEmpresa_cb;
                        Address.IdCbteCble_cb = Info.IdCbteCble_cb;
                        Address.IdTipocbte_cb = Info.IdTipocbte_cb;
                        Address.Observacion   = Info.Observacion;
                        Address.Deb_Cred      = Info.Deb_Cred;
                        Address.fecha         = Info.fecha;
                        Address.IdUsuario     = Info.IdUsuario;
                        Address.Fecha_Transac = Info.Fecha_Transac;
                        Address.nom_pc        = Info.nom_pc;
                        Address.ip            = Info.ip;

                        Context.ba_notasDebCre_masivo.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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 23
0
        public List <vwba_notasDebCre_masivo_Info> Get_List_vwba_notasDebCre_masivo(int IdEmpresa, decimal IdTransaccion)
        {
            try
            {
                List <vwba_notasDebCre_masivo_Info> Lst = new List <vwba_notasDebCre_masivo_Info>();
                EntitiesBanco oEnti = new EntitiesBanco();
                var           Query = from q in oEnti.vwba_notasDebCre_masivo
                                      where q.IdEmpresa == IdEmpresa && q.IdTransaccion == IdTransaccion
                                      select q;
                foreach (var item in Query)
                {
                    vwba_notasDebCre_masivo_Info Obj = new vwba_notasDebCre_masivo_Info();
                    Obj.IdEmpresa        = item.IdEmpresa;
                    Obj.IdTransaccion    = item.IdTransaccion;
                    Obj.tm_tipo          = item.tm_tipo;
                    Obj.tm_IdBanco       = item.tm_IdBanco;
                    Obj.tm_fecha         = item.tm_fecha;
                    Obj.tm_observacion   = item.tm_observacion;
                    Obj.cb_Valor         = item.cb_Valor;
                    Obj.cb_Observacion   = item.cb_Observacion;
                    Obj.cb_Fecha         = item.cb_Fecha;
                    Obj.cb_IdCbteCble    = item.cb_IdCbteCble;
                    Obj.cb_IdTipoCte     = item.cb_IdTipoCte;
                    Obj.IdTipoNota       = item.IdTipoNota;
                    Obj.tn_descripcion   = item.tn_descripcion;
                    Obj.tn_tipo          = item.tn_tipo;
                    Obj.tn_IdCtaCble     = item.tn_IdCtaCble;
                    Obj.tn_IdCentroCosto = item.tn_IdCentroCosto;

                    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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
Exemplo n.º 24
0
 public Boolean GuardarPrestamoDetalle(List <ba_prestamo_detalle_Info> Lst)
 {
     try
     {
         int secuencia = 0;
         using (EntitiesBanco Context = new EntitiesBanco())
         {
             foreach (var Item in Lst)
             {
                 secuencia++;
                 ba_prestamo_detalle Deta = new ba_prestamo_detalle();
                 Deta.IdEmpresa       = Item.IdEmpresa;
                 Deta.IdPrestamo      = Item.IdPrestamo;
                 Deta.NumCuota        = Item.NumCuota;
                 Deta.SaldoInicial    = Item.SaldoInicial;
                 Deta.Interes         = Item.Interes;
                 Deta.AbonoCapital    = Item.AbonoCapital;
                 Deta.TotalCuota      = Item.TotalCuota;
                 Deta.Saldo           = Item.Saldo;
                 Deta.FechaPago       = Item.FechaPago;
                 Deta.EstadoPago      = Item.EstadoPago;
                 Deta.Estado          = Item.Estado;
                 Deta.Observacion_det = Item.Observacion_det;
                 Deta.IdUsuario       = Item.IdUsuario;
                 Deta.Fecha_Transac   = Item.Fecha_Transac;
                 Deta.nom_pc          = Item.nom_pc;
                 Deta.ip = Item.ip;
                 Context.ba_prestamo_detalle.Add(Deta);
                 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.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
        public ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Get_Info_Archivo_transferencia(int idEmpresa, decimal idArchivo, int idBanco)
        {
            try
            {
                ba_Archivo_Transferencia_x_PreAviso_Cheq_Info Info = new ba_Archivo_Transferencia_x_PreAviso_Cheq_Info();

                using (EntitiesBanco Conexion = new EntitiesBanco())
                {
                    var lst = (from q in Conexion.vwba_Archivo_Transferencia_x_PreAviso_Cheq
                               where idEmpresa == q.IdEmpresa &&
                               idArchivo == q.IdArchivo_preaviso_cheq &&
                               q.IdBanco == idBanco
                               select q);

                    foreach (var item in lst)
                    {
                        Info.IdEmpresa = item.IdEmpresa;
                        Info.IdArchivo_preaviso_cheq = item.IdArchivo_preaviso_cheq;
                        Info.Nom_Archivo             = item.Nom_Archivo;
                        Info.IdBanco       = item.IdBanco;
                        Info.Fecha         = item.Fecha;
                        Info.Observacion   = item.Observacion;
                        Info.Fecha_Proceso = item.Fecha_Proceso;

                        Info.nom_banco = item.nom_banco;
                    }
                }

                //ba_Archivo_Transferencia_Det_Data oData = new ba_Archivo_Transferencia_Det_Data();
                //Info.Lst_Archivo_Transferencia_Det = oData.Get_List_Vista_Archivo_transferencia_Det(Info.IdEmpresa, Info.IdArchivo, Info.IdBanco, Info.IdProceso_bancario);

                return(Info);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Exemplo n.º 26
0
        public List <ba_parametros_Info> Get_List_Banco_otros_Parametros(int IdEmpresa)
        {
            List <ba_parametros_Info> lM         = new List <ba_parametros_Info>();
            EntitiesBanco             param_Info = new EntitiesBanco();

            try
            {
                var selectBaParam = from C in param_Info.ba_parametros
                                    where C.IdEmpresa == IdEmpresa
                                    select C;
                foreach (var item in selectBaParam)
                {
                    ba_parametros_Info Cbt = new ba_parametros_Info();

                    Cbt.IdEmpresa = item.IdEmpresa;

                    Cbt.IdEmpresa = item.IdEmpresa;
                    Cbt.El_Diario_Contable_es_modificable  = item.El_Diario_Contable_es_modificable;
                    Cbt.CiudadDefaultParaCrearCheques      = item.CiudadDefaultParaCrearCheques;
                    Cbt.IdTipoNota_ND_Can_Cuotas           = item.IdTipoNota_ND_Can_Cuotas;
                    Cbt.IdTipoCbte_x_Prestamo              = item.IdTipoCbte_x_Prestamo;
                    Cbt.Ruta_descarga_fila_x_PreAviso_cheq = item.Ruta_descarga_fila_x_PreAviso_cheq;

                    Cbt.IdUsuario           = item.IdUsuario;
                    Cbt.nom_pc              = item.nom_pc;
                    Cbt.ip                  = item.ip;
                    Cbt.IdCtaCble_Interes   = item.IdCtaCble_Interes;
                    Cbt.IdCtaCble_prestamos = item.IdCtaCble_prestamos;

                    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.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
        public bool GrabarDB(ba_Archivo_Transferencia_x_PreAviso_Cheq_Info info, ref decimal IdArchivo)
        {
            try
            {
                List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Lista = new List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info>();

                using (EntitiesBanco context = new EntitiesBanco())
                {
                    ba_Archivo_Transferencia_x_PreAviso_Cheq address = new ba_Archivo_Transferencia_x_PreAviso_Cheq();
                    info.Fecha        = Convert.ToDateTime(info.Fecha.ToShortDateString());
                    address.IdEmpresa = info.IdEmpresa;
                    address.IdArchivo_preaviso_cheq   = GetId(info.IdEmpresa);
                    address.cod_Archivo_preaviso_cheq = GetId_codigoArchivo(info.IdEmpresa, info.Fecha);
                    address.IdBanco     = info.IdBanco;
                    address.Nom_Archivo = info.Nom_Archivo;
                    address.Fecha       = info.Fecha;
                    if (info.Archivo == null)
                    {
                        info.Archivo = new byte[000000];
                    }

                    address.Archivo = info.Archivo;

                    address.Estado        = info.Estado;
                    address.IdUsuario     = info.IdUsuario;
                    address.Fecha_Transac = (DateTime)info.Fecha_Transac;
                    address.Observacion   = info.Observacion;
                    context.ba_Archivo_Transferencia_x_PreAviso_Cheq.Add(address);
                    context.SaveChanges();
                    IdArchivo = address.IdArchivo_preaviso_cheq;
                    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.º 28
0
 public ba_Banco_Cuenta_Info Get_Info_Banco_Cuenta(int IdEmpresa, int Idbanco)
 {
     try
     {
         using (EntitiesBanco Entity = new EntitiesBanco())
         {
             ba_Banco_Cuenta banco = Entity.ba_Banco_Cuenta.FirstOrDefault(v => v.IdEmpresa == IdEmpresa && v.IdBanco == Idbanco);
             if (banco != null)
             {
                 return(new ba_Banco_Cuenta_Info()
                 {
                     IdCtaCble = banco.IdCtaCble,
                     ba_descripcion = banco.ba_descripcion,
                     ba_Moneda = banco.ba_Moneda
                     ,
                     ba_Num_Cuenta = banco.ba_Num_Cuenta,
                     IdEmpresa = banco.IdEmpresa,
                     IdBanco = banco.IdBanco,
                     ba_Tipo = banco.ba_Tipo,
                     ba_num_digito_cheq = banco.ba_num_digito_cheq,
                     Reporte = banco.Reporte,
                     ReporteSolo_Cheque = banco.ReporteSolo_Cheque,
                     Imprimir_Solo_el_cheque = banco.Imprimir_Solo_el_cheque,
                     MostrarVistaPreviaCheque = banco.MostrarVistaPreviaCheque,
                     IdBanco_Financiero = banco.IdBanco_Financiero
                 });
             }
             else
             {
                 return(new ba_Banco_Cuenta_Info());
             }
         }
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                   "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
        public string GetId_codigoArchivo_bolivariano(int IdEmpresa, int IdBanco, DateTime fecha)
        {
            string Id = "";

            try
            {
                fecha = fecha.Date;

                EntitiesBanco context = new EntitiesBanco();

                var q = from C in context.ba_Archivo_Transferencia
                        where C.IdEmpresa == IdEmpresa &&
                        C.IdBanco == IdBanco &&
                        C.Fecha == fecha
                        select C;
                if (q.ToList().Count == 0)
                {
                    Id = fecha.Year.ToString().PadLeft(2, '0') + fecha.Month.ToString().PadLeft(2, '0') + fecha.Day.ToString().PadLeft(2, '0') + "001";
                }
                else
                {
                    var select_ = (from Query in context.ba_Archivo_Transferencia
                                   where Query.IdEmpresa == IdEmpresa &&
                                   Query.Fecha == fecha &&
                                   Query.IdBanco == IdBanco
                                   select Query.cod_archivo).Max();
                    int len       = select_.Length;
                    int secuencia = Convert.ToInt32(select_.Substring(9, len - 9));
                    secuencia = secuencia + 1;
                    Id        = fecha.Year.ToString().PadLeft(2, '0') + fecha.Month.ToString().PadLeft(2, '0') + fecha.Day.ToString().PadLeft(2, '0') + Convert.ToString(secuencia).PadLeft(3, '0');
                }
                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);
                throw new Exception(ex.ToString());
            }
        }
 public Boolean EliminarDB(int IdEmpresa, decimal IdConciliacion)
 {
     try
     {
         EntitiesBanco context = new EntitiesBanco();
         context.Database.ExecuteSqlCommand("delete from ba_Conciliacion_det_IngEgr where IdEmpresa = " + IdEmpresa + "  and IdConciliacion= " + IdConciliacion);
         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());
     }
 }