示例#1
0
        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");
            }
        }
示例#2
0
        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");
            }
        }