Ejemplo n.º 1
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var id       = TranslateUtils.EvalInt(e.Item.DataItem, "ID");
                var userName = TranslateUtils.EvalString(e.Item.DataItem, "UserName");
                var num      = TranslateUtils.EvalInt(e.Item.DataItem, "Num");
                var action   = TranslateUtils.EvalString(e.Item.DataItem, "Action");
                var addDate  = TranslateUtils.EvalDateTime(e.Item.DataItem, "AddDate");

                var cardSNInfo = DataProviderWX.CardSNDAO.GetCardSNInfo(PublishmentSystemID, 0, string.Empty, userName);
                var userInfo   = BaiRongDataProvider.UserDao.GetUserInfoByUserName(userName);

                var ltlItemIndex = e.Item.FindControl("ltlItemIndex") as Literal;
                var ltlSN        = e.Item.FindControl("ltlSN") as Literal;
                var ltlUserName  = e.Item.FindControl("ltlUserName") as Literal;
                var ltlMobile    = e.Item.FindControl("ltlMobile") as Literal;
                var ltlNum       = e.Item.FindControl("ltlNum") as Literal;
                var ltlAction    = e.Item.FindControl("ltlAction") as Literal;
                var ltlAddDate   = e.Item.FindControl("ltlAddDate") as Literal;


                ltlItemIndex.Text = (e.Item.ItemIndex + 1).ToString();
                ltlSN.Text        = cardSNInfo != null ? cardSNInfo.SN : string.Empty;
                ltlUserName.Text  = userInfo != null? userInfo.UserName:string.Empty;
                ltlMobile.Text    = userInfo != null? userInfo.Mobile:string.Empty;
                ltlNum.Text       = num.ToString();
                ltlAction.Text    = action;
                ltlAddDate.Text   = DateUtils.GetDateAndTimeString(addDate);
            }
        }
Ejemplo n.º 2
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordID   = TranslateUtils.EvalInt(e.Item.DataItem, "KeywordID");
                var keyword     = TranslateUtils.EvalString(e.Item.DataItem, "Keyword");
                var keywordType = EKeywordTypeUtils.GetEnumType(TranslateUtils.EvalString(e.Item.DataItem, "KeywordType"));

                var ltlKeyword = e.Item.FindControl("ltlKeyword") as Literal;

                ltlKeyword.Text =
                    $@"<div class=""alert alert-success pull-left"" style=""margin:5px;padding-right:14px; cursor:pointer;"" onclick=""window.parent.{jsMethod}('{keyword}');{JsUtils.OpenWindow.HIDE_POP_WIN}""><strong style=""color: #468847"">{keyword}</strong>&nbsp;({EKeywordTypeUtils
                        .GetText(keywordType)})</div>";
            }
        }
Ejemplo n.º 3
0
        void rptParentContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var id            = TranslateUtils.EvalInt(e.Item.DataItem, "ID");
                var albumID       = TranslateUtils.EvalInt(e.Item.DataItem, "AlbumID");
                var parentID      = TranslateUtils.EvalInt(e.Item.DataItem, "ParentID");
                var title         = TranslateUtils.EvalString(e.Item.DataItem, "Title");
                var imageUrl      = TranslateUtils.EvalString(e.Item.DataItem, "ImageUrl");
                var largeImageUrl = TranslateUtils.EvalString(e.Item.DataItem, "LargeImageUrl");

                var albumInfo   = DataProviderWX.AlbumDAO.GetAlbumInfo(albumID);
                var keywordInfo = DataProviderWX.KeywordDAO.GetKeywordInfo(albumInfo.KeywordID);
                var count       = DataProviderWX.AlbumContentDAO.GetCount(PublishmentSystemId, id);

                var ltlkeywrods      = e.Item.FindControl("ltlkeywrods") as Literal;
                var ltlAddDate       = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlTitle         = e.Item.FindControl("ltlTitle") as Literal;
                var ltlLargeImageUrl = e.Item.FindControl("ltlLargeImageUrl") as Literal;

                var dlAlbumContents = e.Item.FindControl("dlAlbumContents") as DataList;


                var ltlAddUrl    = e.Item.FindControl("ltlAddUrl") as Literal;
                var ltlDeleteUrl = e.Item.FindControl("ltlDeleteUrl") as Literal;

                ltlkeywrods.Text =
                    $@" <a href=""javascript:;"" onclick=""{ModalAlbumContentAdd.GetOpenWindowStringToEdit(PublishmentSystemId, this.albumID, id)}"">编辑相册</a>";
                ltlAddDate.Text = DateUtils.GetDateString(keywordInfo.AddDate);

                ltlTitle.Text         = $@"<a href=""{"javascript:;"}"" target=""_blank"">{title}&nbsp;({count})</a>";
                ltlLargeImageUrl.Text =
                    $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, largeImageUrl)}"" class=""appmsg_thumb"">";


                dlAlbumContents.DataSource     = DataProviderWX.AlbumContentDAO.GetDataSource(PublishmentSystemId, this.albumID, id);
                dlAlbumContents.ItemDataBound += dlContents_ItemDataBound;
                dlAlbumContents.DataBind();


                ltlAddUrl.Text =
                    $@"<a class=""js_edit"" href=""javascript:;"" onclick=""{ModalAlbumContentPhotoUpload.GetOpenWindowStringToAdd(PublishmentSystemId, this.albumID, id)}""><i class=""icon18_common edit_gray"">上传照片</i></a>";

                ltlDeleteUrl.Text =
                    $@"<a class=""js_delno_extra"" href=""{GetRedirectUrl(PublishmentSystemId,
                        this.albumID)}&delete=true&id={id}"" onclick=""javascript:return confirm('此操作将删除相册“{title}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>";
            }
        }
Ejemplo n.º 4
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordID   = TranslateUtils.EvalInt(e.Item.DataItem, "KeywordID");
                var keyword     = TranslateUtils.EvalString(e.Item.DataItem, "Keyword");
                var keywordType = EKeywordTypeUtils.GetEnumType(TranslateUtils.EvalString(e.Item.DataItem, "KeywordType"));

                var ltlKeyword = e.Item.FindControl("ltlKeyword") as Literal;

                string urlDelete =
                    $@"{GetRedirectUrl(PublishmentSystemID)}&delete=true&deleteKeywordID={keywordID}&deleteKeyword={keyword}";

                ltlKeyword.Text =
                    $@"<div class=""alert alert-success pull-left"" style=""margin:5px;padding-right:14px;""><strong style=""color: #468847"">{keyword}</strong>&nbsp;({EKeywordTypeUtils
                        .GetText(keywordType)})&nbsp;<a href=""javascript:;"" onclick=""{Modal.KeywordEdit
                        .GetOpenWindowString(PublishmentSystemID, keywordID, keyword)}""><i class=""icon-edit""></i></a>&nbsp;<a href=""{urlDelete}"" onclick=""javascript:return confirm('此操作将删除关键字“{keyword}”,确认吗?');""><i class=""icon-remove""></i></a></div>";
            }
        }
Ejemplo n.º 5
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordID  = TranslateUtils.EvalInt(e.Item.DataItem, "KeywordID");
                var keywords   = TranslateUtils.EvalString(e.Item.DataItem, "Keywords");
                var reply      = TranslateUtils.EvalString(e.Item.DataItem, "Reply");
                var isDisabled = TranslateUtils.ToBool(TranslateUtils.EvalString(e.Item.DataItem, "IsDisabled"));
                var matchType  = EMatchTypeUtils.GetEnumType(TranslateUtils.EvalString(e.Item.DataItem, "MatchType"));
                var addDate    = TranslateUtils.EvalDateTime(e.Item.DataItem, "AddDate");

                var ltlReply     = e.Item.FindControl("ltlReply") as Literal;
                var ltlAddDate   = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlMatchType = e.Item.FindControl("ltlMatchType") as Literal;
                var ltlIsEnabled = e.Item.FindControl("ltlIsEnabled") as Literal;
                var hlUp         = e.Item.FindControl("hlUp") as HyperLink;
                var hlDown       = e.Item.FindControl("hlDown") as HyperLink;
                var ltlEditUrl   = e.Item.FindControl("ltlEditUrl") as Literal;
                var ltlDeleteUrl = e.Item.FindControl("ltlDeleteUrl") as Literal;

                ltlReply.Text     = StringUtils.CleanText(reply);
                ltlAddDate.Text   = DateUtils.GetDateString(addDate);
                ltlMatchType.Text = EMatchTypeUtils.GetText(matchType);
                ltlIsEnabled.Text = StringUtils.GetTrueOrFalseImageHtml(!isDisabled);

                var redirectUrl = GetRedirectUrl(PublishmentSystemID);

                hlUp.NavigateUrl   = $"{redirectUrl}&SetTaxis=True&KeywordID={keywordID}&Direction=UP";
                hlDown.NavigateUrl = $"{redirectUrl}&SetTaxis=True&KeywordID={keywordID}&Direction=DOWN";

                var showPopWinString = Modal.KeywordAddText.GetOpenWindowStringToEdit(PublishmentSystemID, keywordID);
                ltlEditUrl.Text = $@"<a href=""javascript:;"" onClick=""{showPopWinString}"">修改</a>";

                ltlDeleteUrl.Text =
                    $@"<a href=""{redirectUrl}&Delete=True&KeywordID={keywordID}"" onClick=""javascript:return confirm('此操作将删除关键字“{keywords}”,确认吗?');"">删除</a>";
            }
        }
Ejemplo n.º 6
0
        void dlContents_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var imageUrl      = TranslateUtils.EvalString(e.Item.DataItem, "ImageUrl");
                var largeImageUrl = TranslateUtils.EvalString(e.Item.DataItem, "LargeImageUrl");

                var tbContentImageUrl = e.Item.FindControl("tbContentImageUrl") as TextBox;
                var ltlImageUrl       = e.Item.FindControl("ltlImageUrl") as Literal;

                if (string.IsNullOrEmpty(imageUrl))
                {
                    ltlImageUrl.Text = @"<i class=""appmsg_thumb default"">缩略图</i>";
                }
                else
                {
                    var previewImageClick = ModalMessage.GetOpenWindowStringToPreviewImage(PublishmentSystemId, tbContentImageUrl.ClientID);
                    tbContentImageUrl.Text = PageUtility.ParseNavigationUrl(PublishmentSystemInfo, largeImageUrl);
                    ltlImageUrl.Text       =
                        $@"<a  href=""javascript:;"" onclick=""{previewImageClick}""> <img class=""img-rounded"" style=""width:80px;"" src=""{PageUtility
                            .ParseNavigationUrl(PublishmentSystemInfo, imageUrl)}""> </a>";
                }
            }
        }
Ejemplo n.º 7
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordID  = TranslateUtils.EvalInt(e.Item.DataItem, "KeywordID");
                var keywords   = TranslateUtils.EvalString(e.Item.DataItem, "Keywords");
                var isDisabled = TranslateUtils.ToBool(TranslateUtils.EvalString(e.Item.DataItem, "IsDisabled"));
                var reply      = TranslateUtils.EvalString(e.Item.DataItem, "Reply");
                var matchType  = EMatchTypeUtils.GetEnumType(TranslateUtils.EvalString(e.Item.DataItem, "MatchType"));
                var addDate    = TranslateUtils.EvalDateTime(e.Item.DataItem, "AddDate");

                var phSingle   = e.Item.FindControl("phSingle") as PlaceHolder;
                var phMultiple = e.Item.FindControl("phMultiple") as PlaceHolder;

                var resourceInfoList = DataProviderWX.KeywordResourceDAO.GetResourceInfoList(keywordID);

                phMultiple.Visible = resourceInfoList.Count > 1;
                phSingle.Visible   = !phMultiple.Visible;

                if (phSingle.Visible)
                {
                    var resourceInfo = new KeywordResourceInfo();
                    if (resourceInfoList.Count > 0)
                    {
                        resourceInfo = resourceInfoList[0];
                    }

                    var ltlSingleTitle     = e.Item.FindControl("ltlSingleTitle") as Literal;
                    var ltlSingleKeywords  = e.Item.FindControl("ltlSingleKeywords") as Literal;
                    var ltlSingleAddDate   = e.Item.FindControl("ltlSingleAddDate") as Literal;
                    var ltlSingleImageUrl  = e.Item.FindControl("ltlSingleImageUrl") as Literal;
                    var ltlSingleSummary   = e.Item.FindControl("ltlSingleSummary") as Literal;
                    var ltlSingleEditUrl   = e.Item.FindControl("ltlSingleEditUrl") as Literal;
                    var ltlSingleDeleteUrl = e.Item.FindControl("ltlSingleDeleteUrl") as Literal;

                    ltlSingleTitle.Text    = $@"<a href=""{"javascript:;"}"" target=""_blank"">{resourceInfo.Title}</a>";
                    ltlSingleKeywords.Text =
                        $@"{keywords + (isDisabled ? "(禁用)" : string.Empty)}&nbsp;<a href=""javascript:;"" onclick=""{Modal
                            .KeywordAddNews.GetOpenWindowStringToEdit(PublishmentSystemID, keywordID)}"">修改</a>";
                    ltlSingleAddDate.Text = addDate.ToShortDateString();
                    if (!string.IsNullOrEmpty(resourceInfo.ImageUrl))
                    {
                        ltlSingleImageUrl.Text =
                            $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" class=""appmsg_thumb"">";
                    }
                    ltlSingleSummary.Text = MPUtils.GetSummary(resourceInfo.Summary, resourceInfo.Content);
                    ltlSingleEditUrl.Text =
                        $@"<a class=""js_edit"" href=""{BackgroundKeywordNewsAdd.GetRedirectUrl(PublishmentSystemID,
                            keywordID, resourceInfo.ResourceID, phSingle.Visible)}""><i class=""icon18_common edit_gray"">编辑</i></a>";
                    ltlSingleDeleteUrl.Text =
                        $@"<a class=""js_del no_extra"" href=""{GetRedirectUrl(
                            PublishmentSystemID)}&delete=true&keywordID={keywordID}"" onclick=""javascript:return confirm('此操作将删除图文回复“{keywords}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>";
                }
                else
                {
                    var resourceInfo = resourceInfoList[0];
                    resourceInfoList.Remove(resourceInfo);

                    var ltlMultipleKeywords  = e.Item.FindControl("ltlMultipleKeywords") as Literal;
                    var ltlMultipleAddDate   = e.Item.FindControl("ltlMultipleAddDate") as Literal;
                    var ltlMultipleTitle     = e.Item.FindControl("ltlMultipleTitle") as Literal;
                    var ltlMultipleImageUrl  = e.Item.FindControl("ltlMultipleImageUrl") as Literal;
                    var rptMultipleContents  = e.Item.FindControl("rptMultipleContents") as Repeater;
                    var ltlMultipleEditUrl   = e.Item.FindControl("ltlMultipleEditUrl") as Literal;
                    var ltlMultipleDeleteUrl = e.Item.FindControl("ltlMultipleDeleteUrl") as Literal;

                    ltlMultipleKeywords.Text =
                        $@"{keywords + (isDisabled ? "(禁用)" : string.Empty)}&nbsp;<a href=""javascript:;"" onclick=""{Modal
                            .KeywordAddNews.GetOpenWindowStringToEdit(PublishmentSystemID, keywordID)}"">修改</a>";

                    ltlMultipleAddDate.Text = addDate.ToShortDateString();
                    ltlMultipleTitle.Text   = $@"<a href=""{"javascript:;"}"" target=""_blank"">{resourceInfo.Title}</a>";
                    if (!string.IsNullOrEmpty(resourceInfo.ImageUrl))
                    {
                        ltlMultipleImageUrl.Text =
                            $@"<img src=""{PageUtility.ParseNavigationUrl(PublishmentSystemInfo, resourceInfo.ImageUrl)}"" class=""appmsg_thumb"">";
                    }

                    rptMultipleContents.DataSource     = resourceInfoList;
                    rptMultipleContents.ItemDataBound += rptMultipleContents_ItemDataBound;
                    rptMultipleContents.DataBind();

                    ltlMultipleEditUrl.Text =
                        $@"<a class=""js_edit"" href=""{BackgroundKeywordNewsAdd.GetRedirectUrl(PublishmentSystemID,
                            keywordID, resourceInfo.ResourceID, phSingle.Visible)}""><i class=""icon18_common edit_gray"">编辑</i></a>";
                    ltlMultipleDeleteUrl.Text =
                        $@"<a class=""js_del no_extra"" href=""{GetRedirectUrl(
                            PublishmentSystemID)}&delete=true&keywordID={keywordID}"" onclick=""javascript:return confirm('此操作将删除图文回复“{keywords}”,确认吗?');""><i class=""icon18_common del_gray"">删除</i></a>";
                }
            }
        }