public Boolean ModificarDB(cp_codigo_SRI_x_CtaCble_Info info)
        {
            try
            {
                using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
                {
                    EntitiesCuentasxPagar param = new EntitiesCuentasxPagar();
                    var selectBaParam           = (from C in param.cp_codigo_SRI_x_CtaCble
                                                   where C.IdEmpresa == info.IdEmpresa &&
                                                   C.idCodigo_SRI == info.idCodigo_SRI
                                                   select C).Count();

                    if (selectBaParam == 0)
                    {
                        cp_codigo_SRI_x_CtaCble addressG = new cp_codigo_SRI_x_CtaCble();
                        addressG.IdEmpresa    = info.IdEmpresa;
                        addressG.idCodigo_SRI = info.idCodigo_SRI;
                        addressG.IdCtaCble    = info.IdCtaCble;
                        addressG.fecha_UltMod = info.fecha_UltMod;
                        addressG.idUsuario    = info.idUsuario;
                        addressG.ip           = info.ip;
                        addressG.nom_pc       = info.nom_pc;

                        context.cp_codigo_SRI_x_CtaCble.Add(addressG);
                        context.SaveChanges();
                    }
                    else
                    {
                        var contact = context.cp_codigo_SRI_x_CtaCble.FirstOrDefault(var => var.IdEmpresa == info.IdEmpresa && var.idCodigo_SRI == info.idCodigo_SRI);
                        if (contact != null)
                        {
                            contact.IdEmpresa    = info.IdEmpresa;
                            contact.idCodigo_SRI = info.idCodigo_SRI;
                            contact.IdCtaCble    = info.IdCtaCble;
                            contact.fecha_UltMod = info.fecha_UltMod;
                            contact.idUsuario    = info.idUsuario;
                            contact.ip           = info.ip;
                            contact.nom_pc       = info.nom_pc;
                            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());
            }
        }
Beispiel #2
0
        public bool ModificarDB_campos_op(cp_cuotas_x_doc_det_Info info)
        {
            try
            {
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    cp_cuotas_x_doc_det Entity = Context.cp_cuotas_x_doc_det.FirstOrDefault(q => q.IdEmpresa == info.IdEmpresa && q.IdCuota == info.IdCuota && q.Secuencia == info.Secuencia);
                    if (Entity != null)
                    {
                        Entity.IdEmpresa_op = info.IdEmpresa_op;
                        Entity.IdOrdenPago  = info.IdOrdenPago;
                        Entity.Secuencia_op = info.Secuencia_op;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.InnerException + " " + ex.Message;
                throw new Exception(ex.InnerException.ToString());
            }
        }
 public Boolean ModificarDB(cp_orden_pago_det_Info Info, ref decimal Id, ref string mensaje)
 {
     try
     {
         using (EntitiesCuentasxPagar Entity = new EntitiesCuentasxPagar())
         {
             cp_orden_pago_det ordenPagoDet = Entity.cp_orden_pago_det.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdOrdenPago == Info.IdOrdenPago);
             if (ordenPagoDet != null)
             {
                 ordenPagoDet.IdEmpresa_cxp  = Info.IdEmpresa_cxp;
                 ordenPagoDet.IdTipoCbte_cxp = Info.IdTipoCbte_cxp;
                 ordenPagoDet.IdCbteCble_cxp = Info.IdCbteCble_cxp;
                 //ordenPagoDet.Valor_a_pagar = Info.Valor_a_pagar;
                 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 ModificarDB(cp_orden_pago_det_Info Info)
        {
            try
            {
                EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();
                var address = context.cp_orden_pago_det.FirstOrDefault(var => var.IdOrdenPago == Info.IdOrdenPago && var.IdEmpresa == Info.IdEmpresa && var.Secuencia == Info.Secuencia);
                if (address != null)
                {
                    address.IdFormaPago          = Info.IdFormaPago;
                    address.Fecha_Pago           = Info.Fecha_Pago;
                    address.IdEstadoAprobacion   = Info.IdEstadoAprobacion;
                    address.IdUsuario_Aprobacion = Info.IdUsuario_Aproba;
                    address.fecha_hora_Aproba    = Info.fecha_hora_Aproba;
                    address.Motivo_aproba        = "";

                    context.SaveChanges();

                    cp_orden_pago_Data data = new cp_orden_pago_Data();
                    data.ModificarDB(Info.IdEmpresa, Convert.ToInt32(Info.IdOrdenPago), "APRO");
                }
                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(cp_orden_giro_x_imp_ordencompra_ext_Info info)
 {
     try
     {
         using (EntitiesCuentasxPagar Contex = new EntitiesCuentasxPagar())
         {
             var contact = Contex.cp_orden_giro_x_imp_ordencompra_ext.FirstOrDefault(var => var.og_IdEmpresa == info.og_IdEmpresa && var.og_IdCbteCble == info.og_IdCbteCble && var.og_IdTipoCbte == info.og_IdTipoCbte);
             if (contact != null)
             {
                 contact.imp_IdEmpresa        = info.imp_IdEmpresa;
                 contact.imp_IdSucursal       = info.imp_IdSucursal;
                 contact.imp_IdOrdenCompraExt = info.imp_IdOrdenCompraExt;
                 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 EliminarDB(int IdEmpresa, int IdSucursal, decimal IdOrdenCompra, int secuencia, ref string mensaje)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_orden_giro_x_com_ordencompra_local_det.FirstOrDefault(cp => cp.IdEmpresa_OC == IdEmpresa && cp.IdSucursal_OC == IdSucursal && cp.IdOrdenCompra == IdOrdenCompra && cp.Secuencia_OC == secuencia);
             if (contact != null)
             {
                 context.cp_orden_giro_x_com_ordencompra_local_det.Remove(contact);
                 context.SaveChanges();
                 context.Dispose();
             }
         }
         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());
     }
 }
Beispiel #7
0
        public Boolean GrabarDB(cp_proveedor_codigo_SRI_Info info)
        {
            try
            {
                using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
                {
                    EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar();

                    var address = new cp_proveedor_codigo_SRI();
                    address.IdEmpresa    = info.IdEmpresa;
                    address.IdProveedor  = info.IdProveedor;
                    address.IdCodigo_SRI = info.IdCodigo_SRI;
                    address.observacion  = info.observacion == null ? "" : info.observacion.Trim();
                    context.cp_proveedor_codigo_SRI.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());
            }
        }
Beispiel #8
0
 public Boolean HabilitarDB(cp_TipoDocumento_Info info)
 {
     try
     {
         Boolean res = false;
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_TipoDocumento.FirstOrDefault(minfo => minfo.CodTipoDocumento == info.CodTipoDocumento);
             if (contact != null)
             {
                 contact.Estado          = "A";
                 contact.IdUsuarioUltMod = info.IdUsuarioUltMod;
                 contact.Fecha_UltMod    = info.Fecha_UltMod;
                 contact.nom_pc          = info.nom_pc;
                 contact.ip = info.ip;
                 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.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
Beispiel #9
0
 public Boolean AnularDB(cp_archivos_para_banco_x_cxp_Info Info)
 {
     try
     {
         using (EntitiesCuentasxPagar Entity = new EntitiesCuentasxPagar())
         {
             cp_archivos_para_banco_x_cxp info_archivo = Entity.cp_archivos_para_banco_x_cxp.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdArchivo == Info.IdArchivo);
             if (info_archivo != null)
             {
                 info_archivo.IdUsuarioUltAnu  = Info.IdUsuarioUltAnu;
                 info_archivo.Fecha_UltAnu     = Info.Fecha_UltAnu;
                 info_archivo.estado           = "I";
                 info_archivo.Motivo_anulacion = Info.Motivo_anulacion;
                 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());
     }
 }
Beispiel #10
0
 public Boolean ModificarDB(int IdEmpresa, int IdOrdenPago, string EstadoAprovacion)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_orden_pago.FirstOrDefault(obj => obj.IdEmpresa == IdEmpresa && obj.IdOrdenPago == IdOrdenPago);
             if (contact != null)
             {
                 contact.IdEstadoAprobacion = EstadoAprovacion;
                 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());
     }
 }
Beispiel #11
0
        public bool Modificar_tipo_flujo(int IdEmpresa, decimal IdOrdenPago, Nullable <decimal> IdTipoFlujo)
        {
            try
            {
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    cp_orden_pago Entity = Context.cp_orden_pago.FirstOrDefault(q => q.IdEmpresa == IdEmpresa && q.IdOrdenPago == IdOrdenPago);
                    if (Entity != null)
                    {
                        Entity.IdTipoFlujo = IdTipoFlujo;
                        Context.SaveChanges();
                    }
                }

                return(true);
            }
            catch (Exception ex)
            {
                string mensaje = "";
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "",
                                                                                          "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Beispiel #12
0
 public Boolean AnularDB(cp_orden_pago_Info Info)
 {
     try
     {
         using (EntitiesCuentasxPagar Entity = new EntitiesCuentasxPagar())
         {
             cp_orden_pago cab_Ordpag = Entity.cp_orden_pago.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.IdOrdenPago == Info.IdOrdenPago);
             if (cab_Ordpag != null)
             {
                 cab_Ordpag.Observacion     = Info.Observacion;
                 cab_Ordpag.IdUsuarioUltAnu = Info.IdUsuarioUltAnu;
                 cab_Ordpag.Fecha_UltAnu    = Info.Fecha_UltAnu;
                 cab_Ordpag.MotivoAnu       = Info.MotiAnula;
                 cab_Ordpag.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 bool GuardarDB(cp_RutaPorEmpresaPorUsuario_Info info)
        {
            try
            {
                using (EntitiesCuentasxPagar db = new EntitiesCuentasxPagar())
                {
                    var Entity = db.cp_RutaPorEmpresaPorUsuario.Where(q => q.IdEmpresa == info.IdEmpresa && q.IdUsuario.ToLower() == info.IdUsuario.ToLower()).FirstOrDefault();
                    if (Entity == null)
                    {
                        db.cp_RutaPorEmpresaPorUsuario.Add(new cp_RutaPorEmpresaPorUsuario
                        {
                            IdUsuario = info.IdUsuario,
                            IdEmpresa = info.IdEmpresa,
                            RutaXML   = info.RutaXML
                        });
                    }
                    else
                    {
                        Entity.RutaXML = info.RutaXML;
                    }
                    db.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #14
0
 public Boolean EliminarDB(cp_retencion_det_Info info)
 {
     try
     {
         Boolean res = false;
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_retencion_det.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa &&
                                                                   minfo.IdRetencion == info.IdRetencion &&
                                                                   minfo.Idsecuencia == info.Idsecuencia);
             if (contact != null)
             {
                 context.cp_retencion_det.Remove(contact);
                 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.InnerException + " " + ex.Message;
         throw new Exception(ex.InnerException.ToString());
     }
 }
Beispiel #15
0
 public Boolean ModificarDB(cp_orden_pago_tipo_Info Info)
 {
     try
     {
         EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();
         var address = context.cp_orden_pago_tipo.FirstOrDefault(var => var.IdTipo_op == Info.IdTipo_op);
         if (address != null)
         {
             address.Descripcion  = Info.Descripcion;
             address.GeneraDiario = Info.GeneraDiario;
             address.Estado       = Info.Estado;
             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(cp_proveedor_clase_Info info, ref string mensaje)
 {
     try
     {
         Boolean res = false;
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_proveedor_clase.FirstOrDefault(var => var.IdEmpresa == info.IdEmpresa && var.IdClaseProveedor == info.IdClaseProveedor);
             if (contact != null)
             {
                 contact.Estado       = "I";
                 contact.IdUsuarioAnu = info.IdUsuarioAnu;
                 contact.FechaAnu     = info.FechaAnu;
                 contact.MotivoAnu    = info.MotivoAnu;
                 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;
         throw new Exception(ex.ToString());
     }
 }
Beispiel #17
0
 public Boolean ModificarDB(cp_trans_a_generar_x_FormaPago_OP_Info Info)
 {
     try
     {
         Boolean res = false;
         EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();
         var address = context.cp_trans_a_generar_x_FormaPago_OP.FirstOrDefault(var => var.IdTipoTransaccion == Info.IdTipoTransaccion);
         if (address != null)
         {
             address.Descripcion = Info.Descripcion;
             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;
         throw new Exception(ex.ToString());
     }
 }
Beispiel #18
0
 public Boolean ModificarDB(cp_archivos_para_banco_x_cxp_Info info, ref string msg)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_archivos_para_banco_x_cxp.FirstOrDefault(obj => obj.IdEmpresa == info.IdEmpresa && info.IdArchivo == obj.IdArchivo);
             if (contact != null)
             {
                 contact.IdEmpresa       = info.IdEmpresa;
                 contact.IdBanco         = info.IdBanco;
                 contact.Fecha           = info.Fecha;
                 contact.Cod_Empresa     = info.Cod_Empresa;
                 contact.Tipo            = info.Tipo;
                 contact.archivo         = info.archivo;
                 contact.observacion     = info.observacion;
                 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());
     }
 }
Beispiel #19
0
 public Boolean EliminarDB(cp_proveedor_codigo_SRI_Info Info)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_proveedor_codigo_SRI.FirstOrDefault(min => min.IdEmpresa == Info.IdEmpresa && min.IdProveedor == Info.IdProveedor && min.IdCodigo_SRI == Info.IdCodigo_SRI);
             if (contact != null)
             {
                 context.cp_proveedor_codigo_SRI.Remove(contact);
                 context.SaveChanges();
                 context.Dispose();
             }
         }
         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(cp_nota_DebCre_Info info)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_nota_DebCre.FirstOrDefault(minfo => minfo.IdEmpresa == info.IdEmpresa && minfo.IdCbteCble_Nota == info.IdCbteCble_Nota && minfo.IdTipoCbte_Nota == info.IdTipoCbte_Nota);
             if (contact != null)
             {
                 contact.Estado          = "I";
                 contact.cn_observacion  = "**ANULADO** " + contact.cn_observacion;
                 contact.MotivoAnu       = info.MotivoAnu;
                 contact.Fecha_UltAnu    = info.Fecha_UltAnu;
                 contact.IdUsuarioUltAnu = info.IdUsuarioUltAnu;
                 //contact.IdCbteCble_Anulacion = info.IdCbteCble_Anulacion;
                 //contact.IdTipoCbte_Anulacion = info.IdTipoCbte_Anulacion;
                 contact.cn_tipoLocacion = info.cn_tipoLocacion;
                 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 GrabarDB(cp_orden_giro_x_com_ordencompra_local_det_Info info, ref string mensaje)
        {
            try
            {
                using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
                {
                    EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar();

                    var address = new cp_orden_giro_x_com_ordencompra_local_det();

                    address.IdEmpresa_Ogiro  = info.IdEmpresa_Ogiro;
                    address.IdCbteCble_Ogiro = info.IdCbteCble_Ogiro;
                    address.IdTipoCbte_Ogiro = info.IdTipoCbte_Ogiro;
                    address.IdEmpresa_OC     = info.IdEmpresa_OC;
                    address.IdSucursal_OC    = info.IdSucursal_OC;
                    address.IdOrdenCompra    = info.IdOrdenCompra;
                    address.Secuencia_OC     = info.Secuencia_OC;
                    address.Observacion      = info.Observacion == null ? "" : info.Observacion;
                    address.Secuencia_reg    = info.Secuencia_reg;
                    context.cp_orden_giro_x_com_ordencompra_local_det.Add(address);
                    context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
 public Boolean Eliminar_OrdenPagoCancelaciones(cp_orden_pago_cancelaciones_Info Info, ref string mensaje)
 {
     try
     {
         using (EntitiesCuentasxPagar CxP = new EntitiesCuentasxPagar())
         {
             var eliminar = CxP.cp_orden_pago_cancelaciones.FirstOrDefault(v => v.IdEmpresa == Info.IdEmpresa && v.Idcancelacion == Info.Idcancelacion);
             if (eliminar != null)
             {
                 CxP.cp_orden_pago_cancelaciones.Remove(eliminar);
                 CxP.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 EliminarDB(int IdEmpresa, decimal IdCbteCble_Ogiro, int IdTipoCbte_Ogiro)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_orden_giro_x_imp_ordencompra_ext.FirstOrDefault(minfo => minfo.og_IdEmpresa == IdEmpresa && minfo.og_IdCbteCble == IdCbteCble_Ogiro && minfo.og_IdTipoCbte == IdTipoCbte_Ogiro);
             if (contact != null)
             {
                 context.cp_orden_giro_x_imp_ordencompra_ext.Remove(contact);
                 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());
     }
 }
Beispiel #24
0
        public bool Modificar_tipo_flujo(cp_nota_DebCre_Info info_nota)
        {
            try
            {
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    cp_nota_DebCre Entity = Context.cp_nota_DebCre.FirstOrDefault(q => q.IdEmpresa == info_nota.IdEmpresa && q.IdTipoCbte_Nota == info_nota.IdTipoCbte_Nota && q.IdCbteCble_Nota == info_nota.IdCbteCble_Nota);
                    if (Entity != null)
                    {
                        Entity.IdTipoFlujo = info_nota.IdTipoFlujo;
                        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 GrabarDB(cp_orden_giro_x_imp_ordencompra_ext_Info info, ref string mensaje)
        {
            try
            {
                using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
                {
                    EntitiesCuentasxPagar EDB = new EntitiesCuentasxPagar();

                    //var contact = cp_orden_giro_x_imp_ordencompra_ext.Createcp_orden_giro_x_imp_ordencompra_ext(0, 0, 0, 0, 0, 0);
                    var address = new cp_orden_giro_x_imp_ordencompra_ext();

                    address.imp_IdEmpresa        = info.imp_IdEmpresa;
                    address.imp_IdOrdenCompraExt = info.imp_IdOrdenCompraExt;
                    address.imp_IdSucursal       = info.imp_IdSucursal;
                    address.og_IdCbteCble        = info.og_IdCbteCble;
                    address.og_IdEmpresa         = info.og_IdEmpresa;
                    address.og_IdTipoCbte        = info.og_IdTipoCbte;

                    //contact = address;

                    context.cp_orden_giro_x_imp_ordencompra_ext.Add(address);
                    context.SaveChanges();
                }
                return(true);
            }
            catch (Exception ex)
            {
                string arreglo = ToString();
                tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
                tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
                oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
                mensaje = ex.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
Beispiel #26
0
 public Boolean ModificarDB_campos_mov_caj(cp_conciliacion_caja_Info Info, ref string msg)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_conciliacion_Caja.FirstOrDefault(obj => obj.IdEmpresa == Info.IdEmpresa &&
                                                                       obj.IdConciliacion_Caja == Info.IdConciliacion_Caja);
             if (contact != null)
             {
                 contact.IdEmpresa_mov_caj  = Info.IdEmpresa_mov_caj;
                 contact.IdTipoCbte_mov_caj = Info.IdTipoCbte_mov_caj;
                 contact.IdCbteCble_mov_caj = Info.IdCbteCble_mov_caj;
                 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_Forma_Pago(List <cp_orden_pago_det_Info> Info_Detalle)
 {
     try
     {
         foreach (var item in Info_Detalle)
         {
             EntitiesCuentasxPagar context = new EntitiesCuentasxPagar();
             var address = context.cp_orden_pago_det.FirstOrDefault(var => var.IdOrdenPago == item.IdOrdenPago && var.IdEmpresa == item.IdEmpresa && var.Secuencia == item.Secuencia);
             if (address != null)
             {
                 address.IdFormaPago = item.IdFormaPago;
                 address.Fecha_Pago  = item.Fecha_Pago;
                 address.IdBanco     = item.Idbanco == 0 ? null : item.Idbanco;
                 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());
     }
 }
Beispiel #28
0
        public Boolean GuardarDB(cp_Autorizacion_x_Doc_x_Pag_Info Info, ref string msg)
        {
            try
            {
                using (EntitiesCuentasxPagar CxP = new EntitiesCuentasxPagar())
                {
                    var Address = new cp_Autorizacion_x_Doc_x_Pag();

                    Address.Id_Num_Autorizacion = Info.Id_Num_Autorizacion;

                    Address.Serie1                  = Info.Serie1;
                    Address.Serie2                  = Info.Serie2;
                    Address.Valido_Hasta            = Convert.ToDateTime(Info.Valido_Hasta.ToShortDateString());
                    Address.factura_inicial         = Info.factura_inicial;
                    Address.factura_final           = Info.factura_final;
                    Address.NumAutorizacionImprenta = Info.NumAutorizacionImprenta;

                    CxP.cp_Autorizacion_x_Doc_x_Pag.Add(Address);
                    CxP.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 ModificarDB(cp_codigo_SRI_tipo_Info info)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_codigo_SRI_tipo.FirstOrDefault(minfo => minfo.IdTipoSRI == info.IdTipoSRI);
             if (contact != null)
             {
                 contact.descripcion = info.descripcion;
                 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(cp_proveedor_clase_Info info, ref string mensaje)
 {
     try
     {
         using (EntitiesCuentasxPagar context = new EntitiesCuentasxPagar())
         {
             var contact = context.cp_proveedor_clase.FirstOrDefault(var => var.IdEmpresa == info.IdEmpresa && var.IdClaseProveedor == info.IdClaseProveedor);
             if (contact != null)
             {
                 contact.cod_clase_proveedor            = info.cod_clase_proveedor;
                 contact.descripcion_clas_prove         = info.descripcion_clas_prove;
                 contact.IdCtaCble_Anticipo             = info.IdCtaCble_Anticipo;
                 contact.IdCtaCble_gasto                = info.IdCtaCble_gasto;
                 contact.IdCentroCosto                  = info.IdCentroCosto;
                 contact.IdCentroCosto_sub_centro_costo = info.IdCentroCosto_sub_centro_costo;
                 contact.Estado           = info.Estado;
                 contact.MotivoAnu        = info.MotivoAnu;
                 contact.IdUsuarioUltModi = info.IdUsuarioUltModi;
                 contact.FechaUltModi     = info.FechaUltModi;
                 contact.IdCtaCble_CXP    = info.IdCtaCble_CXP;
                 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());
     }
 }