Example #1
0
        private static Boolean pollingSeller(string connString, string name, ChromeDriver driver, CategoryInfo category, String url, Boolean isTopSeller)
        {
            Boolean success = false;

            Utilities.Utilities.Log(message: $"[{name}] : ", isWriteLine: false, addTime: true);
            driver.Navigate().GoToUrl(url);
            IReadOnlyCollection <IWebElement> elements = driver.FindElements(By.XPath("//div[@class='a-row a-spacing-none s-see-all-c3-refinement s-see-all-refinement-list']/ul/li/span/a"));

            if (elements != null && elements.Count > 0)
            {
                Utilities.Utilities.Log(message: $"[{elements.Count}]", isWriteLine: true, addTime: false);
                Int32 count = 0;
                Utilities.Utilities.Log(message: $"[{category.Name}] [{elements.Count}] -> ", isWriteLine: false, addTime: true);
                foreach (IWebElement ele in elements)
                {
                    SellerInfo seller = new SellerInfo(category, ele, isTopSeller);
                    if (success = !seller.HasError)
                    {
                        seller.Id = DataOperation.UpdateSeller(connString, seller);
                        if (success = seller.Id > 0)
                        {
                            ++count;
                        }
                    }
                    Utilities.Utilities.Log(message: success ? $"." : $"X", isWriteLine: false, addTime: false);
                }
                Utilities.Utilities.Log(message: $"[{count}] [Done]", isWriteLine: true, addTime: false);
            }
            return(success);
        }
Example #2
0
        internal static int UpdateSeller(string connString, SellerInfo seller)
        {
            DataTable           dataTable       = SQLExtension.GetDataTableFromStoredProcedure(connString: connString, storedProcedureName: "[qwi].[AZ.UpdateSeller]", parameters: seller.SQLParameters);
            SQLResultStatusInfo sqlResultStatus = dataTable.SerializeFirst <SQLResultStatusInfo>();

            return(sqlResultStatus.Id);
        }