public belIde xmlBuscaIde()
        {
            XmlDocument xIde = new XmlDocument();
            belIde objIde = new belIde();

            try
            {
                xIde.LoadXml(xDoc.GetElementsByTagName("ide")[0].OuterXml);


                objIde.Cuf = xIde.GetElementsByTagName("cUF")[0].InnerText;
                objIde.Mod = xIde.GetElementsByTagName("mod")[0].InnerText;
                objIde.Serie = xIde.GetElementsByTagName("serie")[0].InnerText;
                objIde.Nnf = xIde.GetElementsByTagName("nNF")[0].InnerText;
                objIde.Demi = Convert.ToDateTime(xIde.GetElementsByTagName("dEmi")[0].InnerText);
                objIde.Dsaient = Convert.ToDateTime(xIde.GetElementsByTagName("dSaiEnt")[0].InnerText);

            }
            catch (Exception ex)
            {

                throw new Exception(string.Format("Problemas lendo a Tag IDE, Erro.: {0}",
                                                  ex.Message));
            }

            return objIde;
        }
Exemple #2
0
        public belIde xmlBuscaIde()
        {
            XmlDocument xIde   = new XmlDocument();
            belIde      objIde = new belIde();

            try
            {
                xIde.LoadXml(xDoc.GetElementsByTagName("ide")[0].OuterXml);


                objIde.Cuf     = xIde.GetElementsByTagName("cUF")[0].InnerText;
                objIde.Mod     = xIde.GetElementsByTagName("mod")[0].InnerText;
                objIde.Serie   = xIde.GetElementsByTagName("serie")[0].InnerText;
                objIde.Nnf     = xIde.GetElementsByTagName("nNF")[0].InnerText;
                objIde.Demi    = Convert.ToDateTime(xIde.GetElementsByTagName("dEmi")[0].InnerText);
                objIde.Dsaient = Convert.ToDateTime(xIde.GetElementsByTagName("dSaiEnt")[0].InnerText);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Problemas lendo a Tag IDE, Erro.: {0}",
                                                  ex.Message));
            }

            return(objIde);
        }