private async void WorkUpdatePrice() { List <OfferOrder> offerOrders = sqlCommandTools.GetOfferOrders(); for (int i = 0; i < offerOrders.Count; i++) { try { if (sqlCommandTools.CheckPrice(offerOrders[i].Id)) { PriceOffer priceOffer = new PriceOffer(); priceOffer.DatateUpdate = DateTime.Now.ToString(); Offer offer = connectorEPN.GetOffer(offerOrders[i].Id); priceOffer.Price = offer.price; sqlCommandTools.AddPrice(offer.id, priceOffer); } } catch (Exception e) { File.AppendAllText("log/WorkUpdatePrice.txt", $"{e.Message} {Environment.NewLine}"); } } }
private async void WorkShopNew() { List <OfferOrder> offerOrders = sqlCommandTools.GetOfferOrders1(); for (int i = 0; i < offerOrders.Count; i++) { try { if (offerOrders[i].Name == "New") { Offer offer = connectorEPN.GetOffer(offerOrders[i].Id); offerOrders[i].Description = offer.description; offerOrders[i].Id_category = offer.id_category; offerOrders[i].Name = offer.name; offerOrders[i].Store_id = offer.store_id; sqlCommandTools.UpdateShiping(offerOrders[i]); } } catch (Exception e) { File.AppendAllText("log/WorkUpdatePrice.txt", $"{e.Message} {Environment.NewLine}"); } } }