private void SetCatalogueListBox() { //file = new OpenFileDialog(); Action<StoreInfo> changceText = (Maticsoft.Model.StoreInfo storeInfo) => { txtStoreAddress.Text = storeInfo.StoreAddress; txtStoreHours.Text = string.IsNullOrWhiteSpace(storeInfo.StoreHours) ? "10:00-22:00" : storeInfo.StoreHours; txtBasic.Text = storeInfo.BasicIntroduction; txtFacilities.Text = storeInfo.Facilities; txtStoreName.Text = storeInfo.StoreName; txtStorePhone.Text = storeInfo.StorePhone; chbbox.Checked = storeInfo.box; txtBus.Text = storeInfo.bus; txtCarPark.Text = storeInfo.carPark; txtSubway.Text = storeInfo.subway; chbPayCar.Checked = storeInfo.payCar; txtStoreTag.Text = storeInfo.StoreTag; txtMaxPrice.Text = storeInfo.MaxPrice.ToString(); txtMinPrice.Text = storeInfo.MinPrice.ToString(); txtImageName.Text = storeInfo.picName.Trim(); txtDoubleName.Text = string.Empty; chbPic.Checked = false; chbDish.Checked = false; chbbox.Checked = false; chbPayCar.Checked = false; chbChildrenChair.Checked = false; chbCarPark.Checked = false; chbWIFI.Checked = false; chbNoSmoke.Checked = false; chbKCVIP.Checked = false; chbIsCoupon.Checked = false; chbIsSend.Checked = false; chbOnlineorder.Checked = false; chbIsCitySend.Checked = false; chbCod.Checked = false; chbOnlinePay.Checked = false; }; if (catalogueListBox.SelectedIndex < 0) { return; } var catalogueInfo = catalogueListBox.SelectedItem as Maticsoft.Model.Catalogue; if (catalogueInfo == null) { return; } var taskGetcatalogueList = new Action<Catalogue>((x) => { var storeLogic = new CollectionLogic.StoreLogic(cbbSiteType.SelectedItem.ToString()); storeLogic.PageUrl = x.href; var storeInfo = storeLogic.GetStoreInfo(x); if (storeInfo != null && !storeInfo.IsNull) { storeInfoList.Add(storeInfo); Invoke(changceText, storeInfo); } else { Invoke(new Action(() => MessageBox.Show("网络异常"))); } }); Invoke(taskGetcatalogueList, catalogueInfo); }
private void SetCatalogueListBox() { //file = new OpenFileDialog(); Action<StoreInfo> changceText = (Maticsoft.Model.StoreInfo storeInfo) => { txtStoreAddress.Text = storeInfo.StoreAddress; txtStoreHours.Text = storeInfo.StoreHours; txtBasic.Text = storeInfo.BasicIntroduction; txtFacilities.Text = storeInfo.Facilities; txtStoreName.Text = storeInfo.StoreName; txtStorePhone.Text = storeInfo.StorePhone; chbbox.Checked = storeInfo.box; txtBus.Text = storeInfo.bus; txtCarPark.Text = storeInfo.carPark; txtSubway.Text = storeInfo.subway; chbPayCar.Checked = storeInfo.payCar; txtStoreTag.Text = storeInfo.StoreTag; txtMaxPrice.Text = storeInfo.MaxPrice.ToString(); txtMinPrice.Text = storeInfo.MinPrice.ToString(); txtImageName.Text = storeInfo.picName.Trim(); txtDoubleName.Text = string.Empty; chbPic.Checked = false; chbDish.Checked = false; }; if (catalogueListBox.SelectedIndex < 0) { return; } var catalogueInfo = catalogueListBox.SelectedItem as Maticsoft.Model.Catalogue; if (catalogueInfo == null) { return; } var taskGetcatalogueList = new Action<Catalogue>((x) => { var storeLogic = new CollectionLogic.StoreLogic("Cyooy"); storeLogic.PageUrl = x.href; var storeInfo = storeLogic.GetStoreInfo(x); if (storeInfo == null) { return; } storeInfoList.Add(storeInfo); this.Invoke(changceText, storeInfo); }); this.Invoke(taskGetcatalogueList, catalogueInfo); }