public override void Bolter(FileInfo f, TypeFileComplaintRes typefile)
        {
            if (!f.Name.ToLower().EndsWith(".xml", StringComparison.Ordinal))
            {
                return;
            }

            try
            {
                ParsingXml(f, typefile);
            }
            catch (Exception e)
            {
                Log.Logger("Ошибка при парсинге xml", e, f);
            }
        }
        public void ParsingXml(FileInfo f, TypeFileComplaintRes typefile)
        {
            using (StreamReader sr = new StreamReader(f.ToString(), Encoding.Default))
            {
                var ftext = sr.ReadToEnd();
                ftext = ClearText.ClearString(ftext);
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(ftext);
                string  jsons = JsonConvert.SerializeXmlNode(doc);
                JObject json  = JObject.Parse(jsons);
                switch (typefile)
                {
                case TypeFileComplaintRes.ComplaintRes:
                    ComplaintRes44 a = new ComplaintRes44(f, json);
                    a.Parsing();
                    break;

                case TypeFileComplaintRes.CancelRes:
                    ComplaintCancelRes b = new ComplaintCancelRes(f, json);
                    b.Parsing();
                    break;
                }
            }
        }
Ejemplo n.º 3
0
 public virtual void Bolter(FileInfo f, TypeFileComplaintRes typefile)
 {
 }