Exemple #1
0
        private string ParseXPathPromotionInfo(HtmlDocument doc, Configuration configXPath)
        {
            string strResult = "";

            try
            {
                foreach (string PromotionInfoXPath in configXPath.PromotionInfoXPath)
                {
                    if (PromotionInfoXPath.Trim() != "")
                    {
                        var node_VAT = doc.DocumentNode.SelectSingleNode(PromotionInfoXPath);
                        if (node_VAT != null)
                        {
                            string tempPromotion = GABIZ.Base.Tools.removeHTML(node_VAT.InnerText);
                            if (Common.ParsePromotionInfo(tempPromotion) != -1)
                            {
                                strResult = (string.IsNullOrEmpty(strResult) ? "" : " ") + tempPromotion;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(strResult);
        }
Exemple #2
0
        private string ParsePromotionInfo(GABIZ.Base.HtmlAgilityPack.HtmlDocument doc, List <string> PromotionInfoXPaths)
        {
            var promotionInfo = "";

            foreach (string PromotionInfoXPath in PromotionInfoXPaths)
            {
                if (PromotionInfoXPath.Trim() != "")
                {
                    var node_VAT = doc.DocumentNode.SelectSingleNode(PromotionInfoXPath);
                    if (node_VAT != null)
                    {
                        string tempPromotion = Tools.removeHTML(node_VAT.InnerText);
                        if (Common.ParsePromotionInfo(tempPromotion) != -1)
                        {
                            promotionInfo =
                                Common.RemoveDumplicateSpace((string.IsNullOrEmpty(promotionInfo) ? "" : " ") +
                                                             tempPromotion);
                        }
                    }
                }
            }
            return(promotionInfo);
        }