Esempio n. 1
0
        // Pendiente propiedades para validación de complemento de pagos.

        public static List <FormaPago> GetFormasDePagoList()
        {
            List <FormaPago> list = new List <FormaPago>();

            try
            {
                RepoBox.SAT.Conexion sql = new RepoBox.SAT.Conexion();
                string respuesta         = sql.ExecuteToXML("GetFormasDePagoList");
                if (respuesta == "")
                {
                    return(list);
                }
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(respuesta);
                foreach (XmlNode node in doc.DocumentElement.ChildNodes)
                {
                    list.Add(new FormaPago()
                    {
                        ID = node.Attributes["ID"].Value, Descripcion = node.Attributes["Descripcion"].Value
                    });
                }
                return(list);
            }
            catch (Exception)
            {
                return(new List <FormaPago>());
            }
        }
Esempio n. 2
0
        public static List <UsoCFDI> GetUsosCFDI()
        {
            List <UsoCFDI> list = new List <UsoCFDI>();

            try
            {
                RepoBox.SAT.Conexion sql = new RepoBox.SAT.Conexion();
                string respuesta         = sql.ExecuteToXML("GetUsosCFDI");
                if (respuesta == "")
                {
                    return(list);
                }
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(respuesta);
                foreach (XmlNode node in doc.DocumentElement.ChildNodes)
                {
                    list.Add(new UsoCFDI()
                    {
                        ID = node.Attributes["ID"].Value, Descripcion = node.Attributes["Descripcion"].Value, TipoContribuyentePermitido = int.Parse(node.Attributes["TipoContribuyentePermitido"].Value)
                    });
                }
                return(list);
            }
            catch (Exception)
            {
                return(new List <UsoCFDI>());
            }
        }
Esempio n. 3
0
        public static List <RegimenFiscal> GetRegimenesFiscales()
        {
            List <RegimenFiscal> list = new List <RegimenFiscal>();

            try
            {
                RepoBox.SAT.Conexion sql = new RepoBox.SAT.Conexion();
                string respuesta         = sql.ExecuteToXML("Get_RegimenesFiscales");
                if (respuesta == "")
                {
                    return(list);
                }
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(respuesta);
                foreach (XmlNode node in doc.DocumentElement.ChildNodes)
                {
                    list.Add(new RegimenFiscal()
                    {
                        ID = int.Parse(node.Attributes["ID"].Value), Descripcion = node.Attributes["Descripcion"].Value, PersonaFisical = (node.Attributes["PersonaFisica"].Value == "1")
                    });
                }
                return(list);
            }
            catch (Exception)
            {
                return(new List <RegimenFiscal>());
            }
        }
Esempio n. 4
0
        public static List <Moneda> GetMonedasList()
        {
            List <Moneda> list = new List <Moneda>();

            try
            {
                RepoBox.SAT.Conexion sql = new RepoBox.SAT.Conexion();
                string respuesta         = sql.ExecuteToXML("GetMonedasList");
                if (respuesta == "")
                {
                    return(list);
                }
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(respuesta);
                foreach (XmlNode node in doc.DocumentElement.ChildNodes)
                {
                    list.Add(new Moneda()
                    {
                        ID = node.Attributes["ID"].Value, Descripcion = node.Attributes["Descripcion"].Value, Decimales = Convert.ToInt32(node.Attributes["Decimales"].Value)
                    });
                }
                return(list);
            }
            catch (Exception)
            {
                return(new List <Moneda>());
            }
        }
Esempio n. 5
0
 public ClaveUnidad GetClaveUnidad(string clave)
 {
     try
     {
         RepoBox.SAT.Conexion sql = new RepoBox.SAT.Conexion();
         string respuesta         = sql.ExecuteToXML("GetDescripcion_SAT_Unidad @Clave = '" + clave + "'");
         if (respuesta == "")
         {
             return new ClaveUnidad()
                    {
                        Clave = clave
                    }
         }
         ;
         XmlDocument doc = new XmlDocument();
         doc.LoadXml(respuesta);
         foreach (XmlNode node in doc.DocumentElement.ChildNodes)
         {
             return new ClaveUnidad()
                    {
                        Clave = node.Attributes["Clave"].Value, Descripcion = node.Attributes["Descripcion"].Value
                    }
         }
         ;
         return(new ClaveUnidad()
         {
             Clave = clave
         });
     }
     catch (Exception)
     {
         return(new ClaveUnidad()
         {
             Clave = clave
         });
     }
 }