public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } storeID = TranslateUtils.ToInt(GetQueryString("storeID")); if (!string.IsNullOrEmpty(Request.QueryString["Delete"])) { var list = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]); if (list.Count > 0) { try { DataProviderWX.StoreItemDAO.Delete(PublishmentSystemID, list); SuccessMessage("门店信息删除成功!"); } catch (Exception ex) { FailMessage(ex, "门店信息删除失败!"); } } } spContents.ControlToPaginate = rptContents; spContents.ItemsPerPage = 30; spContents.ConnectionString = BaiRongDataProvider.ConnectionString; spContents.SelectCommand = DataProviderWX.StoreItemDAO.GetSelectString(storeID); spContents.SortField = StoreItemAttribute.ID; spContents.SortMode = SortMode.ASC; rptContents.ItemDataBound += new RepeaterItemEventHandler(rptContents_ItemDataBound); if (!IsPostBack) { BreadCrumb(AppManager.WeiXin.LeftMenu.ID_Function, AppManager.WeiXin.LeftMenu.Function.ID_Store, "微门店信息管理", AppManager.WeiXin.Permission.WebSite.Store); spContents.DataBind(); var urlAdd = BackgroundStoreItemAdd.GetRedirectUrl(PublishmentSystemID, storeItemID, storeID); btnAdd.Attributes.Add("onclick", $"location.href='{urlAdd}';return false"); var urlDelete = PageUtils.AddQueryString(GetRedirectUrl(PublishmentSystemID, storeID), "Delete", "True"); btnDelete.Attributes.Add("onclick", JsUtils.GetRedirectStringWithCheckBoxValueAndAlert(urlDelete, "IDCollection", "IDCollection", "请选择需要删除的微门店信息", "此操作将删除所选微门店信息,确认吗?")); btnReturn.Attributes.Add("onclick", $@"location.href=""{BackgroundStore.GetRedirectUrl(PublishmentSystemID)}"";return false"); } }
public void Page_Load(object sender, EventArgs e) { if (IsForbidden) { return; } PageUtils.CheckRequestParameter("PublishmentSystemID"); storeID = TranslateUtils.ToInt(GetQueryString("storeID")); if (!IsPostBack) { var pageTitle = storeID > 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=""370"" align=""middle"" />"; if (storeID > 0) { var storeInfo = DataProviderWX.StoreDAO.GetStoreInfo(storeID); tbKeywords.Text = DataProviderWX.KeywordDAO.GetKeywords(storeInfo.KeywordID); cbIsEnabled.Checked = !storeInfo.IsDisabled; tbTitle.Text = storeInfo.Title; if (!string.IsNullOrEmpty(storeInfo.ImageUrl)) { ltlImageUrl.Text = $@"<img id=""preview_imageUrl"" src=""{PageUtility.ParseNavigationUrl( PublishmentSystemInfo, storeInfo.ImageUrl)}"" width=""370"" align=""middle"" />"; } tbSummary.Text = storeInfo.Summary; imageUrl.Value = storeInfo.ImageUrl; } btnReturn.Attributes.Add("onclick", $@"location.href=""{BackgroundStore.GetRedirectUrl(PublishmentSystemID)}"";return false"); } }