Ejemplo n.º 1
0
        /// <summary>
        /// Read voyger bill XML file and process it
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public static int ReadVoyBillXML(string fileName)
        {
            //When file name is null or empty
            if (fileName == null || fileName == "")
            {
                return(-1);
            }

            int count = 0;

            ws = File.AppendText(fileName + "_2.txt");     //TODO: remove it
            ws.WriteLine("xml:{0}: doing ops:", fileName); //TODO: remove it
            vBill  = new VBill();
            reader = new XmlTextReader(fileName);
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.Element)
                {
                    ReadElement();
                    count++;
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    ReadEndElement();
                }
            }
            WriteToText(fileName + ".txt");
            ws.Flush();
            ws.Close();
            return(count);
        }
Ejemplo n.º 2
0
 public void ToTable(VBill bill)
 {
 }