Beispiel #1
0
        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 = PageStoreItem.GetRedirectUrl(PublishmentSystemId, storeInfo.Id);

                ltlStoreContentUrl.Text = $@"<a href=""{urlStoreContent}"">微门店</a>";

                //var urlPreview = StoreManager.GetStoreUrl(PublishmentSystemInfo, storeInfo, string.Empty);
                //urlPreview = BackgroundPreview.GetRedirectUrlToMobile(urlPreview);
                //ltlPreviewUrl.Text = $@"<a href=""{urlPreview}"" target=""_blank"">预览</a>";

                var urlEdit = PageStoreAdd.GetRedirectUrl(PublishmentSystemId, storeInfo.Id);
                ltlEditUrl.Text = $@"<a href=""{urlEdit}"">编辑</a>";
            }
        }
Beispiel #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            if (!string.IsNullOrEmpty(Request.QueryString["Delete"]))
            {
                var list = TranslateUtils.StringCollectionToIntList(Request.QueryString["IDCollection"]);
                if (list.Count > 0)
                {
                    try
                    {
                        DataProviderWx.StoreDao.Delete(PublishmentSystemId, list);
                        SuccessMessage("门店信息删除成功!");
                    }
                    catch (Exception ex)
                    {
                        FailMessage(ex, "门店信息删除失败!");
                    }
                }
            }

            SpContents.ControlToPaginate = RptContents;
            SpContents.ItemsPerPage      = 30;

            SpContents.SelectCommand   = DataProviderWx.StoreDao.GetSelectString(PublishmentSystemId);
            SpContents.SortField       = StoreAttribute.Id;
            SpContents.SortMode        = SortMode.ASC;
            RptContents.ItemDataBound += rptContents_ItemDataBound;

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.WeiXin.LeftMenu.IdFunction, AppManager.WeiXin.LeftMenu.Function.IdStore, "门店管理", AppManager.WeiXin.Permission.WebSite.Store);
                SpContents.DataBind();

                var urlAdd = PageStoreAdd.GetRedirectUrl(PublishmentSystemId, 0);
                BtnAdd.Attributes.Add("onclick", $"location.href='{urlAdd}';return false");

                var urlDelete = PageUtils.AddQueryString(GetRedirectUrl(PublishmentSystemId), "Delete", "True");
                BtnDelete.Attributes.Add("onclick", PageUtils.GetRedirectStringWithCheckBoxValueAndAlert(urlDelete, "IDCollection", "IDCollection", "请选择需要删除的门店信息", "此操作将删除所选门店信息,确认吗?"));
            }
        }