public List <cp_orden_giro_pagos_sri_Info> Get_List_orden_giro_pagos_sri()
 {
     try
     {
         List <cp_orden_giro_pagos_sri_Info> Lst = new List <cp_orden_giro_pagos_sri_Info>();
         EntitiesCuentasxPagar oEnti             = new EntitiesCuentasxPagar();
         var Query = from q in oEnti.cp_orden_giro_pagos_sri
                     select q;
         foreach (var item in Query)
         {
             cp_orden_giro_pagos_sri_Info Obj = new cp_orden_giro_pagos_sri_Info();
             Obj.IdEmpresa        = item.IdEmpresa;
             Obj.IdCbteCble_Ogiro = item.IdCbteCble_Ogiro;
             Obj.IdTipoCbte_Ogiro = item.IdTipoCbte_Ogiro;
             Obj.codigo_pago_sri  = item.codigo_pago_sri;
             Obj.formas_pago_sri  = item.formas_pago_sri;
             Lst.Add(Obj);
         }
         return(Lst);
     }
     catch (Exception ex)
     {
         string arreglo = ToString();
         tb_sis_Log_Error_Vzen_Data oDataLog      = new tb_sis_Log_Error_Vzen_Data();
         tb_sis_Log_Error_Vzen_Info Log_Error_sis = new tb_sis_Log_Error_Vzen_Info(ex.ToString(), "", arreglo, "", "", "", "", "", DateTime.Now);
         oDataLog.Guardar_Log_Error(Log_Error_sis, ref mensaje);
         mensaje = ex.ToString() + " " + ex.Message;
         throw new Exception(ex.ToString());
     }
 }
        public Boolean GuardarDB(cp_orden_giro_pagos_sri_Info Info)
        {
            try
            {
                List <cp_orden_giro_pagos_sri_Info> Lst = new List <cp_orden_giro_pagos_sri_Info>();
                using (EntitiesCuentasxPagar Context = new EntitiesCuentasxPagar())
                {
                    var Address = new cp_orden_giro_pagos_sri();
                    Address.IdEmpresa        = Convert.ToInt32(Info.IdEmpresa);
                    Address.IdCbteCble_Ogiro = Convert.ToDecimal(Info.IdCbteCble_Ogiro);
                    Address.IdTipoCbte_Ogiro = Convert.ToInt32(Info.IdTipoCbte_Ogiro);
                    Address.codigo_pago_sri  = Info.codigo_pago_sri;
                    Address.formas_pago_sri  = Info.formas_pago_sri;

                    Context.cp_orden_giro_pagos_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.ToString() + " " + ex.Message;
                throw new Exception(ex.ToString());
            }
        }
        public bool GuardarDB(cp_orden_giro_pagos_sri_Info Info)
        {
            try
            {
                using (Entities_cuentas_por_pagar Context = new Entities_cuentas_por_pagar())
                {
                    cp_orden_giro_pagos_sri Entity = new cp_orden_giro_pagos_sri
                    {
                        IdEmpresa        = Info.IdEmpresa,
                        IdTipoCbte_Ogiro = Info.IdTipoCbte_Ogiro,
                        IdCbteCble_Ogiro = Info.IdCbteCble_Ogiro,
                        codigo_pago_sri  = Info.codigo_pago_sri,
                        formas_pago_sri  = Info.formas_pago_sri,
                    };
                    Context.cp_orden_giro_pagos_sri.Add(Entity);
                    Context.SaveChanges();
                }

                return(true);
            }
            catch (Exception)
            {
                throw;
            }
        }
        public cp_orden_giro_pagos_sri_Info get_info(int IdEmpresa, int IdTipoCbte_Ogiro, decimal IdCbteCble_Ogiro)
        {
            try
            {
                cp_orden_giro_pagos_sri_Info info;

                using (Entities_cuentas_por_pagar Context = new Entities_cuentas_por_pagar())
                {
                    cp_orden_giro_pagos_sri Entity = Context.cp_orden_giro_pagos_sri.FirstOrDefault(q => q.IdEmpresa == IdEmpresa &&
                                                                                                    q.IdTipoCbte_Ogiro == IdTipoCbte_Ogiro &&
                                                                                                    q.IdCbteCble_Ogiro == IdCbteCble_Ogiro);
                    if (Entity == null)
                    {
                        return(null);
                    }
                    else
                    {
                        info = new cp_orden_giro_pagos_sri_Info
                        {
                            IdEmpresa        = Entity.IdEmpresa,
                            IdTipoCbte_Ogiro = Entity.IdTipoCbte_Ogiro,
                            IdCbteCble_Ogiro = Entity.IdCbteCble_Ogiro,
                            codigo_pago_sri  = Entity.codigo_pago_sri,
                            formas_pago_sri  = Entity.formas_pago_sri
                        }
                    };
                }

                return(info);
            }
            catch (Exception)
            {
                throw;
            }
        }
 public bool GuardarDB(cp_orden_giro_pagos_sri_Info Info)
 {
     try
     {
         return(data.GuardarDB(Info));
     }
     catch (Exception)
     {
         throw;
     }
 }
 public Boolean GuardarDB(cp_orden_giro_pagos_sri_Info Info)
 {
     try
     {
         return(data.GuardarDB(Info));
     }
     catch (Exception ex)
     {
         Core.Erp.Info.Log_Exception.LoggingManager.Logger.Log(Core.Erp.Info.Log_Exception.LoggingCategory.Error, ex.Message);
         throw new Core.Erp.Info.Log_Exception.DalException(string.Format("", "GuardarDB", ex.Message), ex)
               {
                   EntityType = typeof(cp_orden_giro_pagos_sri_Bus)
               };
     }
 }