Exemple #1
0
        public Boolean ModificarDB(List <ba_Banco_Parametros_Info> lista, int IdEmpresa)
        {
            try
            {
                using (EntitiesBanco Contex = new EntitiesBanco())
                {
                    EntitiesBanco param_Info = new EntitiesBanco();
                    foreach (var item in lista)
                    {
                        var selectBaParam = (from C in param_Info.ba_Cbte_Ban_tipo_x_ct_CbteCble_tipo
                                             where C.IdEmpresa == IdEmpresa && C.CodTipoCbteBan == item.CodTipoCbteBan
                                             select C).Count();
                        if (selectBaParam == 0)
                        {
                            var address = new ba_Cbte_Ban_tipo_x_ct_CbteCble_tipo();
                            address.IdEmpresa          = IdEmpresa;
                            address.CodTipoCbteBan     = item.CodTipoCbteBan;
                            address.IdTipoCbteCble     = item.IdTipoCbteCble;
                            address.IdTipoCbteCble_Anu = item.IdTipoCbteCble_Anu;
                            address.IdCtaCble          = item.IdCtaCble;
                            address.Tipo_DebCred       = item.Tipo_DebCred;



                            Contex.ba_Cbte_Ban_tipo_x_ct_CbteCble_tipo.Add(address);


                            Contex.SaveChanges();
                        }
                        else
                        {
                            var contact = Contex.ba_Cbte_Ban_tipo_x_ct_CbteCble_tipo.FirstOrDefault(cot => cot.IdEmpresa == IdEmpresa && cot.CodTipoCbteBan == item.CodTipoCbteBan);
                            if (contact != null)
                            {
                                contact.IdTipoCbteCble     = item.IdTipoCbteCble;
                                contact.IdTipoCbteCble_Anu = item.IdTipoCbteCble_Anu;
                                contact.IdCtaCble          = item.IdCtaCble;
                                contact.Tipo_DebCred       = item.Tipo_DebCred;



                                Contex.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;
                throw new Exception(ex.ToString());
            }
        }
        public Boolean ModificarDB(ba_parametros_Info Info, int IdEmpresa)
        {
            try
            {
                using (EntitiesBanco Contex = new EntitiesBanco())
                {
                    EntitiesBanco param_Info = new EntitiesBanco();

                    var selectBaParam = (from C in param_Info.ba_parametros
                                         where C.IdEmpresa == IdEmpresa
                                         select C).Count();
                    if (selectBaParam == 0)
                    {
                        var address = new ba_parametros();
                        address.IdEmpresa = IdEmpresa;
                        address.El_Diario_Contable_es_modificable  = true;
                        address.CiudadDefaultParaCrearCheques      = "GUAYAQUIL";
                        address.Ruta_descarga_fila_x_PreAviso_cheq = "";

                        Contex.ba_parametros.Add(address);
                        Contex.SaveChanges();
                    }
                    else
                    {
                        var contact = Contex.ba_parametros.FirstOrDefault(cot => cot.IdEmpresa == IdEmpresa);
                        if (contact != null)
                        {
                            contact.El_Diario_Contable_es_modificable  = Info.El_Diario_Contable_es_modificable;
                            contact.CiudadDefaultParaCrearCheques      = Info.CiudadDefaultParaCrearCheques;
                            contact.IdTipoCbte_x_Prestamo              = Info.IdTipoCbte_x_Prestamo;
                            contact.IdTipoNota_ND_Can_Cuotas           = Info.IdTipoNota_ND_Can_Cuotas;
                            contact.Ruta_descarga_fila_x_PreAviso_cheq = Info.Ruta_descarga_fila_x_PreAviso_cheq;
                            contact.IdCtaCble_Interes   = Info.IdCtaCble_Interes;
                            contact.IdCtaCble_prestamos = Info.IdCtaCble_prestamos;

                            contact.IdUsuario = Info.IdUsuario;
                            contact.nom_pc    = Info.nom_pc;
                            contact.ip        = Info.ip;
                            Contex.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;
                throw new Exception(ex.ToString());
            }
        }
Exemple #3
0
        public Boolean ModificarDB(List <ba_Banco_Otros_Parametros_Info> lista, int IdEmpresa)
        {
            try
            {
                using (EntitiesBanco Contex = new EntitiesBanco())
                {
                    EntitiesBanco param_Info = new EntitiesBanco();

                    var selectBaParam = (from C in param_Info.ba_parametros
                                         where C.IdEmpresa == IdEmpresa
                                         select C).Count();
                    if (selectBaParam == 0)
                    {
                        var address = new ba_parametros();
                        address.IdEmpresa = IdEmpresa;
                        address.El_Diario_Contable_es_modificable = true;
                        address.CiudadDefaultParaCrearCheques     = "GUAYAQUIL";
                        Contex.ba_parametros.Add(address);
                        Contex.SaveChanges();
                    }
                    else
                    {
                        foreach (var item in lista)
                        {
                            var contact = Contex.ba_parametros.FirstOrDefault(cot => cot.IdEmpresa == IdEmpresa);
                            if (contact != null)
                            {
                                contact.El_Diario_Contable_es_modificable = item.El_Diario_Contable_es_modificable;
                                contact.CiudadDefaultParaCrearCheques     = item.CiudadDefaultParaCrearCheques;
                                contact.IdUsuario = item.IdUsuario;
                                contact.nom_pc    = item.nom_pc;
                                contact.ip        = item.ip;
                                Contex.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;
                throw new Exception(ex.ToString());
            }
        }
        public bool GrabarDB(List <ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info> Lista)
        {
            try
            {
                int secuencia = 0;
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    foreach (var item in Lista)
                    {
                        secuencia = secuencia + 1;
                        ba_Archivo_Transferencia_x_PreAviso_Cheq_det Addres = new ba_Archivo_Transferencia_x_PreAviso_Cheq_det();
                        Addres.IdEmpresa = item.IdEmpresa;


                        context.ba_Archivo_Transferencia_x_PreAviso_Cheq_det.Add(Addres);
                        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.ToString());
            }
        }
Exemple #5
0
 public Boolean AnularDB(ba_prestamo_Info _Info)
 {
     try
     {
         using (EntitiesBanco Entity = new EntitiesBanco())
         {
             ba_prestamo cabecera = Entity.ba_prestamo.FirstOrDefault(v => v.IdPrestamo == _Info.IdPrestamo && v.IdEmpresa == _Info.IdEmpresa);
             if (cabecera != null)
             {
                 cabecera.IdUsuarioUltAnu = _Info.IdUsuarioUltAnu;
                 cabecera.Fecha_UltAnu    = _Info.Fecha_UltAnu;
                 cabecera.MotiAnula       = _Info.MotiAnula;
                 cabecera.Estado          = "I";
                 Entity.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;
         throw new Exception(ex.ToString());
     }
 }
Exemple #6
0
 public bool ModificarDB(ba_Catalogo_Info info)
 {
     try
     {
         EntitiesBanco context   = new EntitiesBanco();
         var           contenido = context.ba_Catalogo.FirstOrDefault(var => var.IdCatalogo == info.IdCatalogo);
         if (contenido != null)
         {
             contenido.ca_descripcion = info.ca_descripcion;
             contenido.ca_orden       = info.ca_orden;
             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;
         throw new Exception(ex.ToString());
     }
 }
        public bool AnularDB(ba_Archivo_Transferencia_x_PreAviso_Cheq_Info info)
        {
            try
            {
                List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info> Lista = new List <ba_Archivo_Transferencia_x_PreAviso_Cheq_Info>();

                using (EntitiesBanco context = new EntitiesBanco())
                {
                    var contact = context.ba_Archivo_Transferencia_x_PreAviso_Cheq.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa &&
                                                                                                  minfo.IdBanco == info.IdBanco &&
                                                                                                  minfo.IdArchivo_preaviso_cheq == info.IdArchivo_preaviso_cheq);

                    contact.Estado           = false;
                    contact.IdUsuarioUltAnu  = info.IdUsuarioUltAnu;
                    contact.Fecha_UltAnu     = info.Fecha_UltAnu;
                    contact.Motivo_anulacion = info.Motivo_anulacion;
                    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.ToString());
            }
        }
Exemple #8
0
 public Boolean AnularDB(ba_Conciliacion_Info info)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             /* Se decidió eliminar por completo de la base para asegurar consistencia de registros
              * Aprobado por RICARDO YANZA
              */
             var contact = context.ba_Conciliacion.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdConciliacion == info.IdConciliacion);
             if (contact != null)
             {
                 contact.Estado          = "I";
                 contact.FechaAnulacion  = info.FechaAnulacion;
                 contact.IdUsuario_Anu   = info.IdUsuario_Anu;
                 contact.MotivoAnulacion = info.MotivoAnulacion;
                 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;
         throw new Exception(ex.ToString());
     }
 }
 public Boolean ModificarDB(ba_Conciliacion_det_IngEgr_Info info)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             var contact = context.ba_Conciliacion_det_IngEgr.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdConciliacion == info.IdConciliacion && minfo.Secuencia == info.Secuencia);
             if (contact != null)
             {
                 contact.tipo_IngEgr       = info.tipo_IngEgr;
                 contact.IdCbteCble        = info.IdCbteCble;
                 contact.IdTipocbte        = info.IdTipocbte;
                 contact.SecuenciaCbteCble = info.SecuenciaCbteCble;
                 contact.Estado            = info.Estado;
                 contact.IdUsuarioUltMod   = info.IdUsuarioUltMod;
                 contact.Fecha_UltMod      = info.Fecha_UltMod;
                 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;
         throw new Exception(ex.ToString());
     }
 }
Exemple #10
0
 public Boolean AnularDB(ba_tipo_nota_Info Info, ref string msg)
 {
     try
     {
         EntitiesBanco context = new EntitiesBanco();
         var           address = context.ba_tipo_nota.FirstOrDefault(var => var.IdEmpresa == Info.IdEmpresa && var.IdTipoNota == Info.IdTipoNota);
         if (address != null)
         {
             address.Tipo          = Info.Tipo;
             address.Descripcion   = Info.Descripcion;
             address.IdCtaCble     = Info.IdCtaCble;
             address.IdCentroCosto = Info.IdCentroCosto;
             address.Estado        = "I";
             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);
         msg = ex.ToString() + " " + ex.Message;
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref msg);
         msg = "Se ha producido el siguiente error: " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
Exemple #11
0
 public Boolean AnularDB(ba_Inversion_Info Info, ref string msg)
 {
     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.Estado          = "I";
                 item.Fecha_UltAnu    = Info.Fecha_UltAnu;
                 item.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                 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;
         msg     = ex.Message + ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
        public Boolean CancelarEstadoDetallePrestamo(ba_prestamo_detalle_Info info, ref string msg)
        {
            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    var contact = context.ba_prestamo_detalle.FirstOrDefault(VProdu => VProdu.IdEmpresa == info.IdEmpresa && VProdu.IdPrestamo == info.IdPrestamo && VProdu.NumCuota == info.NumCuota);
                    if (contact != null)
                    {
                        contact.EstadoPago = "CAN";

                        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;
                msg     = "Error al Grabar" + ex.InnerException;
                throw new Exception(ex.ToString());
            }
        }
        public Boolean AnularDetallePrestamo(List <ba_prestamo_detalle_Info> listadetalle, ref string msg)
        {
            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    foreach (var item in listadetalle)
                    {
                        var contact = context.ba_prestamo_detalle.FirstOrDefault(VProdu => VProdu.IdEmpresa == item.IdEmpresa && VProdu.IdPrestamo == item.IdPrestamo && VProdu.NumCuota == item.NumCuota);
                        if (contact != null)
                        {
                            contact.Estado     = "I";
                            contact.EstadoPago = item.EstadoPago;

                            context.SaveChanges();
                            msg = "Se ha procedido a Anular el detalle #: " + item.IdPrestamo + " 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     = "Error al Grabar" + ex.ToString();
                throw new Exception(ex.ToString());
            }
        }
 public bool GrabarDB(List <ba_prestamo_detalle_x_af_activo_fijo_Prendados_Info> lista)
 {
     try
     {
         using (EntitiesBanco db = new EntitiesBanco())
         {
             foreach (var item in lista)
             {
                 ba_prestamo_detalle_x_af_activo_fijo_Prendados add = new ba_prestamo_detalle_x_af_activo_fijo_Prendados();
                 add.IdEmpresa    = item.IdEmpresa;
                 add.IdPrestamo   = item.IdPrestamo;
                 add.IdActivoFijo = item.IdActivoFijo;
                 if (item.Garantia_Bancaria > 0)
                 {
                     add.Garantia_Bancaria = Convert.ToDouble(item.Garantia_Bancaria);
                 }
                 db.ba_prestamo_detalle_x_af_activo_fijo_Prendados.Add(add);
                 db.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 Boolean GrabarListadoMovCaja_x_Deposito(List <caj_Caja_Movimiento_Info> Lst, int IdtipoCbteCble_Bco, decimal IdCbteCble_Bco)
        {
            try
            {
                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    foreach (var item in Lst)
                    {
                        ba_Caja_Movimiento_x_Cbte_Ban_x_Deposito Address = new ba_Caja_Movimiento_x_Cbte_Ban_x_Deposito();

                        Address.mcj_IdEmpresa  = item.IdEmpresa;
                        Address.mcj_IdCbteCble = item.IdCbteCble;
                        Address.mcj_IdTipocbte = item.IdTipocbte;
                        Address.mba_IdEmpresa  = item.IdEmpresa;
                        Address.mba_IdCbteCble = IdCbteCble_Bco;
                        Address.mba_IdTipocbte = IdtipoCbteCble_Bco;
                        Address.mcj_Secuencia  = item.secuencial;

                        Context.ba_Caja_Movimiento_x_Cbte_Ban_x_Deposito.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 bool AnularDB(List <ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info> lista)
        {
            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    foreach (var item in lista)
                    {
                        var contact = context.ba_Archivo_Transferencia_x_PreAviso_Cheq_det.FirstOrDefault(minfo => minfo.IdEmpresa == item.IdEmpresa &&
                                                                                                          minfo.IdArchivo_preaviso_cheq == item.IdArchivo_preaviso_cheq &&
                                                                                                          minfo.secuencia == item.secuencia);

                        //contact.Estado = "I";

                        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.ToString());
            }
        }
Exemple #17
0
 public Boolean GrabarDB(ba_Cbte_Ban_Datos_Entrega_cheq_Info info, ref string MensajeError)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             ba_Cbte_Ban_Datos_Entrega_cheq address = new ba_Cbte_Ban_Datos_Entrega_cheq();
             address.IdEmpresa           = info.IdEmpresa;
             address.IdCbteCble          = info.IdCbteCble;
             address.IdTipocbte          = info.IdTipocbte;
             address.fecha_hora_entrega  = info.fecha_hora_entrega;
             address.IdEstado_cheque_cat = info.IdEstado_cheque_cat;
             address.IdPersona_Entrega   = info.IdPersona_Entrega;
             address.Nota_entrega        = info.Nota_entrega;
             address.fecha_trans         = info.fecha_trans;
             address.usuario             = info.usuario;
             context.ba_Cbte_Ban_Datos_Entrega_cheq.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 MensajeError);
         MensajeError = ex.InnerException + " " + ex.Message;
         Console.WriteLine(ex.InnerException.Message);
         throw new Exception(ex.InnerException.ToString());
     }
 }
Exemple #18
0
 public Boolean GuardarDB(ba_tipo_nota_Info Info)
 {
     try
     {
         EntitiesBanco context = new EntitiesBanco();
         var           address = new ba_tipo_nota();
         address.IdEmpresa     = Info.IdEmpresa;
         address.IdTipoNota    = Info.IdTipoNota = GetId(Info.IdEmpresa);
         address.Tipo          = Info.Tipo;
         address.Descripcion   = Info.Descripcion;
         address.IdCtaCble     = Info.IdCtaCble;
         address.IdCentroCosto = Info.IdCentroCosto;
         address.Estado        = Info.Estado;
         context.ba_tipo_nota.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.ToString());
     }
 }
Exemple #19
0
 public Boolean ActualizarEstado(ba_Banco_Cuenta_Info info)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             var contact = context.ba_Banco_Cuenta.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdBanco == info.IdBanco);
             if (contact != null)
             {
                 contact.Estado = "I";
                 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;
         throw new Exception(ex.ToString());
     }
 }
 public Boolean GuardarDB(ref ba_Catalogo_Info Info)
 {
     try
     {
         using (EntitiesBanco Context = new EntitiesBanco())
         {
             var Address = new ba_Catalogo();
             Address.IdCatalogo     = Info.IdCatalogo;
             Address.IdTipoCatalogo = Info.IdTipoCatalogo;
             Address.ca_descripcion = Info.ca_descripcion;
             Address.ca_estado      = "A";
             Context.ba_Catalogo.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;
         return(false);
     }
 }
        public Boolean Actualizar_registro(ba_Archivo_Transferencia_x_PreAviso_Cheq_det_Info Info)
        {
            try
            {
                using (EntitiesBanco Conexion = new EntitiesBanco())
                {
                    ba_Archivo_Transferencia_x_PreAviso_Cheq_det Entity = Conexion.ba_Archivo_Transferencia_x_PreAviso_Cheq_det.FirstOrDefault(q => q.IdEmpresa == Info.IdEmpresa &&
                                                                                                                                               q.IdArchivo_preaviso_cheq == Info.IdArchivo_preaviso_cheq &&
                                                                                                                                               q.secuencia == Info.secuencia);

                    //Entity.Id_Item = Info.Id_Item;
                    //Entity.IdEstadoRegistro_cat = Info.IdEstadoRegistro_cat;
                    //**Entity.Valor_cobrado = Info.Valor_cobrado;

                    Conexion.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.ToString());
            }
        }
 public Boolean AnularDB(ba_Catalogo_Info Info)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             var contact = context.ba_Catalogo.FirstOrDefault(var => var.IdCatalogo == Info.IdCatalogo && var.IdTipoCatalogo == Info.IdTipoCatalogo);
             if (contact != null)
             {
                 contact.ca_estado = "I";
                 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;
         throw new Exception(ex.ToString());
     }
 }
Exemple #23
0
        // MIGRADO  ba_prestamo_detalle_cancelacion
        public Boolean GuardarDetallePrestamosCancelados(List <ba_prestamo_detalle_Info> Listado, ref string msg)
        {
            try
            {
                Boolean resu = false;
                try
                {
                    using (EntitiesBanco context = new EntitiesBanco())
                    {
                        foreach (var item in Listado)
                        {
                            ba_prestamo_detalle_cancelacion reg = new ba_prestamo_detalle_cancelacion();

                            reg.IdEmpresa        = item.IdEmpresa;
                            reg.IdPrestamo       = item.IdPrestamo;
                            reg.FechaPago        = item.FechaPago;
                            reg.Monto_Canc       = Convert.ToDouble(item.Monto_x_Canc);
                            reg.NumCuota         = item.NumCuota;
                            reg.Saldo            = item.Saldo;
                            reg.Observacion_canc = item.Observacion_canc;
                            reg.Secuencia        = Get_Secuencia(item.IdEmpresa, item.IdPrestamo, item.NumCuota);
                            if (reg.Secuencia == 0)
                            {
                                mensaje = "Error al Obtener la Secuencia de Pago"; return(false);
                            }
                            reg.Fecha_Transac = item.Fecha_Transac;
                            reg.IdUsuario     = item.IdUsuario;
                            reg.ip            = item.ip;
                            reg.nom_pc        = item.nom_pc;

                            context.ba_prestamo_detalle_cancelacion.Add(reg);
                        }
                        context.SaveChanges();
                    }
                    return(resu = 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.Message + ex.InnerException;
                    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());
            }
        }
Exemple #24
0
 //MIGRADO  ba_prestamo_detalle_cancelacion
 public Boolean ActualizarDetallePrestamosCancelados(ba_prestamo_detalle_Info Info, ref string msg)
 {
     try
     {
         using (EntitiesBanco Entity = new EntitiesBanco())
         {
             ba_prestamo_detalle_cancelacion cancelacion = Entity.ba_prestamo_detalle_cancelacion.FirstOrDefault(v => v.IdPrestamo == Info.IdPrestamo && v.IdEmpresa == Info.IdEmpresa && v.NumCuota == Info.NumCuota && v.Secuencia == Info.Secuencia);
             if (cancelacion != null)
             {
                 cancelacion.FechaPago        = Info.FechaPago;
                 cancelacion.Observacion_canc = Info.Observacion_canc;
                 Entity.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;
         msg     = ex.Message + ex.ToString();
         throw new Exception(ex.ToString());
     }
 }
        public bool Actualizar_estado_contabilizacion(ba_Archivo_Transferencia_Info info_archivo)
        {
            try
            {
                using (EntitiesBanco Context = new EntitiesBanco())
                {
                    ba_Archivo_Transferencia Entity = Context.ba_Archivo_Transferencia.FirstOrDefault(q => q.IdEmpresa == info_archivo.IdEmpresa && q.IdArchivo == info_archivo.IdArchivo);
                    if (Entity != null)
                    {
                        Entity.Contabilizado = info_archivo.Contabilizado;
                        Entity.EnviarCorreo  = true;
                        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.ToString());
            }
        }
Exemple #26
0
 public Boolean AnularDB(ba_TipoFlujo_Info Infoo)
 {
     try
     {
         using (EntitiesBanco entity = new EntitiesBanco())
         {
             ba_TipoFlujo ObjAMOdificar = entity.ba_TipoFlujo.FirstOrDefault(delegate(ba_TipoFlujo va) { return(va.IdTipoFlujo == Infoo.IdTipoFlujo && va.IdEmpresa == Infoo.IdEmpresa); });
             if (ObjAMOdificar != null)
             {
                 ObjAMOdificar.Estado = "I";
                 entity.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;
         throw new Exception(ex.ToString());
     }
 }
 public Boolean Modificar_CbteCble(ba_Cbte_Ban_Info CbteBan_I, string Num_cheque, ref string msg)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             var contact = context.ba_Talonario_cheques_x_banco.FirstOrDefault(minfo => minfo.IdEmpresa == CbteBan_I.IdEmpresa && minfo.IdBanco == CbteBan_I.IdBanco && minfo.Num_cheque == Num_cheque);
             if (contact != null)
             {
                 contact.Usado = true;
                 contact.IdEmpresa_cbtecble_Usado  = CbteBan_I.IdEmpresa;
                 contact.IdTipoCbte_cbtecble_Usado = CbteBan_I.IdTipocbte;
                 contact.IdCbteCble_cbtecble_Usado = CbteBan_I.IdCbteCble;
                 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;
         throw new Exception(ex.ToString());
     }
 }
 public Boolean AnularDB(ba_Talonario_cheques_x_banco_Info Info, ref string msg)
 {
     try
     {
         using (EntitiesBanco context = new EntitiesBanco())
         {
             var contact = context.ba_Talonario_cheques_x_banco.FirstOrDefault(minfo => minfo.IdEmpresa == Info.IdEmpresa && minfo.Num_cheque == Info.Num_cheque);
             if (contact != null)
             {
                 contact.Estado          = "I";
                 contact.IdUsuario_Anu   = Info.IdUsuario_Anu;
                 contact.MotivoAnulacion = Info.MotivoAnulacion;
                 contact.FechaAnulacion  = Info.FechaAnulacion;
                 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());
     }
 }
Exemple #29
0
        public Boolean GrabarDB(ba_Banco_Cuenta_Info info, ref int idBan)
        {
            try
            {
                int idBanco;

                using (EntitiesBanco context = new EntitiesBanco())
                {
                    EntitiesBanco EDB = new EntitiesBanco();
                    var           Q   = from reg in EDB.ba_Banco_Cuenta
                                        where reg.IdEmpresa == info.IdEmpresa &&
                                        reg.IdBanco == info.IdBanco
                                        select reg;
                    if (Q.ToList().Count == 0)
                    {
                        idBanco = getId(info.IdEmpresa);
                        ba_Banco_Cuenta address = new ba_Banco_Cuenta();
                        address.IdEmpresa          = info.IdEmpresa;
                        address.IdBanco            = idBanco;
                        address.ba_descripcion     = info.ba_descripcion;
                        address.ba_num_digito_cheq = Convert.ToInt32(info.ba_num_digito_cheq);
                        address.ba_Moneda          = info.ba_Moneda;
                        address.ba_Num_Cuenta      = info.ba_Num_Cuenta;
                        address.ba_Tipo            = info.ba_Tipo;
                        address.ba_Ultimo_Cheque   = "0";
                        address.Estado             = info.Estado;
                        address.IdCtaCble          = info.IdCtaCble;
                        address.Fecha_Transac      = info.Fecha_Transac;
                        address.IdUsuario          = info.IdUsuario;
                        address.nom_pc             = info.nom_pc;
                        address.ip                       = info.ip;
                        address.Reporte                  = info.Reporte;
                        address.ReporteSolo_Cheque       = info.ReporteSolo_Cheque;
                        address.MostrarVistaPreviaCheque = info.MostrarVistaPreviaCheque;
                        address.Imprimir_Solo_el_cheque  = info.Imprimir_Solo_el_cheque;
                        address.IdBanco_Financiero       = info.IdBanco_Financiero;
                        context.ba_Banco_Cuenta.Add(address);
                        context.SaveChanges();
                        idBan = idBanco;
                    }
                    else
                    {
                        return(false);
                    }
                }
                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 Boolean GrabarDB(ba_Talonario_cheques_x_banco_Info info, ref string mensaje)
        {
            try
            {
                using (EntitiesBanco context = new EntitiesBanco())
                {
                    EntitiesBanco EDB = new EntitiesBanco();

                    var Q = from per in EDB.ba_Talonario_cheques_x_banco
                            where (per.Num_cheque == info.Num_cheque &&
                                   per.IdEmpresa == info.IdEmpresa &&
                                   per.IdBanco == info.IdBanco) ||
                            (per.secuencia == info.secuencia &&
                             per.IdEmpresa == info.IdEmpresa &&
                             per.IdBanco == info.IdBanco)
                            select per;

                    if (Q.ToList().Count == 0)
                    {
                        var address = new ba_Talonario_cheques_x_banco();

                        address.IdEmpresa = info.IdEmpresa;
                        address.secuencia = GetSecuencia(info.IdEmpresa);
                        address.IdBanco   = info.IdBanco;
                        address.IdCbteCble_cbtecble_Usado = info.IdCbteCble_cbtecble_Usado;
                        address.IdEmpresa_cbtecble_Usado  = info.IdEmpresa_cbtecble_Usado;
                        address.IdTipoCbte_cbtecble_Usado = info.IdTipoCbte_cbtecble_Usado;
                        address.IdUsuario_Anu             = (info.IdUsuario_Anu == null) ? "" : info.IdUsuario_Anu;
                        //address.MotivoAnulacion = info.MotivoAnulacion;
                        //address.FechaAnulacion = info.FechaAnulacion;
                        address.Fecha_uso  = DateTime.Now;
                        address.Num_cheque = info.Num_cheque;
                        address.Usado      = info.Usado;
                        address.Estado     = info.Estado;

                        context.ba_Talonario_cheques_x_banco.Add(address);
                        context.SaveChanges();

                        mensaje = "Se ha procedido a guardar ..# : " + info.Num_cheque.ToString() + " EXITOSAMENTE";
                    }
                    else
                    {
                        return(false);
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                mensaje = "Error al grabar .." + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }