Пример #1
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("siteId");

            if (IsPostBack)
            {
                return;
            }

            VerifySitePermissions(ConfigManager.WebSitePermissions.Configration);

            EBooleanUtils.AddListItems(DdlIsWaterMark);
            ControlUtils.SelectSingleItemIgnoreCase(DdlIsWaterMark, SiteInfo.Additional.IsWaterMark.ToString());

            LoadWaterMarkPosition(SiteInfo.Additional.WaterMarkPosition);

            for (var i = 1; i <= 10; i++)
            {
                DdlWaterMarkTransparency.Items.Add(new ListItem(i + "0%", i.ToString()));
            }
            ControlUtils.SelectSingleItemIgnoreCase(DdlWaterMarkTransparency, SiteInfo.Additional.WaterMarkTransparency.ToString());

            TbWaterMarkMinWidth.Text  = SiteInfo.Additional.WaterMarkMinWidth.ToString();
            TbWaterMarkMinHeight.Text = SiteInfo.Additional.WaterMarkMinHeight.ToString();

            EBooleanUtils.AddListItems(DdlIsImageWaterMark, "图片型", "文字型");
            ControlUtils.SelectSingleItemIgnoreCase(DdlIsImageWaterMark, SiteInfo.Additional.IsImageWaterMark.ToString());

            TbWaterMarkFormatString.Text = SiteInfo.Additional.WaterMarkFormatString;

            LoadSystemFont();
            ControlUtils.SelectSingleItemIgnoreCase(DdlWaterMarkFontName, SiteInfo.Additional.WaterMarkFontName);

            TbWaterMarkFontSize.Text = SiteInfo.Additional.WaterMarkFontSize.ToString();

            TbWaterMarkImagePath.Text = SiteInfo.Additional.WaterMarkImagePath;

            DdlIsWaterMark_SelectedIndexChanged(null, null);
            TbWaterMarkImagePath.Attributes.Add("onchange", GetShowImageScript("preview_WaterMarkImagePath", SiteInfo.Additional.WebUrl));

            var showPopWinString = ModalSelectImage.GetOpenWindowString(SiteInfo, TbWaterMarkImagePath.ClientID);

            BtnImageUrlSelect.Attributes.Add("onclick", showPopWinString);

            showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(SiteId, TbWaterMarkImagePath.ClientID);
            BtnImageUrlUpload.Attributes.Add("onclick", showPopWinString);
        }
Пример #2
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");

            if (!IsPostBack)
            {
                BreadCrumb(AppManager.Cms.LeftMenu.IdConfigration, "图片水印设置", AppManager.Cms.Permission.WebSite.Configration);

                EBooleanUtils.AddListItems(IsWaterMark);
                ControlUtils.SelectListItemsIgnoreCase(IsWaterMark, PublishmentSystemInfo.Additional.IsWaterMark.ToString());

                LoadWaterMarkPosition(PublishmentSystemInfo.Additional.WaterMarkPosition);

                for (var i = 1; i <= 10; i++)
                {
                    WaterMarkTransparency.Items.Add(new ListItem(i + "0%", i.ToString()));
                }
                ControlUtils.SelectListItemsIgnoreCase(WaterMarkTransparency, PublishmentSystemInfo.Additional.WaterMarkTransparency.ToString());

                WaterMarkMinWidth.Text  = PublishmentSystemInfo.Additional.WaterMarkMinWidth.ToString();
                WaterMarkMinHeight.Text = PublishmentSystemInfo.Additional.WaterMarkMinHeight.ToString();

                EBooleanUtils.AddListItems(IsImageWaterMark, "图片型", "文字型");
                ControlUtils.SelectListItemsIgnoreCase(IsImageWaterMark, PublishmentSystemInfo.Additional.IsImageWaterMark.ToString());

                WaterMarkFormatString.Text = PublishmentSystemInfo.Additional.WaterMarkFormatString;

                LoadSystemFont();
                ControlUtils.SelectListItemsIgnoreCase(WaterMarkFontName, PublishmentSystemInfo.Additional.WaterMarkFontName);

                WaterMarkFontSize.Text = PublishmentSystemInfo.Additional.WaterMarkFontSize.ToString();

                WaterMarkImagePath.Text = PublishmentSystemInfo.Additional.WaterMarkImagePath;

                IsWaterMark_SelectedIndexChanged(null, null);
                WaterMarkImagePath.Attributes.Add("onchange", GetShowImageScript("preview_WaterMarkImagePath", PublishmentSystemInfo.PublishmentSystemUrl));

                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, WaterMarkImagePath.ClientID);
                ImageUrlSelect.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, WaterMarkImagePath.ClientID);
                ImageUrlUpload.Attributes.Add("onclick", showPopWinString);
            }
        }
Пример #3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID");
            if (Body.IsQueryExists("AdvertisementName"))
            {
                isEdit = true;
                editAdvertisementName = Body.GetQueryString("AdvertisementName");
                if (DataProvider.AdvertisementDao.IsExists(editAdvertisementName, PublishmentSystemId))
                {
                    editAdvertisementType = DataProvider.AdvertisementDao.GetAdvertisementType(editAdvertisementName, PublishmentSystemId);
                }
                else
                {
                    ErrorLabel.Text = $"不存在名称为“{editAdvertisementName}”的广告!";
                    SetActivePanel(WizardPanel.OperatingError, OperatingError);
                    return;
                }
            }

            if (!Page.IsPostBack)
            {
                var pageTitle = isEdit ? "编辑漂浮广告" : "添加漂浮广告";
                BreadCrumb(AppManager.Cms.LeftMenu.IdFunction, AppManager.Cms.LeftMenu.Function.IdAdvertisement, pageTitle, AppManager.Cms.Permission.WebSite.Advertisement);

                ltlPageTitle.Text = pageTitle;

                StartDate.Text = DateUtils.GetDateAndTimeString(DateTime.Now);
                EndDate.Text   = DateUtils.GetDateAndTimeString(DateTime.Now.AddMonths(1));

                EAdvertisementTypeUtils.AddListItems(AdvertisementType);
                ControlUtils.SelectListItems(AdvertisementType, EAdvertisementTypeUtils.GetValue(EAdvertisementType.FloatImage));

                var nodeIdList = DataProvider.NodeDao.GetNodeIdListByPublishmentSystemId(PublishmentSystemId);
                var nodeCount  = nodeIdList.Count;
                isLastNodeArray = new bool[nodeCount];
                foreach (int theNodeID in nodeIdList)
                {
                    var nodeInfo = NodeManager.GetNodeInfo(PublishmentSystemId, theNodeID);

                    var title    = WebUtils.GetChannelListBoxTitle(PublishmentSystemId, nodeInfo.NodeId, nodeInfo.NodeName, nodeInfo.NodeType, nodeInfo.ParentsCount, nodeInfo.IsLastNode, isLastNodeArray);
                    var listitem = new ListItem(title, nodeInfo.NodeId.ToString());
                    NodeIDCollectionToChannel.Items.Add(listitem);
                    title = title + $"({nodeInfo.ContentNum})";
                    var listitem2 = new ListItem(title, nodeInfo.NodeId.ToString());
                    NodeIDCollectionToContent.Items.Add(listitem2);
                }

                var fileTemplateInfoList = DataProvider.TemplateDao.GetTemplateInfoListByType(PublishmentSystemId, ETemplateType.FileTemplate);
                if (fileTemplateInfoList.Count > 0)
                {
                    foreach (var fileTemplateInfo in fileTemplateInfoList)
                    {
                        var listitem = new ListItem(fileTemplateInfo.CreatedFileFullName, fileTemplateInfo.TemplateId.ToString());
                        FileTemplateIDCollection.Items.Add(listitem);
                    }
                }
                else
                {
                    FileTemplateIDCollectionRow.Visible = false;
                }

                EPositionTypeUtils.AddListItems(PositionType, ERollingType.Static);

                ERollingTypeUtils.AddListItems(RollingType);
                ControlUtils.SelectListItems(RollingType, ERollingTypeUtils.GetValue(ERollingType.FollowingScreen));

                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ImageUrl.ClientID);
                SelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, ImageUrl.ClientID);
                UploadImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ScreenDownImageUrl.ClientID);
                ScreenDownSelectImage.Attributes.Add("onclick", showPopWinString);

                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, ScreenDownImageUrl.ClientID);
                ScreenDownUploadImage.Attributes.Add("onclick", showPopWinString);

                SetActivePanel(WizardPanel.AdvertisementBase, AdvertisementBase);

                if (isEdit)
                {
                    var adInfo = DataProvider.AdvertisementDao.GetAdvertisementInfo(editAdvertisementName, PublishmentSystemId);
                    AdvertisementName.Text          = adInfo.AdvertisementName;
                    AdvertisementName.Enabled       = false;
                    AdvertisementType.SelectedValue = EAdvertisementTypeUtils.GetValue(editAdvertisementType);

                    IsDateLimited.Checked = adInfo.IsDateLimited;
                    StartDate.Text        = DateUtils.GetDateAndTimeString(adInfo.StartDate);
                    EndDate.Text          = DateUtils.GetDateAndTimeString(adInfo.EndDate);
                    ControlUtils.SelectListItems(NodeIDCollectionToChannel, TranslateUtils.StringCollectionToStringList(adInfo.NodeIDCollectionToChannel));
                    ControlUtils.SelectListItems(NodeIDCollectionToContent, TranslateUtils.StringCollectionToStringList(adInfo.NodeIDCollectionToContent));
                    ControlUtils.SelectListItems(FileTemplateIDCollection, TranslateUtils.StringCollectionToStringList(adInfo.FileTemplateIDCollection));

                    if (adInfo.AdvertisementType == EAdvertisementType.FloatImage)
                    {
                        var adFloatImageInfo = new AdvertisementFloatImageInfo(adInfo.Settings);
                        IsCloseable.Checked       = adFloatImageInfo.IsCloseable;
                        ePositionType             = adFloatImageInfo.PositionType;
                        PositionX.Text            = adFloatImageInfo.PositionX.ToString();
                        PositionY.Text            = adFloatImageInfo.PositionY.ToString();
                        RollingType.SelectedValue = ERollingTypeUtils.GetValue(adFloatImageInfo.RollingType);

                        NavigationUrl.Text = adFloatImageInfo.NavigationUrl;
                        ImageUrl.Text      = adFloatImageInfo.ImageUrl;
                        Height.Text        = adFloatImageInfo.Height.ToString();
                        Width.Text         = adFloatImageInfo.Width.ToString();
                    }
                    else if (adInfo.AdvertisementType == EAdvertisementType.ScreenDown)
                    {
                        var adScreenDownInfo = new AdvertisementScreenDownInfo(adInfo.Settings);
                        ScreenDownNavigationUrl.Text = adScreenDownInfo.NavigationUrl;
                        ScreenDownImageUrl.Text      = adScreenDownInfo.ImageUrl;
                        ScreenDownDelay.Text         = adScreenDownInfo.Delay.ToString();
                        ScreenDownWidth.Text         = adScreenDownInfo.Width.ToString();
                        ScreenDownHeight.Text        = adScreenDownInfo.Height.ToString();
                    }
                    else if (adInfo.AdvertisementType == EAdvertisementType.OpenWindow)
                    {
                        var adOpenWindowInfo = new AdvertisementOpenWindowInfo(adInfo.Settings);
                        OpenWindowFileUrl.Text = adOpenWindowInfo.FileUrl;
                        OpenWindowWidth.Text   = adOpenWindowInfo.Width.ToString();
                        OpenWindowHeight.Text  = adOpenWindowInfo.Height.ToString();
                    }
                }
                ReFresh(null, EventArgs.Empty);
            }

            SuccessMessage(string.Empty);
        }
Пример #4
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            PageUtils.CheckRequestParameter("PublishmentSystemID", "RootPath", "CurrentRootPath", "TextBoxClientID");

            _rootPath        = Body.GetQueryString("RootPath").TrimEnd('/');
            _currentRootPath = Body.GetQueryString("CurrentRootPath");
            _textBoxClientId = Body.GetQueryString("TextBoxClientID");

            if (string.IsNullOrEmpty(_currentRootPath))
            {
                _currentRootPath = PublishmentSystemInfo.Additional.ConfigSelectImageCurrentUrl.TrimEnd('/');
            }
            else
            {
                PublishmentSystemInfo.Additional.ConfigSelectImageCurrentUrl = _currentRootPath;
                DataProvider.PublishmentSystemDao.Update(PublishmentSystemInfo);
            }
            _currentRootPath = _currentRootPath.TrimEnd('/');

            _directoryPath = PathUtility.MapPath(PublishmentSystemInfo, _currentRootPath);
            DirectoryUtils.CreateDirectoryIfNotExists(_directoryPath);

            if (!Page.IsPostBack)
            {
                hlUploadLink.NavigateUrl = "javascript:;";
                hlUploadLink.Attributes.Add("onclick", ModalUploadImageSingle.GetOpenWindowStringToList(PublishmentSystemId, _currentRootPath));

                var previousUrls = Session["PreviousUrls"] as ArrayList;
                if (previousUrls == null)
                {
                    previousUrls = new ArrayList();
                }
                var currentUrl = GetRedirectUrl(_currentRootPath);
                if (previousUrls.Count > 0)
                {
                    var url = previousUrls[previousUrls.Count - 1] as string;
                    if (!string.Equals(url, currentUrl))
                    {
                        previousUrls.Add(currentUrl);
                        Session["PreviousUrls"] = previousUrls;
                    }
                }
                else
                {
                    previousUrls.Add(currentUrl);
                    Session["PreviousUrls"] = previousUrls;
                }

                var navigationBuilder   = new StringBuilder();
                var directoryNames      = _currentRootPath.Split('/');
                var linkCurrentRootPath = _rootPath;
                foreach (var directoryName in directoryNames)
                {
                    if (!string.IsNullOrEmpty(directoryName))
                    {
                        if (directoryName.Equals("~"))
                        {
                            navigationBuilder.Append($"<a href='{GetRedirectUrl(_rootPath)}'>根目录</a>");
                        }
                        else if (directoryName.Equals("@"))
                        {
                            navigationBuilder.Append(
                                $"<a href='{GetRedirectUrl(_rootPath)}'>{PublishmentSystemInfo.PublishmentSystemDir}</a>");
                        }
                        else
                        {
                            linkCurrentRootPath += "/" + directoryName;
                            navigationBuilder.Append(
                                $"<a href='{GetRedirectUrl(linkCurrentRootPath)}'>{directoryName}</a>");
                        }
                        navigationBuilder.Append("\\");
                    }
                }
                ltlCurrentDirectory.Text = navigationBuilder.ToString();

                FillFileSystemsToImage(false);
            }
        }
Пример #5
0
        public void Page_Load(object sender, EventArgs e)
        {
            _advId = Body.GetQueryInt("AdvID");

            if (Body.IsQueryExists("AdMaterialID"))
            {
                _theAdMaterialId = Body.GetQueryInt("AdMaterialID");
                if (_theAdMaterialId > 0)
                {
                    _isEdit = true;
                }
            }

            if (!Page.IsPostBack)
            {
                EAdvTypeUtils.AddListItems(AdMaterialType);
                ControlUtils.SelectListItems(AdMaterialType, EAdvTypeUtils.GetValue(EAdvType.HtmlCode));

                EBooleanUtils.AddListItems(IsEnabled);
                ControlUtils.SelectListItems(IsEnabled, true.ToString());

                EAdvWeightUtils.AddListItems(Weight);
                ControlUtils.SelectListItems(Weight, EAdvWeightUtils.GetValue(EAdvWeight.Level1));

                var advInfo = DataProvider.AdvDao.GetAdvInfo(_advId, PublishmentSystemId);
                if (advInfo != null)
                {
                    if (advInfo.RotateType == EAdvRotateType.HandWeight)
                    {
                        phWeight.Visible = true;
                    }
                    else
                    {
                        phWeight.Visible = false;
                    }
                }
                ImageUrl.Attributes.Add("onchange", GetShowImageScript("preview_ImageUrl", PublishmentSystemInfo.PublishmentSystemUrl));

                var showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, ImageUrl.ClientID);
                ImageUrlSelect.Attributes.Add("onclick", showPopWinString);

                //false -- 不添加水印
                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, ImageUrl.ClientID, false);
                ImageUrlUpload.Attributes.Add("onclick", showPopWinString);

                FlashUrl.Attributes.Add("onchange", GetShowImageScript("preview_FlashUrl", PublishmentSystemInfo.PublishmentSystemUrl));

                showPopWinString = ModalSelectImage.GetOpenWindowString(PublishmentSystemInfo, FlashUrl.ClientID);
                FlashUrlSelect.Attributes.Add("onclick", showPopWinString);

                //false -- 不添加水印
                showPopWinString = ModalUploadImageSingle.GetOpenWindowStringToTextBox(PublishmentSystemId, FlashUrl.ClientID, false);
                FlashUrlUpload.Attributes.Add("onclick", showPopWinString);

                if (_isEdit)
                {
                    var adMaterialInfo = DataProvider.AdMaterialDao.GetAdMaterialInfo(_theAdMaterialId, PublishmentSystemId);
                    AdMaterialName.Text          = adMaterialInfo.AdMaterialName;
                    AdMaterialType.SelectedValue = EAdvTypeUtils.GetValue(adMaterialInfo.AdMaterialType);
                    IsEnabled.SelectedValue      = adMaterialInfo.IsEnabled.ToString();

                    Code.Text            = adMaterialInfo.Code;
                    TextWord.Text        = adMaterialInfo.TextWord;
                    TextLink.Text        = adMaterialInfo.TextLink;
                    TextColor.Text       = adMaterialInfo.TextColor;
                    TextFontSize.Text    = adMaterialInfo.TextFontSize.ToString();
                    Weight.SelectedValue = adMaterialInfo.Weight.ToString();
                    if (adMaterialInfo.AdMaterialType == EAdvType.Image)
                    {
                        ImageUrl.Text    = adMaterialInfo.ImageUrl;
                        ImageLink.Text   = adMaterialInfo.ImageLink;
                        ImageWidth.Text  = adMaterialInfo.ImageWidth.ToString();
                        ImageHeight.Text = adMaterialInfo.ImageHeight.ToString();
                        ImageAlt.Text    = adMaterialInfo.ImageAlt;
                    }
                    else if (adMaterialInfo.AdMaterialType == EAdvType.Flash)
                    {
                        FlashUrl.Text    = adMaterialInfo.ImageUrl;
                        FlashWidth.Text  = adMaterialInfo.ImageWidth.ToString();
                        FlashHeight.Text = adMaterialInfo.ImageHeight.ToString();
                    }
                }

                ReFresh(null, EventArgs.Empty);
            }

            SuccessMessage(string.Empty);
        }