void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { var storeInfo = new StoreInfo(e.Item.DataItem); var ltlItemIndex = e.Item.FindControl("ltlItemIndex") as Literal; var ltlTitle = e.Item.FindControl("ltlTitle") as Literal; var ltlKeywords = e.Item.FindControl("ltlKeywords") as Literal; var ltlPVCount = e.Item.FindControl("ltlPVCount") as Literal; var ltlIsEnabled = e.Item.FindControl("ltlIsEnabled") as Literal; var ltlStoreContentUrl = e.Item.FindControl("ltlStoreContentUrl") as Literal; var ltlPreviewUrl = e.Item.FindControl("ltlPreviewUrl") as Literal; var ltlEditUrl = e.Item.FindControl("ltlEditUrl") as Literal; ltlItemIndex.Text = (e.Item.ItemIndex + 1).ToString(); ltlTitle.Text = storeInfo.Title; ltlKeywords.Text = DataProviderWX.KeywordDAO.GetKeywords(storeInfo.KeywordID); ltlPVCount.Text = storeInfo.PVCount.ToString(); ltlIsEnabled.Text = StringUtils.GetTrueOrFalseImageHtml(!storeInfo.IsDisabled); var urlStoreContent = BackgroundStoreItem.GetRedirectUrl(PublishmentSystemID, storeInfo.ID); ltlStoreContentUrl.Text = $@"<a href=""{urlStoreContent}"">微门店</a>"; var urlPreview = StoreManager.GetStoreUrl(storeInfo, string.Empty); urlPreview = BackgroundPreview.GetRedirectUrlToMobile(urlPreview); ltlPreviewUrl.Text = $@"<a href=""{urlPreview}"" target=""_blank"">预览</a>"; var urlEdit = BackgroundStoreAdd.GetRedirectUrl(PublishmentSystemID, storeInfo.ID); ltlEditUrl.Text = $@"<a href=""{urlEdit}"">编辑</a>"; } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID"); storeID = TranslateUtils.ToInt(GetQueryString("storeID")); storeItemID = TranslateUtils.ToInt(GetQueryString("storeItemID")); if (!IsPostBack) { var pageTitle = storeItemID > 0 ? "编辑微门店信息" : "添加微门店信息"; BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Store, pageTitle, AppManager.WeiXin.Permission.WebSite.Store); ltlPageTitle.Text = pageTitle; ltlImageUrl.Text = $@"<img id=""preview_imageUrl"" src=""{StoreManager.GetImageUrl(PublishmentSystemInfo, string.Empty)}"" width=""200"" height=""200"" align=""middle"" />"; ddlStoreCategoryName.Items.Add(new ListItem("<请选择>", "0")); var categoryIDList = DataProviderWX.StoreCategoryDAO.GetAllCategoryIDList(PublishmentSystemID); var count = categoryIDList.Count; if (count > 0) { isLastNodeArray = new bool[count]; foreach (var theCategoryID in categoryIDList) { var categoryInfo = DataProviderWX.StoreCategoryDAO.GetCategoryInfo(theCategoryID); var listitem = new ListItem(GetTitle(categoryInfo.ID, categoryInfo.CategoryName, categoryInfo.ParentsCount, categoryInfo.IsLastNode), theCategoryID.ToString()); ddlStoreCategoryName.Items.Add(listitem); } } if (storeItemID > 0) { var storeItemInfo = DataProviderWX.StoreItemDAO.GetStoreItemInfo(storeItemID); tbStoreName.Text = storeItemInfo.StoreName; tbStoreTel.Text = storeItemInfo.Tel; tbStoreMobile.Text = storeItemInfo.Mobile; tbStoreAddress.Text = storeItemInfo.Address; txtLatitude.Value = storeItemInfo.Latitude; txtLongitude.Value = storeItemInfo.Longitude; tbSummary.Text = storeItemInfo.Summary; if (storeItemInfo.CategoryID > 0) { ddlStoreCategoryName.Items.FindByValue("" + storeItemInfo.CategoryID + "").Selected = true; } if (!string.IsNullOrEmpty(storeItemInfo.ImageUrl)) { ltlImageUrl.Text = $@"<img id=""preview_storeImageUrl"" src=""{PageUtility.ParseNavigationUrl( PublishmentSystemInfo, storeItemInfo.ImageUrl)}"" width=""370"" align=""middle"" />"; } imageUrl.Value = storeItemInfo.ImageUrl; storeID = storeItemInfo.StoreID; } btnReturn.Attributes.Add("onclick", $@"location.href=""{BackgroundStoreItem.GetRedirectUrl(PublishmentSystemID, storeID)}"";return false"); } }