Exemplo n.º 1
0
        private async void WorkParseAndAddDBShope()
        {
            List <OfferOrder> offerOrders = sqlCommandTools.GetOfferOrders();

            foreach (OfferOrder offerOrder in offerOrders)
            {
                try
                {
                    if (offerOrder.Store_id == 2062084 && offerOrder.Store_id == 2221046)
                    {
                    }
                    Store store = GetReityngs(offerOrder.Store_id);
                    if (store != null)
                    {
                        if (sqlCommandTools.CheckShope(offerOrder.Store_id))
                        {
                            if (sqlCommandTools.CheckUpdateShope(offerOrder.Store_id))
                            {
                                store.IDShope = offerOrder.Store_id;
                                sqlCommandTools.UpdateStore(store);
                            }
                        }
                        else
                        {
                            store.IDShope = offerOrder.Store_id;
                            sqlCommandTools.AddStore(store);
                        }
                    }
                }
                catch (Exception e)
                {
                    File.AppendAllText("log/WorkParseAndAddDBShope.txt", $"{e.Message}, Order {offerOrder.Id}, Order {offerOrder.Store_id} {Environment.NewLine}");
                }
            }
        }
Exemplo n.º 2
0
        private async Task <Store> GetStore(string idShope)
        {
            Store store = null;

            if (sqlCommandTools.CheckShope(Convert.ToInt32(idShope)))
            {
                store = sqlCommandTools.GetOneStore(idShope);
            }
            return(store);
        }