Ejemplo n.º 1
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var relatedFieldID   = SqlUtils.EvalInt(e.Item.DataItem, "RelatedFieldID");
                var relatedFieldName = SqlUtils.EvalString(e.Item.DataItem, "RelatedFieldName");
                var totalLevel       = SqlUtils.EvalInt(e.Item.DataItem, "TotalLevel");

                var ltlRelatedFieldName = (Literal)e.Item.FindControl("ltlRelatedFieldName");
                var ltlTotalLevel       = (Literal)e.Item.FindControl("ltlTotalLevel");
                var ltlItemsUrl         = (Literal)e.Item.FindControl("ltlItemsUrl");
                var ltlEditUrl          = (Literal)e.Item.FindControl("ltlEditUrl");
                var ltlExportUrl        = (Literal)e.Item.FindControl("ltlExportUrl");
                var ltlDeleteUrl        = (Literal)e.Item.FindControl("ltlDeleteUrl");

                ltlRelatedFieldName.Text = relatedFieldName;
                ltlTotalLevel.Text       = totalLevel.ToString();
                var urlItems = PageRelatedFieldMain.GetRedirectUrl(PublishmentSystemId, relatedFieldID, totalLevel);
                ltlItemsUrl.Text = $@"<a href=""{urlItems}"">管理字段项</a>";

                ltlEditUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalRelatedFieldAdd.GetOpenWindowString(
                        PublishmentSystemId, relatedFieldID)}"">编辑</a>";
                ltlExportUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToRelatedField(PublishmentSystemId, relatedFieldID)}"">导出</a>";
                ltlDeleteUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{PageUtils.GetRedirectStringWithConfirm(
                        PageUtils.GetCmsUrl(nameof(PageRelatedField), new NameValueCollection
                        {
                            {"PublishmentSystemID", PublishmentSystemId.ToString()},
                            {"RelatedFieldID", relatedFieldID.ToString()},
                            {"Delete", true.ToString()}
                        }), " 确认删除此联动字段吗? ")}" ">删除</a>";
            }
        }
Ejemplo n.º 2
0
        void rptRemarks_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlRemarkType            = e.Item.FindControl("ltlRemarkType") as Literal;
                var ltlAddDate               = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlDepartmentAndUserName = e.Item.FindControl("ltlDepartmentAndUserName") as Literal;
                var ltlRemark = e.Item.FindControl("ltlRemark") as Literal;

                var departmentID = SqlUtils.EvalInt(e.Item.DataItem, "DepartmentID");
                var userName     = SqlUtils.EvalString(e.Item.DataItem, "UserName");
                var addDate      = SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate");
                var remarkType   = EGovInteractRemarkTypeUtils.GetEnumType(SqlUtils.EvalString(e.Item.DataItem, "RemarkType"));
                var remark       = SqlUtils.EvalString(e.Item.DataItem, "Remark");

                if (string.IsNullOrEmpty(remark))
                {
                    e.Item.Visible = false;
                }
                else
                {
                    phRemarks.Visible             = true;
                    ltlRemarkType.Text            = EGovInteractRemarkTypeUtils.GetText(remarkType);
                    ltlAddDate.Text               = DateUtils.GetDateAndTimeString(addDate);
                    ltlDepartmentAndUserName.Text = $"{DepartmentManager.GetDepartmentName(departmentID)}({userName})";
                    ltlRemark.Text = remark;
                }
            }
        }
Ejemplo n.º 3
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var keywordId   = SqlUtils.EvalInt(e.Item.DataItem, nameof(KeywordInfo.Id));
            var keyword     = SqlUtils.EvalString(e.Item.DataItem, nameof(KeywordInfo.Keyword));
            var alternative = SqlUtils.EvalString(e.Item.DataItem, nameof(KeywordInfo.Alternative));
            var grade       = EKeywordGradeUtils.GetEnumType(SqlUtils.EvalString(e.Item.DataItem, nameof(KeywordInfo.Grade)));

            var ltlKeyword     = (Literal)e.Item.FindControl("ltlKeyword");
            var ltlAlternative = (Literal)e.Item.FindControl("ltlAlternative");
            var ltlGrade       = (Literal)e.Item.FindControl("ltlGrade");
            var ltlEdit        = (Literal)e.Item.FindControl("ltlEdit");
            var ltlDelete      = (Literal)e.Item.FindControl("ltlDelete");

            ltlKeyword.Text     = keyword;
            ltlAlternative.Text = alternative;
            ltlGrade.Text       = EKeywordGradeUtils.GetText(grade);
            ltlEdit.Text        =
                $@"<a href='javascript:;' onclick=""{ModalKeywordAdd.GetOpenWindowStringToEdit(keywordId)}"">编辑</a>";

            var urlDelete = PageUtils.GetSettingsUrl(nameof(PageSiteKeyword), new NameValueCollection
            {
                { "Delete", "True" },
                { "KeywordID", keywordId.ToString() }
            });

            ltlDelete.Text =
                $@"<a href=""{urlDelete}"" onClick=""javascript:return confirm('此操作将删除关键字“{keyword}”确认吗?')"";>删除</a>";
        }
Ejemplo n.º 4
0
        public static string GetSitesTemplateString(string templateString, string containerClientId, PageInfo pageInfo, EContextType contextType, ContextInfo contextInfoRef)
        {
            var itemContainer = DbItemContainer.GetItemContainer(pageInfo);

            var siteId   = SqlUtils.EvalInt(itemContainer.SiteItem.DataItem, SiteAttribute.Id);
            var siteInfo = SiteManager.GetSiteInfo(siteId);

            var contextInfo = contextInfoRef.Clone();

            contextInfo.ContainerClientId = containerClientId;
            contextInfo.ItemContainer     = itemContainer;
            contextInfo.ContextType       = contextType;

            var preSiteInfo      = pageInfo.SiteInfo;
            var prePageChannelId = pageInfo.PageChannelId;
            var prePageContentId = pageInfo.PageContentId;

            pageInfo.ChangeSite(siteInfo, siteInfo.Id, 0, contextInfo);

            var innerBuilder = new StringBuilder(templateString);

            StlParserManager.ParseInnerContent(innerBuilder, pageInfo, contextInfo);

            DbItemContainer.PopSiteItems(pageInfo);

            pageInfo.ChangeSite(preSiteInfo, prePageChannelId, prePageContentId, contextInfo);

            return(innerBuilder.ToString());
        }
Ejemplo n.º 5
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var userId       = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.Id));
            var userName     = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.UserName));
            var displayName  = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.DisplayName));
            var mobile       = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.Mobile));
            var avatarUrl    = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.AvatarUrl));
            var departmentId = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.DepartmentId));
            var areaId       = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.AreaId));

            if (string.IsNullOrEmpty(displayName))
            {
                displayName = userName;
            }
            var countOfFailedLogin = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.CountOfFailedLogin));
            var countOfLogin       = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.CountOfLogin));
            var isLockedOut        = SqlUtils.EvalBool(e.Item.DataItem, nameof(AdministratorInfo.IsLockedOut));
            var lastActivityDate   = SqlUtils.EvalDateTime(e.Item.DataItem, nameof(AdministratorInfo.LastActivityDate));

            var ltlAvatar           = (Literal)e.Item.FindControl("ltlAvatar");
            var ltlUserName         = (Literal)e.Item.FindControl("ltlUserName");
            var ltlDisplayName      = (Literal)e.Item.FindControl("ltlDisplayName");
            var ltlMobile           = (Literal)e.Item.FindControl("ltlMobile");
            var ltlDepartment       = (Literal)e.Item.FindControl("ltlDepartment");
            var ltlArea             = (Literal)e.Item.FindControl("ltlArea");
            var ltlLastActivityDate = (Literal)e.Item.FindControl("ltlLastActivityDate");
            var ltlCountOfLogin     = (Literal)e.Item.FindControl("ltlCountOfLogin");
            var ltlRoles            = (Literal)e.Item.FindControl("ltlRoles");
            var ltlActions          = (Literal)e.Item.FindControl("ltlActions");
            var ltlSelect           = (Literal)e.Item.FindControl("ltlSelect");

            ltlAvatar.Text      = $@"<img src=""{(!string.IsNullOrEmpty(avatarUrl) ? avatarUrl : "../assets/images/default_avatar.png")}"" class=""rounded-circle"" style=""height: 36px; width: 36px;""/>";
            ltlUserName.Text    = GetUserNameHtml(userId, userName, countOfFailedLogin, isLockedOut, lastActivityDate);
            ltlDisplayName.Text = displayName;
            ltlMobile.Text      = mobile;
            ltlDepartment.Text  = DepartmentManager.GetDepartmentName(departmentId);
            ltlArea.Text        = AreaManager.GetAreaName(areaId);

            ltlLastActivityDate.Text = GetDateTime(lastActivityDate);
            ltlCountOfLogin.Text     = countOfLogin.ToString();
            ltlRoles.Text            = AdminManager.GetRolesHtml(userName);

            if (AuthRequest.AdminName != userName)
            {
                ltlActions.Text = ConfigHelper.GetConfigBool("IsSso") ? $@"
<a class=""m-r-5"" href=""javascript:;"" onclick=""{ModalPermissionsSet.GetOpenWindowString(userName)}"">权限设置</a>
" : $@"
<a class=""m-r-5"" href=""adminProfile.cshtml?pageType=admin&userId={userId}"">修改资料</a>
<a class=""m-r-5"" href=""adminPassword.cshtml?pageType=admin&userId={userId}"">更改密码</a>
<a class=""m-r-5"" href=""javascript:;"" onclick=""{ModalPermissionsSet.GetOpenWindowString(userName)}"">权限设置</a>
";

                ltlSelect.Text = $@"<input type=""checkbox"" name=""UserNameCollection"" value=""{userName}"" />";
            }
        }
Ejemplo n.º 6
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var id       = SqlUtils.EvalInt(e.Item.DataItem, "ID");
                var userName = SqlUtils.EvalString(e.Item.DataItem, "UserName");
                var num      = SqlUtils.EvalInt(e.Item.DataItem, "Num");
                var action   = SqlUtils.EvalString(e.Item.DataItem, "Action");
                var addDate  = SqlUtils.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.º 7
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var taskID   = SqlUtils.EvalInt(e.Item.DataItem, "TaskID");
                var taskInfo = DataProvider.TaskDao.GetTaskInfo(taskID);

                var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(taskInfo.PublishmentSystemID);
                if (publishmentSystemInfo == null)
                {
                    e.Item.Visible = false;
                }

                var addDate      = SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate");
                var isSuccess    = SqlUtils.EvalString(e.Item.DataItem, "IsSuccess");
                var errorMessage = SqlUtils.EvalString(e.Item.DataItem, "ErrorMessage");

                var ltlPublishmentSystem = (Literal)e.Item.FindControl("ltlPublishmentSystem");
                var ltlTaskName          = (Literal)e.Item.FindControl("ltlTaskName");
                var ltlServiceType       = (Literal)e.Item.FindControl("ltlServiceType");
                var ltlAddDate           = (Literal)e.Item.FindControl("ltlAddDate");
                var ltlIsSuccess         = (Literal)e.Item.FindControl("ltlIsSuccess");
                var ltlErrorMessage      = (Literal)e.Item.FindControl("ltlErrorMessage");

                ltlPublishmentSystem.Text = publishmentSystemInfo.PublishmentSystemName;
                ltlTaskName.Text          = taskInfo.TaskName;
                ltlServiceType.Text       = EServiceTypeUtils.GetText(taskInfo.ServiceType);

                ltlAddDate.Text      = DateUtils.GetDateAndTimeString(addDate);
                ltlIsSuccess.Text    = StringUtils.GetTrueOrFalseImageHtml(isSuccess);
                ltlErrorMessage.Text = errorMessage;
            }
        }
Ejemplo n.º 8
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var ltlSite      = (Literal)e.Item.FindControl("ltlSite");
            var ltlUserName  = (Literal)e.Item.FindControl("ltlUserName");
            var ltlAddDate   = (Literal)e.Item.FindControl("ltlAddDate");
            var ltlIpAddress = (Literal)e.Item.FindControl("ltlIpAddress");
            var ltlAction    = (Literal)e.Item.FindControl("ltlAction");
            var ltlSummary   = (Literal)e.Item.FindControl("ltlSummary");

            if (SiteId == 0)
            {
                var siteInfo = SiteManager.GetSiteInfo(SqlUtils.EvalInt(e.Item.DataItem, nameof(SiteLogInfo.SiteId)));
                var siteName = string.Empty;
                if (siteInfo != null)
                {
                    siteName =
                        $"<a href='{siteInfo.Additional.WebUrl}' target='_blank'>{siteInfo.SiteName}</a>";
                }
                ltlSite.Text = $@"<td align=""text-center text-nowrap"">{siteName}</td>";
            }
            ltlUserName.Text  = SqlUtils.EvalString(e.Item.DataItem, nameof(SiteLogInfo.UserName));
            ltlAddDate.Text   = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, nameof(SiteLogInfo.AddDate)));
            ltlIpAddress.Text = SqlUtils.EvalString(e.Item.DataItem, nameof(SiteLogInfo.IpAddress));
            ltlAction.Text    = SqlUtils.EvalString(e.Item.DataItem, nameof(SiteLogInfo.Action));
            ltlSummary.Text   = SqlUtils.EvalString(e.Item.DataItem, nameof(SiteLogInfo.Summary));
        }
Ejemplo n.º 9
0
        private static void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var id         = SqlUtils.EvalInt(e.Item.DataItem, nameof(ErrorLogInfo.Id));
            var addDate    = SqlUtils.EvalDateTime(e.Item.DataItem, nameof(ErrorLogInfo.AddDate));
            var message    = SqlUtils.EvalString(e.Item.DataItem, nameof(ErrorLogInfo.Message));
            var stacktrace = SqlUtils.EvalString(e.Item.DataItem, nameof(ErrorLogInfo.Stacktrace));
            var summary    = SqlUtils.EvalString(e.Item.DataItem, nameof(ErrorLogInfo.Summary));

            var ltlId         = (Literal)e.Item.FindControl("ltlId");
            var ltlAddDate    = (Literal)e.Item.FindControl("ltlAddDate");
            var ltlMessage    = (Literal)e.Item.FindControl("ltlMessage");
            var ltlStacktrace = (Literal)e.Item.FindControl("ltlStacktrace");
            var ltlSummary    = (Literal)e.Item.FindControl("ltlSummary");

            ltlId.Text         = id.ToString();
            ltlAddDate.Text    = DateUtils.GetDateAndTimeString(addDate);
            ltlMessage.Text    = message;
            ltlStacktrace.Text = stacktrace;
            ltlSummary.Text    = summary;
            if (!string.IsNullOrEmpty(ltlSummary.Text))
            {
                ltlSummary.Text += "<br />";
            }
        }
Ejemplo n.º 10
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlTitle = e.Item.FindControl("ltlTitle") as Literal;

                var functionId  = SqlUtils.EvalInt(e.Item.DataItem, "ID");
                var keywordType = EKeywordTypeUtils.GetEnumType(DdlKeywordType.SelectedValue);
                var pageTitle   = KeywordManager.GetFunctionName(keywordType, functionId);

                var clickString = string.Empty;

                if (Request.QueryString["itemIndex"] != null)
                {
                    clickString =
                        $@"window.parent.{_jsMethod}({_itemIndex}, '{EKeywordTypeUtils.GetValue(keywordType)}', {functionId}, '{pageTitle}');{PageUtils.HidePopWin}";
                }
                else
                {
                    clickString =
                        $@"window.parent.{_jsMethod}('{EKeywordTypeUtils.GetValue(keywordType)},{functionId},{pageTitle}');{PageUtils.HidePopWin}";
                }

                ltlTitle.Text = $@"
<div class=""alert alert-success pull-left"" style=""margin:5px;padding-right:14px; cursor:pointer;"" onclick=""{clickString}"">
    <strong style=""color: #468847"">{pageTitle}</strong>
</div>";
            }
        }
Ejemplo n.º 11
0
        public static string GetSitesTemplateString(string templateString, string containerClientID, PageInfo pageInfo, EContextType contextType, ContextInfo contextInfoRef)
        {
            var itemContainer = DbItemContainer.GetItemContainer(pageInfo);

            var publishmentSystemID   = SqlUtils.EvalInt(itemContainer.SiteItem.DataItem, PublishmentSystemAttribute.PublishmentSystemId);
            var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemID);

            var contextInfo = contextInfoRef.Clone();

            contextInfo.ContainerClientID = containerClientID;
            contextInfo.ItemContainer     = itemContainer;
            contextInfo.ContextType       = contextType;

            var prePublishmentSystemInfo = pageInfo.PublishmentSystemInfo;
            var prePageNodeID            = pageInfo.PageNodeId;
            var prePageContentID         = pageInfo.PageContentId;

            pageInfo.ChangeSite(publishmentSystemInfo, publishmentSystemInfo.PublishmentSystemId, 0, contextInfo);

            var innerBuilder = new StringBuilder(templateString);

            StlParserManager.ParseInnerContent(innerBuilder, pageInfo, contextInfo);

            DbItemContainer.PopInputItem(pageInfo);

            pageInfo.ChangeSite(prePublishmentSystemInfo, prePageNodeID, prePageContentID, contextInfo);

            return(innerBuilder.ToString());
        }
Ejemplo n.º 12
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var tableMetadataId = SqlUtils.EvalInt(e.Item.DataItem, nameof(TableMetadataInfo.Id));
            var attributeName   = SqlUtils.EvalString(e.Item.DataItem, nameof(TableMetadataInfo.AttributeName));
            var dataType        = SqlUtils.EvalString(e.Item.DataItem, nameof(TableMetadataInfo.DataType));
            var isSystem        = SqlUtils.EvalString(e.Item.DataItem, nameof(TableMetadataInfo.IsSystem));

            var ltlAttributeName = (Literal)e.Item.FindControl("ltlAttributeName");
            var ltlDataType      = (Literal)e.Item.FindControl("ltlDataType");
            var hlUp             = (HyperLink)e.Item.FindControl("hlUp");
            var hlDown           = (HyperLink)e.Item.FindControl("hlDown");
            var ltlEditUrl       = (Literal)e.Item.FindControl("ltlEditUrl");
            var ltlDeleteUrl     = (Literal)e.Item.FindControl("ltlDeleteUrl");

            ltlAttributeName.Text = attributeName;

            ltlDataType.Text = DataTypeUtils.GetText(DataTypeUtils.GetEnumType(dataType));

            if (TranslateUtils.ToBool(isSystem))
            {
                hlUp.Visible = hlDown.Visible = false;
                return;
            }

            hlUp.NavigateUrl = PageUtils.GetSettingsUrl(nameof(PageSiteTableMetadata),
                                                        new NameValueCollection
            {
                { "SiteId", SiteId.ToString() },
                { "SetTaxis", "True" },
                { "Direction", "UP" },
                { "TableMetadataId", tableMetadataId.ToString() },
                { "ENName", _tableName }
            });

            hlDown.NavigateUrl = PageUtils.GetSettingsUrl(nameof(PageSiteTableMetadata),
                                                          new NameValueCollection
            {
                { "SiteId", SiteId.ToString() },
                { "SetTaxis", "True" },
                { "Direction", "DOWN" },
                { "TableMetadataId", tableMetadataId.ToString() },
                { "ENName", _tableName }
            });

            ltlEditUrl.Text =
                $@"<a href=""javascript:;"" onclick=""{ModalTableMetadataAdd.GetOpenWindowStringToEdit(_tableName, tableMetadataId)}"">修改字段</a>";

            ltlDeleteUrl.Text =
                $@"<a href=""{PageUtils.AddQueryString(_redirectUrl, new NameValueCollection
                {
                    {"Delete", true.ToString()},
                    {"TableMetadataID", tableMetadataId.ToString()}
                })}"" onClick=""javascript:return confirm('此操作将删除辅助字段“{attributeName}”,确认吗?');"">删除字段</a>";
        }
Ejemplo n.º 13
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var userName     = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.UserName));
            var displayName  = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.DisplayName));
            var mobile       = SqlUtils.EvalString(e.Item.DataItem, nameof(AdministratorInfo.Mobile));
            var departmentId = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.DepartmentId));
            var areaId       = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.AreaId));

            if (string.IsNullOrEmpty(displayName))
            {
                displayName = userName;
            }
            var countOfFailedLogin = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.CountOfFailedLogin));
            var countOfLogin       = SqlUtils.EvalInt(e.Item.DataItem, nameof(AdministratorInfo.CountOfLogin));
            var isLockedOut        = SqlUtils.EvalBool(e.Item.DataItem, nameof(AdministratorInfo.IsLockedOut));
            var lastActivityDate   = SqlUtils.EvalDateTime(e.Item.DataItem, nameof(AdministratorInfo.LastActivityDate));

            var ltlUserName         = (Literal)e.Item.FindControl("ltlUserName");
            var ltlDisplayName      = (Literal)e.Item.FindControl("ltlDisplayName");
            var ltlMobile           = (Literal)e.Item.FindControl("ltlMobile");
            var ltlDepartment       = (Literal)e.Item.FindControl("ltlDepartment");
            var ltlArea             = (Literal)e.Item.FindControl("ltlArea");
            var ltlLastActivityDate = (Literal)e.Item.FindControl("ltlLastActivityDate");
            var ltlCountOfLogin     = (Literal)e.Item.FindControl("ltlCountOfLogin");
            var ltlRoles            = (Literal)e.Item.FindControl("ltlRoles");
            var ltlEdit             = (Literal)e.Item.FindControl("ltlEdit");
            var hlChangePassword    = (HyperLink)e.Item.FindControl("hlChangePassword");
            var ltlRole             = (Literal)e.Item.FindControl("ltlRole");
            var ltlSelect           = (Literal)e.Item.FindControl("ltlSelect");

            ltlUserName.Text    = GetUserNameHtml(userName, countOfFailedLogin, isLockedOut, lastActivityDate);
            ltlDisplayName.Text = displayName;
            ltlMobile.Text      = mobile;
            ltlDepartment.Text  = DepartmentManager.GetDepartmentName(departmentId);
            ltlArea.Text        = AreaManager.GetAreaName(areaId);

            ltlLastActivityDate.Text = GetDateTime(lastActivityDate);
            ltlCountOfLogin.Text     = countOfLogin.ToString();
            ltlRoles.Text            = AdminManager.GetRolesHtml(userName);

            var urlEdit = PageAdministratorAdd.GetRedirectUrlToEdit(departmentId, userName);

            ltlEdit.Text = $@"<a href=""{urlEdit}"">修改属性</a>";
            hlChangePassword.Attributes.Add("onclick", ModalAdminPassword.GetOpenWindowString(userName));

            if (AuthRequest.AdminName != userName)
            {
                var openWindowString = ModalPermissionsSet.GetOpenWindowString(userName);
                ltlRole.Text   = $@"<a href=""javascript:;"" onclick=""{openWindowString}"">权限设置</a>";
                ltlSelect.Text = $@"<input type=""checkbox"" name=""UserNameCollection"" value=""{userName}"" />";
            }
        }
Ejemplo n.º 14
0
 public PublishmentSystemInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     PublishmentSystemId   = SqlUtils.EvalInt(dataItem, "PublishmentSystemId");
     PublishmentSystemName = SqlUtils.EvalString(dataItem, "PublishmentSystemName");
 }
Ejemplo n.º 15
0
        internal static string Parse(string stlEntity, PageInfo pageInfo, ContextInfo contextInfo)
        {
            var parsedContent = string.Empty;

            if (contextInfo.ItemContainer == null || contextInfo.ItemContainer.CommentItem == null)
            {
                return(string.Empty);
            }

            try
            {
                var entityName = StlParserUtility.GetNameFromEntity(stlEntity);

                var type = entityName.Substring(9, entityName.Length - 10);

                var commentId = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "ID");
                var goodCount = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "GoodCount");
                var userName  = SqlUtils.EvalString(contextInfo.ItemContainer.CommentItem, "UserName");
                var addDate   = SqlUtils.EvalDateTime(contextInfo.ItemContainer.CommentItem, "AddDate");
                var content   = SqlUtils.EvalString(contextInfo.ItemContainer.CommentItem, "Content");

                if (StringUtils.EqualsIgnoreCase(type, Id))
                {
                    parsedContent = commentId.ToString();
                }
                else if (StringUtils.EqualsIgnoreCase(type, AddDate))
                {
                    parsedContent = DateUtils.Format(addDate, string.Empty);
                }
                else if (StringUtils.EqualsIgnoreCase(type, UserName))
                {
                    parsedContent = string.IsNullOrEmpty(userName) ? "匿名" : userName;
                }
                else if (StringUtils.EqualsIgnoreCase(type, DisplayName))
                {
                    parsedContent = string.IsNullOrEmpty(userName) ? "匿名" : BaiRongDataProvider.UserDao.GetDisplayName(userName);
                }
                else if (StringUtils.EqualsIgnoreCase(type, GoodCount))
                {
                    parsedContent = goodCount.ToString();
                }
                else if (StringUtils.EqualsIgnoreCase(type, Content))
                {
                    parsedContent = content;
                }
                else if (StringUtils.StartsWithIgnoreCase(type, ItemIndex))
                {
                    parsedContent = StlParserUtility.ParseItemIndex(contextInfo.ItemContainer.CommentItem.ItemIndex, type, contextInfo).ToString();
                }
            }
            catch
            {
                // ignored
            }

            return(parsedContent);
        }
Ejemplo n.º 16
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var contentID      = SqlUtils.EvalInt(e.Item.DataItem, "ID");
                var contentInfo    = DataProvider.InputContentDao.GetContentInfo(contentID);
                var columnItemRows = (Literal)e.Item.FindControl("ColumnItemRows");
                var itemEidtRow    = (Literal)e.Item.FindControl("ItemEidtRow");
                var itemViewRow    = (Literal)e.Item.FindControl("ItemViewRow");
                var itemRowReply   = e.Item.FindControl("ItemRowReply") as Literal;
                var itemDateTime   = e.Item.FindControl("ItemDateTime") as Literal;

                if (_styleInfoList != null)
                {
                    foreach (var styleInfo in _styleInfoList)
                    {
                        if (styleInfo.IsVisibleInList)
                        {
                            var value = contentInfo.Attributes.Get(styleInfo.AttributeName);

                            if (!string.IsNullOrEmpty(value))
                            {
                                value = InputParserUtility.GetContentByTableStyle(value, PublishmentSystemInfo, ETableStyle.InputContent, styleInfo);
                            }

                            if (contentInfo.IsChecked == false && string.IsNullOrEmpty(columnItemRows.Text))
                            {
                                columnItemRows.Text += $@"<td>{value}<span style=""color:red"">[未审核]</span></td>";
                            }
                            else
                            {
                                columnItemRows.Text += $@"<td>{value}</td>";
                            }
                        }
                    }
                }

                itemViewRow.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalInputContentView.GetOpenWindowString(
                        PublishmentSystemId, _inputInfo.InputId, contentInfo.Id)}"">查看</a>";
                itemEidtRow.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalInputContentAdd.GetOpenWindowStringToEdit(
                            PublishmentSystemId, _inputInfo.InputId, contentInfo.Id, PageUrl)}"">修改</a>";

                if (_inputInfo.IsReply)
                {
                    var text = string.IsNullOrEmpty(contentInfo.Reply) ? "提交回复" : "修改回复";
                    itemRowReply.Text = $@"
<td class=""center"">{StringUtils.GetTrueImageHtml(!string.IsNullOrEmpty(contentInfo.Reply))}</a></td>
<td class=""center""><a href=""javascript:;"" onclick=""{ModalInputContentReply.GetOpenWindowString(
                        PublishmentSystemId, _inputInfo.InputId, contentInfo.Id)}"">{text}</a></td>";
                }

                itemDateTime.Text = DateUtils.GetDateString(contentInfo.AddDate);
            }
        }
Ejemplo n.º 17
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var seoMetaID   = SqlUtils.EvalInt(e.Item.DataItem, "SeoMetaID");
                var seoMetaName = SqlUtils.EvalString(e.Item.DataItem, "SeoMetaName");
                var pageTitle   = SqlUtils.EvalString(e.Item.DataItem, "PageTitle");
                var isDefault   = TranslateUtils.ToBool(SqlUtils.EvalString(e.Item.DataItem, "IsDefault"));

                var ltlSeoMetaName = e.Item.FindControl("ltlSeoMetaName") as Literal;
                var ltlPageTitle   = e.Item.FindControl("ltlPageTitle") as Literal;
                var ltlIsDefault   = e.Item.FindControl("ltlIsDefault") as Literal;
                var hlViewLink     = e.Item.FindControl("hlViewLink") as HyperLink;
                var hlEditLink     = e.Item.FindControl("hlEditLink") as HyperLink;
                var ltlDefaultUrl  = e.Item.FindControl("ltlDefaultUrl") as Literal;
                var ltlDeleteUrl   = e.Item.FindControl("ltlDeleteUrl") as Literal;

                ltlSeoMetaName.Text = seoMetaName;
                ltlPageTitle.Text   = pageTitle;
                ltlIsDefault.Text   = StringUtils.GetTrueImageHtml(isDefault);
                hlViewLink.Attributes.Add("onclick", ModalSeoMetaView.GetOpenWindowString(PublishmentSystemId, seoMetaID));
                hlEditLink.Attributes.Add("onclick", ModalSeoMetaAdd.GetOpenWindowStringToEdit(PublishmentSystemId, seoMetaID));
                if (!isDefault)
                {
                    var urlDefault = PageUtils.GetCmsUrl(nameof(PageSeoMetaList), new NameValueCollection
                    {
                        { "PublishmentSystemID", PublishmentSystemId.ToString() },
                        { "SeoMetaID", seoMetaID.ToString() },
                        { "SetDefault", true.ToString() }
                    });
                    ltlDefaultUrl.Text =
                        $@"<a href=""{urlDefault}"" onClick=""javascript:return confirm('此操作将把此项设为默认,确认吗?');"">设为默认</a>";
                }
                else
                {
                    var urlDefault = PageUtils.GetCmsUrl(nameof(PageSeoMetaList), new NameValueCollection
                    {
                        { "PublishmentSystemID", PublishmentSystemId.ToString() },
                        { "SeoMetaID", seoMetaID.ToString() },
                        { "SetDefault", false.ToString() }
                    });
                    ltlDefaultUrl.Text =
                        $@"<a href=""{urlDefault}"" onClick=""javascript:return confirm('此操作将取消默认,确认吗?');"">取消默认</a>";
                }

                var urlDelete = PageUtils.GetCmsUrl(nameof(PageSeoMetaList), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "SeoMetaID", seoMetaID.ToString() },
                    { "Delete", true.ToString() }
                });
                ltlDeleteUrl.Text =
                    $@"<a href=""{urlDelete}"" onClick=""javascript:return confirm('此操作将删除页面元数据“{seoMetaName}”,确认吗?');"">删除</a>";
            }
        }
Ejemplo n.º 18
0
        private void TemplateControl_DataBinding(object sender, EventArgs e)
        {
            var literal   = (Literal)sender;
            var container = (RepeaterItem)literal.NamingContainer;

            var itemInfo = new DbItemInfo(container.DataItem, container.ItemIndex);

            if (_contextType == EContextType.Channel)
            {
                var channelItemInfo = new ChannelItemInfo(SqlUtils.EvalInt(container.DataItem, ChannelAttribute.Id), container.ItemIndex);
                _pageInfo.ChannelItems.Push(channelItemInfo);
                literal.Text = TemplateUtility.GetChannelsItemTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Content)
            {
                var contentItemInfo = new ContentItemInfo(SqlUtils.EvalInt(container.DataItem, ContentAttribute.ChannelId), SqlUtils.EvalInt(container.DataItem, ContentAttribute.Id), container.ItemIndex);
                _pageInfo.ContentItems.Push(contentItemInfo);
                literal.Text = TemplateUtility.GetContentsItemTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Comment)
            {
                _pageInfo.CommentItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetCommentsTemplateString(_templateString, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            //else if (_contextType == EContextType.InputContent)
            //{
            //    _pageInfo.InputItems.Push(itemInfo);
            //    literal.Text = TemplateUtility.GetInputContentsTemplateString(_templateString, container.ClientID, _pageInfo, _contextType, _contextInfo);
            //}
            else if (_contextType == EContextType.SqlContent)
            {
                _pageInfo.SqlItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetSqlContentsTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Site)
            {
                _pageInfo.SiteItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetSitesTemplateString(_templateString, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }
            else if (_contextType == EContextType.Each)
            {
                _pageInfo.EachItems.Push(itemInfo);
                literal.Text = TemplateUtility.GetEachsTemplateString(_templateString, _selectedItems, _selectedValues, container.ClientID, _pageInfo, _contextType, _contextInfo);
            }

            if (_separatorRepeat > 1)
            {
                _i++;
                if (_i % _separatorRepeat == 0)
                {
                    literal.Text += _separatorRepeatTemplate;
                }
            }
        }
Ejemplo n.º 19
0
 public StudyRecord(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     Id            = SqlUtils.EvalInt(dataItem, "ID");
     UserName      = SqlUtils.EvalString(dataItem, "UserName");
     StudyState    = SqlUtils.EvalInt(dataItem, "StudyState");
     LastStudyTime = SqlUtils.EvalString(dataItem, "LastStudyTime");
 }
Ejemplo n.º 20
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var contentID   = SqlUtils.EvalInt(e.Item.DataItem, "ID");
                var contentInfo = DataProvider.ResumeContentDao.GetContentInfo(contentID);

                var ltlTr             = e.Item.FindControl("ltlTr") as Literal;
                var ltlRealName       = e.Item.FindControl("ltlRealName") as Literal;
                var ltlGender         = e.Item.FindControl("ltlGender") as Literal;
                var ltlMobilePhone    = e.Item.FindControl("ltlMobilePhone") as Literal;
                var ltlEmail          = e.Item.FindControl("ltlEmail") as Literal;
                var ltlEducation      = e.Item.FindControl("ltlEducation") as Literal;
                var ltlJobTitle       = e.Item.FindControl("ltlJobTitle") as Literal;
                var ltlLastSchoolName = e.Item.FindControl("ltlLastSchoolName") as Literal;
                var ltlAddDate        = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlViewUrl        = e.Item.FindControl("ltlViewUrl") as Literal;

                ltlTr.Text = $@"<tr style=""height:25px;font-weight:{(contentInfo.IsView ? "normal" : "bold")}"">";

                ltlRealName.Text = contentInfo.GetExtendedAttribute(ResumeContentAttribute.RealName);
                if (!string.IsNullOrEmpty(contentInfo.GetExtendedAttribute(ResumeContentAttribute.ImageUrl)))
                {
                    var imageUrl = PageUtility.ParseNavigationUrl(PublishmentSystemInfo,
                                                                  contentInfo.GetExtendedAttribute(ResumeContentAttribute.ImageUrl));
                    ltlRealName.Text +=
                        $@"&nbsp;<a id=""preview_{contentID}"" href=""{imageUrl}"">预览相片</a>
<script type=""text/javascript"">
$(document).ready(function() {{
	$(""#preview_{contentID}"").fancybox();
}});
</script>";
                }
                ltlGender.Text      = contentInfo.GetExtendedAttribute(ResumeContentAttribute.Gender);
                ltlMobilePhone.Text = contentInfo.GetExtendedAttribute(ResumeContentAttribute.MobilePhone);
                ltlEmail.Text       = contentInfo.GetExtendedAttribute(ResumeContentAttribute.Email);
                ltlEducation.Text   = contentInfo.GetExtendedAttribute(ResumeContentAttribute.Education);
                if (contentInfo.JobContentId > 0)
                {
                    var title = _hashtable[contentInfo.JobContentId] as string;
                    if (title == null)
                    {
                        title = BaiRongDataProvider.ContentDao.GetValue(PublishmentSystemInfo.AuxiliaryTableForJob, contentInfo.JobContentId, ContentAttribute.Title);
                        _hashtable[contentInfo.JobContentId] = title;
                    }
                    ltlJobTitle.Text = title;
                }
                ltlLastSchoolName.Text = contentInfo.GetExtendedAttribute(ResumeContentAttribute.LastSchoolName);
                ltlAddDate.Text        = DateUtils.GetDateString(contentInfo.AddDate);

                ltlViewUrl.Text =
                    $@"<a href=""{PageResumeView.GetRedirectUrl(PublishmentSystemId, contentID)}"" target=""_blank"" onclick=""this.parentNode.parentNode.style.fontWeight='normal';"">查看</a>";
            }
        }
Ejemplo n.º 21
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var userName     = SqlUtils.EvalString(e.Item.DataItem, "UserName");
                var displayName  = SqlUtils.EvalString(e.Item.DataItem, "DisplayName");
                var mobile       = SqlUtils.EvalString(e.Item.DataItem, "Mobile");
                var departmentId = SqlUtils.EvalInt(e.Item.DataItem, "DepartmentID");
                var areaId       = SqlUtils.EvalInt(e.Item.DataItem, "AreaID");
                if (string.IsNullOrEmpty(displayName))
                {
                    displayName = userName;
                }
                var departmentName = string.Empty;
                if (_departmentInfo != null)
                {
                    departmentName = _departmentInfo.DepartmentName;
                }
                else if (departmentId > 0)
                {
                    departmentName = DepartmentManager.GetDepartmentName(departmentId);
                }
                var countOfFailedLogin = SqlUtils.EvalInt(e.Item.DataItem, "CountOfFailedLogin");
                var isLockedOut        = SqlUtils.EvalBool(e.Item.DataItem, "IsLockedOut");
                var lastActivityDate   = SqlUtils.EvalDateTime(e.Item.DataItem, "LastActivityDate");

                var ltlUserName      = (Literal)e.Item.FindControl("ltlUserName");
                var ltlDisplayName   = (Literal)e.Item.FindControl("ltlDisplayName");
                var ltlMobile        = (Literal)e.Item.FindControl("ltlMobile");
                var ltlDepartment    = (Literal)e.Item.FindControl("ltlDepartment");
                var ltlArea          = (Literal)e.Item.FindControl("ltlArea");
                var ltlEdit          = (Literal)e.Item.FindControl("ltlEdit");
                var hlChangePassword = (HyperLink)e.Item.FindControl("hlChangePassword");
                var ltlRole          = (Literal)e.Item.FindControl("ltlRole");
                var ltlSelect        = (Literal)e.Item.FindControl("ltlSelect");

                ltlUserName.Text    = GetUserNameHtml(userName, countOfFailedLogin, isLockedOut, lastActivityDate);
                ltlDisplayName.Text = displayName;
                ltlMobile.Text      = mobile;
                ltlDepartment.Text  = departmentName;
                ltlArea.Text        = AreaManager.GetAreaName(areaId);

                var urlEdit = PageAdministratorAdd.GetRedirectUrlToEdit(departmentId, userName);
                ltlEdit.Text = $@"<a href=""{urlEdit}"">修改属性</a>";
                hlChangePassword.Attributes.Add("onclick", ModalAdminPassword.GetOpenWindowString(userName));

                if (Body.AdministratorName != userName)
                {
                    var openWindowString = ModalPermissionsSet.GetOpenWindowString(userName);
                    ltlRole.Text   = $@"<a href=""javascript:;"" onclick=""{openWindowString}"">权限设置</a>";
                    ltlSelect.Text = $@"<input type=""checkbox"" name=""UserNameCollection"" value=""{userName}"" />";
                }
            }
        }
Ejemplo n.º 22
0
        private static string ParseImpl(XmlNode node, PageInfo pageInfo, ContextInfo contextInfo, StringDictionary attributes, string leftText, string rightText, string formatString, string separator, int startIndex, int length, int wordNum, string ellipsis, string replace, string to, bool isClearTags, bool isReturnToBr, bool isLower, bool isUpper, string type)
        {
            var parsedContent = string.Empty;

            if (InputContentAttribute.Id.ToLower().Equals(type))
            {
                parsedContent = SqlUtils.EvalString(contextInfo.ItemContainer.InputItem.DataItem, InputContentAttribute.Id);
            }
            else if (InputContentAttribute.AddDate.ToLower().Equals(type))
            {
                var addDate = SqlUtils.EvalDateTime(contextInfo.ItemContainer.InputItem.DataItem, InputContentAttribute.AddDate);
                parsedContent = DateUtils.Format(addDate, formatString);
            }
            else if (InputContentAttribute.UserName.ToLower().Equals(type))
            {
                parsedContent = SqlUtils.EvalString(contextInfo.ItemContainer.InputItem.DataItem, InputContentAttribute.UserName);
            }
            else if (InputContentAttribute.Reply.ToLower().Equals(type))
            {
                var content = SqlUtils.EvalString(contextInfo.ItemContainer.InputItem.DataItem, InputContentAttribute.Reply);
                parsedContent = content;
                parsedContent = StringUtils.ParseString(EInputType.TextEditor, parsedContent, replace, to, startIndex, length, wordNum, ellipsis, isClearTags, isReturnToBr, isLower, isUpper, formatString);
            }
            else if (StringUtils.StartsWithIgnoreCase(type, StlParserUtility.ItemIndex))
            {
                parsedContent = StlParserUtility.ParseItemIndex(contextInfo.ItemContainer.InputItem.ItemIndex, type, contextInfo).ToString();
            }
            else
            {
                var id = SqlUtils.EvalInt(contextInfo.ItemContainer.InputItem.DataItem, InputContentAttribute.Id);
                var inputContentInfo = DataProvider.InputContentDao.GetContentInfo(id);
                if (inputContentInfo != null)
                {
                    parsedContent = inputContentInfo.GetExtendedAttribute(type);
                    if (!string.IsNullOrEmpty(parsedContent))
                    {
                        if (!InputContentAttribute.HiddenAttributes.Contains(type.ToLower()))
                        {
                            var styleInfo = TableStyleManager.GetTableStyleInfo(ETableStyle.InputContent, DataProvider.InputContentDao.TableName, type, RelatedIdentities.GetRelatedIdentities(ETableStyle.InputContent, pageInfo.PublishmentSystemId, inputContentInfo.InputId));
                            parsedContent = InputParserUtility.GetContentByTableStyle(parsedContent, separator, pageInfo.PublishmentSystemInfo, ETableStyle.InputContent, styleInfo, formatString, attributes, node.InnerXml, false);
                            parsedContent = StringUtils.ParseString(EInputTypeUtils.GetEnumType(styleInfo.InputType), parsedContent, replace, to, startIndex, length, wordNum, ellipsis, isClearTags, isReturnToBr, isLower, isUpper, formatString);
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(parsedContent))
            {
                parsedContent = leftText + parsedContent + rightText;
            }

            return(parsedContent);
        }
Ejemplo n.º 23
0
 public CommentInfo(object dataItem)
 {
     Id = SqlUtils.EvalInt(dataItem, "ID");
     PublishmentSystemId = SqlUtils.EvalInt(dataItem, "PublishmentSystemID");
     NodeId    = SqlUtils.EvalInt(dataItem, "NodeID");
     ContentId = SqlUtils.EvalInt(dataItem, "ContentID");
     GoodCount = SqlUtils.EvalInt(dataItem, "GoodCount");
     UserName  = SqlUtils.EvalString(dataItem, "UserName");
     IsChecked = SqlUtils.EvalBool(dataItem, "IsChecked");
     AddDate   = SqlUtils.EvalDateTime(dataItem, "AddDate");
     Content   = SqlUtils.EvalString(dataItem, "Content");
 }
Ejemplo n.º 24
0
        internal static string Parse(string stlEntity, PageInfo pageInfo, ContextInfo contextInfo)
        {
            var parsedContent = string.Empty;

            if (contextInfo.ItemContainer == null || contextInfo.ItemContainer.CommentItem == null)
            {
                return(string.Empty);
            }

            try
            {
                var entityName = StlParserUtility.GetNameFromEntity(stlEntity);

                var type = entityName.Substring(9, entityName.Length - 10).ToLower();

                var commentID = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "ID");
                var nodeID    = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "NodeID");
                var contentID = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "ContentID");
                var goodCount = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "GoodCount");
                var userName  = SqlUtils.EvalString(contextInfo.ItemContainer.CommentItem, "UserName");
                var isChecked = TranslateUtils.ToBool(SqlUtils.EvalString(contextInfo.ItemContainer.CommentItem, "IsChecked"));
                var addDate   = SqlUtils.EvalDateTime(contextInfo.ItemContainer.CommentItem, "AddDate");
                var content   = SqlUtils.EvalString(contextInfo.ItemContainer.CommentItem, "Content");

                if (type == "id")
                {
                    parsedContent = commentID.ToString();
                }
                else if (type == "adddate")
                {
                    parsedContent = DateUtils.Format(addDate, string.Empty);
                }
                else if (type == "username")
                {
                    parsedContent = string.IsNullOrEmpty(userName) ? "匿名" : userName;
                }
                else if (type == "goodcount")
                {
                    parsedContent = goodCount.ToString();
                }
                else if (type == "content")
                {
                    parsedContent = content;
                }
                else if (StringUtils.StartsWithIgnoreCase(type, StlParserUtility.ItemIndex))
                {
                    parsedContent = StlParserUtility.ParseItemIndex(contextInfo.ItemContainer.CommentItem.ItemIndex, type, contextInfo).ToString();
                }
            }
            catch { }

            return(parsedContent);
        }
Ejemplo n.º 25
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordId   = SqlUtils.EvalInt(e.Item.DataItem, "KeywordId");
                var keyword     = SqlUtils.EvalString(e.Item.DataItem, "Keyword");
                var keywordType = EKeywordTypeUtils.GetEnumType(SqlUtils.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}');;window.parent.closeWindow();""><strong style=""color: #468847"">{keyword}</strong>&nbsp;({EKeywordTypeUtils.GetText(keywordType)})</div>";
            }
        }
Ejemplo n.º 26
0
 public OrganizationReachInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     ID = SqlUtils.EvalInt(dataItem, "ID");
     AdministratorAccount  = SqlUtils.EvalString(dataItem, "AdministratorAccount");
     TelePhone             = SqlUtils.EvalString(dataItem, "TelePhone");
     OrganizatioinName     = SqlUtils.EvalString(dataItem, "OrganizationName");
     ReachOrganizationName = SqlUtils.EvalString(dataItem, "ReachOrganizationName");
     ReachTime             = SqlUtils.EvalDateTime(dataItem, "ReachTime");
     ActivitiesCount       = SqlUtils.EvalInt(dataItem, "ActivitiesCount");
 }
Ejemplo n.º 27
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var inputID   = SqlUtils.EvalInt(e.Item.DataItem, "InputID");
                var inputName = SqlUtils.EvalString(e.Item.DataItem, "InputName");

                var LtlTitle   = (Literal)e.Item.FindControl("LtlTitle");
                var upLink     = (Literal)e.Item.FindControl("UpLink");
                var downLink   = (Literal)e.Item.FindControl("DownLink");
                var styleUrl   = (Literal)e.Item.FindControl("StyleUrl");
                var previewUrl = (Literal)e.Item.FindControl("PreviewUrl");
                var editUrl    = (Literal)e.Item.FindControl("EditUrl");
                var exportUrl  = (Literal)e.Item.FindControl("ExportUrl");

                LtlTitle.Text = $@"<a href=""{PageInputContent.GetRedirectUrl(PublishmentSystemId, inputName)}"">{inputName}</a>";

                var urlUp = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "InputID", inputID.ToString() },
                    { "Up", true.ToString() }
                });
                upLink.Text = $@"<a href=""{urlUp}""><img src=""../Pic/icon/up.gif"" border=""0"" alt=""上升"" /></a>";

                var urlDown = PageUtils.GetCmsUrl(nameof(PageInput), new NameValueCollection
                {
                    { "PublishmentSystemID", PublishmentSystemId.ToString() },
                    { "InputID", inputID.ToString() },
                    { "Down", true.ToString() }
                });
                downLink.Text =
                    $@"<a href=""{urlDown}""><img src=""../Pic/icon/down.gif"" border=""0"" alt=""下降"" /></a>";

                styleUrl.Text =
                    $@"<a href=""{PageTableStyle.GetRedirectUrl(PublishmentSystemId, ETableStyle.InputContent,
                        DataProvider.InputContentDao.TableName, inputID)}"">表单字段</a>";

                previewUrl.Text = $@"<a href=""{PageInputPreview.GetRedirectUrl(PublishmentSystemId, inputID, string.Empty)}"">预览</a>";

                editUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalInputAdd.GetOpenWindowStringToEdit(
                        PublishmentSystemId, inputID, false)}"">编辑</a>";

                exportUrl.Text =
                    $@"<a href=""javascript:;"" onclick=""{ModalExportMessage.GetOpenWindowStringToInput(
                        PublishmentSystemId, inputID)}"">导出</a>";
            }
        }
Ejemplo n.º 28
0
        private void rpContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var publishmentSystemId      = SqlUtils.EvalInt(e.Item.DataItem, "PublishmentSystemID");
            var publishmentSystemInfo    = PublishmentSystemManager.GetPublishmentSystemInfo(publishmentSystemId);
            var ltlPublishmentSystemName = (Literal)e.Item.FindControl("ltlPublishmentSystemName");
            var ltlDownloadNum           = (Literal)e.Item.FindControl("ltlDownloadNum");

            ltlPublishmentSystemName.Text = publishmentSystemInfo.PublishmentSystemName + "&nbsp;" + EPublishmentSystemTypeUtils.GetIconHtml(publishmentSystemInfo.PublishmentSystemType);
            ltlDownloadNum.Text           = GetYHashtable(publishmentSystemId);
        }
Ejemplo n.º 29
0
 public PersonalReachInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     ID                    = SqlUtils.EvalInt(dataItem, "ID");
     UserName              = SqlUtils.EvalString(dataItem, "UserName");
     Mobile                = SqlUtils.EvalString(dataItem, "Mobile");
     OrganizatioinName     = SqlUtils.EvalString(dataItem, "OrganizatioinName");
     ReachOrganizationName = SqlUtils.EvalString(dataItem, "ReachOrganizationName");
     ReachTime             = SqlUtils.EvalDateTime(dataItem, "ReachTime");
     ActivitiesCount       = SqlUtils.EvalInt(dataItem, "ActivitiesCount");
     Integral              = SqlUtils.EvalInt(dataItem, "Integral");
 }
Ejemplo n.º 30
0
        void rptParentContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var id            = SqlUtils.EvalInt(e.Item.DataItem, "ID");
                var albumId       = SqlUtils.EvalInt(e.Item.DataItem, "AlbumID");
                var parentId      = SqlUtils.EvalInt(e.Item.DataItem, "ParentID");
                var title         = SqlUtils.EvalString(e.Item.DataItem, "Title");
                var imageUrl      = SqlUtils.EvalString(e.Item.DataItem, "ImageUrl");
                var largeImageUrl = SqlUtils.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>";
            }
        }