Exemplo n.º 1
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}"" />";
            }
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
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);
            }
        }
Exemplo n.º 4
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 />";
            }
        }
Exemplo n.º 5
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;
            }
        }
Exemplo n.º 6
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlPublishmentSystem = (Literal)e.Item.FindControl("ltlPublishmentSystem");
                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 (PublishmentSystemId == 0)
                {
                    var publishmentSystemInfo = PublishmentSystemManager.GetPublishmentSystemInfo(SqlUtils.EvalInt(e.Item.DataItem, "PublishmentSystemID"));
                    var publishmentSystemName = string.Empty;
                    if (publishmentSystemInfo != null)
                    {
                        publishmentSystemName =
                            $"<a href='{publishmentSystemInfo.PublishmentSystemUrl}' target='_blank'>{publishmentSystemInfo.PublishmentSystemName}</a>";
                    }
                    ltlPublishmentSystem.Text = $@"<td align=""center"" width=""160"">{publishmentSystemName}</td>";
                }
                ltlUserName.Text  = SqlUtils.EvalString(e.Item.DataItem, "UserName");
                ltlAddDate.Text   = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate"));
                ltlIPAddress.Text = SqlUtils.EvalString(e.Item.DataItem, "IPAddress");
                ltlAction.Text    = SqlUtils.EvalString(e.Item.DataItem, "Action");
                ltlSummary.Text   = SqlUtils.EvalString(e.Item.DataItem, "Summary");
            }
        }
Exemplo n.º 7
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;
                }
            }
        }
Exemplo n.º 8
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}"" />";
            }
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
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}"" />";
                }
            }
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
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");
 }
Exemplo n.º 13
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);
        }
Exemplo n.º 14
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");
 }
Exemplo n.º 15
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");
 }
Exemplo n.º 16
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                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");

                ltlAddDate.Text    = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate"));
                ltlMessage.Text    = SqlUtils.EvalString(e.Item.DataItem, "Message");
                ltlStacktrace.Text = SqlUtils.EvalString(e.Item.DataItem, "Stacktrace");
                ltlSummary.Text    = SqlUtils.EvalString(e.Item.DataItem, "Summary");
            }
        }
Exemplo n.º 17
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                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");

                ltlUserName.Text  = SqlUtils.EvalString(e.Item.DataItem, "UserName");
                ltlAddDate.Text   = SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate").ToString();
                ltlIPAddress.Text = SqlUtils.EvalString(e.Item.DataItem, "IPAddress");
                ltlAction.Text    = SqlUtils.EvalString(e.Item.DataItem, "Action");
                ltlSummary.Text   = SqlUtils.EvalString(e.Item.DataItem, "Summary");
            }
        }
Exemplo n.º 18
0
        private static string ParseImpl(ContextInfo contextInfo, string leftText, string rightText, string formatString, 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;

            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, TypeId))
            {
                parsedContent = commentId.ToString();
            }
            else if (StringUtils.EqualsIgnoreCase(type, TypeAddDate))
            {
                parsedContent = DateUtils.Format(addDate, formatString);
            }
            else if (StringUtils.EqualsIgnoreCase(type, TypeUserName))
            {
                parsedContent = string.IsNullOrEmpty(userName) ? "匿名" : userName;
            }
            else if (StringUtils.EqualsIgnoreCase(type, TypeDisplayName))
            {
                parsedContent = string.IsNullOrEmpty(userName) ? "匿名" : BaiRongDataProvider.UserDao.GetDisplayName(userName);
            }
            else if (StringUtils.EqualsIgnoreCase(type, TypeGoodCount))
            {
                parsedContent = $"<span id='commentsDigg_{commentId}_{true}'>{goodCount}</span>";
            }
            else if (StringUtils.EqualsIgnoreCase(type, TypeContent))
            {
                parsedContent = StringUtils.ParseString(content, replace, to, startIndex, length, wordNum, ellipsis, isClearTags, isReturnToBr, isLower, isUpper, formatString);
            }
            else if (StringUtils.StartsWithIgnoreCase(type, StlParserUtility.ItemIndex))
            {
                parsedContent = StlParserUtility.ParseItemIndex(contextInfo.ItemContainer.CommentItem.ItemIndex, type, contextInfo).ToString();
            }

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

            return(parsedContent);
        }
Exemplo n.º 19
0
        private static void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var ltlText    = (Literal)e.Item.FindControl("ltlText");
            var ltlSummary = (Literal)e.Item.FindControl("ltlSummary");
            var ltlSource  = (Literal)e.Item.FindControl("ltlSource");
            var ltlAddDate = (Literal)e.Item.FindControl("ltlAddDate");

            ltlText.Text    = SqlUtils.EvalString(e.Item.DataItem, "Text");
            ltlSummary.Text = SqlUtils.EvalString(e.Item.DataItem, "Summary");
            ltlSource.Text  = SqlUtils.EvalString(e.Item.DataItem, "Source");
            ltlAddDate.Text = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate"), EDateFormatType.Day, ETimeFormatType.LongTime);
        }
Exemplo n.º 20
0
        private static string ParseImpl(ContextInfo contextInfo, string leftText, string rightText, string formatString, 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;

            var commentId = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, "ID");
            //var nodeId = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, CommentAttribute.NodeId);
            //var contentId = SqlUtils.EvalInt(contextInfo.ItemContainer.CommentItem, CommentAttribute.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, CommentAttribute.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, formatString);
            }
            else if (type == "username")
            {
                parsedContent = string.IsNullOrEmpty(userName) ? "匿名" : userName;
            }
            else if (type == "goodcount")
            {
                parsedContent = $"<span id='commentsDigg_{commentId}_{true}'>{goodCount}</span>";
            }
            else if (type == "content")
            {
                parsedContent = StringUtils.ParseString(content, replace, to, startIndex, length, wordNum, ellipsis, isClearTags, isReturnToBr, isLower, isUpper, formatString);
            }
            else if (StringUtils.StartsWithIgnoreCase(type, StlParserUtility.ItemIndex))
            {
                parsedContent = StlParserUtility.ParseItemIndex(contextInfo.ItemContainer.CommentItem.ItemIndex, type, contextInfo).ToString();
            }

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

            return(parsedContent);
        }
Exemplo n.º 21
0
 public PageContentPushInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     ContentId             = SqlUtils.EvalInt(dataItem, "ContentId");
     NodeId                = SqlUtils.EvalInt(dataItem, "NodeId");
     ContentType           = SqlUtils.EvalString(dataItem, "ContentType");
     PushType              = SqlUtils.EvalString(dataItem, "ContentType");
     PushInOrganizationId  = SqlUtils.EvalInt(dataItem, "PushInOrganizationId");;
     PushOutOrganizationId = SqlUtils.EvalInt(dataItem, "PushOutOrganizationId");;
     PushOutCheck          = SqlUtils.EvalString(dataItem, "PushOutCheck");
     PushInCheck           = SqlUtils.EvalString(dataItem, "PushInCheck");
     PushDate              = SqlUtils.EvalDateTime(dataItem, "PushDate");
     PushOutCheckTime      = SqlUtils.EvalDateTime(dataItem, "PushOutCheckTime");
     PushInCheckTime       = SqlUtils.EvalDateTime(dataItem, "PushInCheckTime");
     CheckState            = SqlUtils.EvalString(dataItem, "CheckState");
 }
Exemplo n.º 22
0
        private static void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            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");

            ltlUserName.Text  = SqlUtils.EvalString(e.Item.DataItem, nameof(LogInfo.UserName));
            ltlAddDate.Text   = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, nameof(LogInfo.AddDate)));
            ltlIpAddress.Text = SqlUtils.EvalString(e.Item.DataItem, nameof(LogInfo.IpAddress));
            ltlAction.Text    = SqlUtils.EvalString(e.Item.DataItem, nameof(LogInfo.Action));
            ltlSummary.Text   = SqlUtils.EvalString(e.Item.DataItem, nameof(LogInfo.Summary));
        }
Exemplo n.º 23
0
        void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlIndex         = (Literal)e.Item.FindControl("ltlIndex");
                var ltlAddUserName   = (Literal)e.Item.FindControl("ltlAddUserName");
                var ltlAddDate       = (Literal)e.Item.FindControl("ltlAddDate");
                var ltlContentLength = (Literal)e.Item.FindControl("ltlContentLength");
                var ltlView          = (Literal)e.Item.FindControl("ltlView");

                var logID = SqlUtils.EvalInt(e.Item.DataItem, "ID");

                ltlIndex.Text         = Convert.ToString(e.Item.ItemIndex + 1);
                ltlAddUserName.Text   = SqlUtils.EvalString(e.Item.DataItem, "AddUserName");
                ltlAddDate.Text       = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, "AddDate"));
                ltlContentLength.Text = SqlUtils.EvalInt(e.Item.DataItem, "ContentLength").ToString();
                ltlView.Text          =
                    $@"<a href=""javascript:;"" onclick=""{ModalTemplateView.GetOpenLayerString(PublishmentSystemId,
                        logID)}"">查看</a>";
            }
        }
Exemplo n.º 24
0
 public PartyTransCheckInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     ID                  = SqlUtils.EvalInt(dataItem, "ID");
     ApplyUserId         = SqlUtils.EvalInt(dataItem, "ApplyUserId");
     UserName            = SqlUtils.EvalString(dataItem, "UserName");
     MobilePhone         = SqlUtils.EvalString(dataItem, "MobilePhone");
     TransformOutId      = SqlUtils.EvalInt(dataItem, "TransformOutId");
     TransformOutName    = SqlUtils.EvalString(dataItem, "TransformOutName");
     TransformInId       = SqlUtils.EvalInt(dataItem, "TransformInId");
     TransformInName     = SqlUtils.EvalString(dataItem, "TransformInName");
     ReachOrganizationId = SqlUtils.EvalInt(dataItem, "ReachOrganizationId");
     ApplyDate           = SqlUtils.EvalDateTime(dataItem, "ApplyDate");
     OutCheckState       = SqlUtils.EvalInt(dataItem, "OutCheckState");
     InCheckState        = SqlUtils.EvalInt(dataItem, "InCheckState");
     InCheckDate         = SqlUtils.EvalDateTime(dataItem, "InCheckDate");
     OutCheckStateString = OutCheckState == 0 ? "δÉóºË" : (OutCheckState == 1 ? "ÉóºËͨ¹ý" : "ÉóºËδͨ¹ý");
     InCheckStateString  = InCheckState == 0 ? "δÉóºË" : (InCheckState == 1 ? "ÉóºËͨ¹ý" : "ÉóºËδͨ¹ý");
 }
Exemplo n.º 25
0
 public UserInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     UserId                = SqlUtils.EvalInt(dataItem, "UserID");
     UserName              = SqlUtils.EvalString(dataItem, "UserName");
     Password              = SqlUtils.EvalString(dataItem, "Password");
     PasswordFormat        = SqlUtils.EvalString(dataItem, "PasswordFormat");
     PasswordSalt          = SqlUtils.EvalString(dataItem, "PasswordSalt");
     GroupId               = SqlUtils.EvalInt(dataItem, "GroupID");
     CreateDate            = SqlUtils.EvalDateTime(dataItem, "CreateDate");
     LastResetPasswordDate = SqlUtils.EvalDateTime(dataItem, "LastResetPasswordDate");
     LastActivityDate      = SqlUtils.EvalDateTime(dataItem, "LastActivityDate");
     CountOfLogin          = SqlUtils.EvalInt(dataItem, "CountOfLogin");
     CountOfFailedLogin    = SqlUtils.EvalInt(dataItem, "CountOfFailedLogin");
     CountOfWriting        = SqlUtils.EvalInt(dataItem, "CountOfWriting");
     IsChecked             = SqlUtils.EvalBool(dataItem, "IsChecked");
     IsLockedOut           = SqlUtils.EvalBool(dataItem, "IsLockedOut");
     DisplayName           = SqlUtils.EvalString(dataItem, "DisplayName");
     Email        = SqlUtils.EvalString(dataItem, "Email");
     Mobile       = SqlUtils.EvalString(dataItem, "Mobile");
     AvatarUrl    = SqlUtils.EvalString(dataItem, "AvatarUrl");
     Organization = SqlUtils.EvalString(dataItem, "Organization");
     Department   = SqlUtils.EvalString(dataItem, "Department");
     Position     = SqlUtils.EvalString(dataItem, "Position");
     Gender       = SqlUtils.EvalString(dataItem, "Gender");
     Birthday     = SqlUtils.EvalString(dataItem, "Birthday");
     Education    = SqlUtils.EvalString(dataItem, "Education");
     Graduation   = SqlUtils.EvalString(dataItem, "Graduation");
     Address      = SqlUtils.EvalString(dataItem, "Address");
     WeiXin       = SqlUtils.EvalString(dataItem, "WeiXin");
     Qq           = SqlUtils.EvalString(dataItem, "QQ");
     WeiBo        = SqlUtils.EvalString(dataItem, "WeiBo");
     Interests    = SqlUtils.EvalString(dataItem, "Interests");
     Signature    = SqlUtils.EvalString(dataItem, "Signature");
 }
Exemplo n.º 26
0
        private void RptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            var ltlIndex         = (Literal)e.Item.FindControl("ltlIndex");
            var ltlAddUserName   = (Literal)e.Item.FindControl("ltlAddUserName");
            var ltlAddDate       = (Literal)e.Item.FindControl("ltlAddDate");
            var ltlContentLength = (Literal)e.Item.FindControl("ltlContentLength");
            var ltlView          = (Literal)e.Item.FindControl("ltlView");

            var logId = SqlUtils.EvalInt(e.Item.DataItem, nameof(TemplateLogInfo.Id));

            ltlIndex.Text         = Convert.ToString(e.Item.ItemIndex + 1);
            ltlAddUserName.Text   = SqlUtils.EvalString(e.Item.DataItem, nameof(TemplateLogInfo.AddUserName));
            ltlAddDate.Text       = DateUtils.GetDateAndTimeString(SqlUtils.EvalDateTime(e.Item.DataItem, nameof(TemplateLogInfo.AddDate)));
            ltlContentLength.Text = SqlUtils.EvalInt(e.Item.DataItem, nameof(TemplateLogInfo.ContentLength)).ToString();
            ltlView.Text          =
                $@"<a href=""javascript:;"" onclick=""{ModalTemplateView.GetOpenWindowString(SiteId,
                    logId)}"">查看</a>";
        }
Exemplo n.º 27
0
        void rptLogs_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var ltlDepartment = e.Item.FindControl("ltlDepartment") as Literal;
                var ltlUserName   = e.Item.FindControl("ltlUserName") as Literal;
                var ltlAddDate    = e.Item.FindControl("ltlAddDate") as Literal;
                var ltlSummary    = e.Item.FindControl("ltlSummary") 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 summary      = SqlUtils.EvalString(e.Item.DataItem, "Summary");

                if (departmentID > 0)
                {
                    ltlDepartment.Text = DepartmentManager.GetDepartmentName(departmentID);
                }
                ltlUserName.Text = userName;
                ltlAddDate.Text  = DateUtils.GetDateAndTimeString(addDate);
                ltlSummary.Text  = summary;
            }
        }
Exemplo n.º 28
0
 public UserInfo(object dataItem)
 {
     if (dataItem == null)
     {
         return;
     }
     Id                    = SqlUtils.EvalInt(dataItem, nameof(Id));
     UserName              = SqlUtils.EvalString(dataItem, nameof(UserName));
     Password              = SqlUtils.EvalString(dataItem, nameof(Password));
     PasswordFormat        = SqlUtils.EvalString(dataItem, nameof(PasswordFormat));
     PasswordSalt          = SqlUtils.EvalString(dataItem, nameof(PasswordSalt));
     CreateDate            = SqlUtils.EvalDateTime(dataItem, nameof(CreateDate));
     LastResetPasswordDate = SqlUtils.EvalDateTime(dataItem, nameof(LastResetPasswordDate));
     LastActivityDate      = SqlUtils.EvalDateTime(dataItem, nameof(LastActivityDate));
     CountOfLogin          = SqlUtils.EvalInt(dataItem, nameof(CountOfLogin));
     CountOfFailedLogin    = SqlUtils.EvalInt(dataItem, nameof(CountOfFailedLogin));
     CountOfWriting        = SqlUtils.EvalInt(dataItem, nameof(CountOfWriting));
     IsChecked             = SqlUtils.EvalBool(dataItem, nameof(IsChecked));
     IsLockedOut           = SqlUtils.EvalBool(dataItem, nameof(IsLockedOut));
     DisplayName           = SqlUtils.EvalString(dataItem, nameof(DisplayName));
     Email                 = SqlUtils.EvalString(dataItem, nameof(Email));
     Mobile                = SqlUtils.EvalString(dataItem, nameof(Mobile));
     AvatarUrl             = SqlUtils.EvalString(dataItem, nameof(AvatarUrl));
     Organization          = SqlUtils.EvalString(dataItem, nameof(Organization));
     Department            = SqlUtils.EvalString(dataItem, nameof(Department));
     Position              = SqlUtils.EvalString(dataItem, nameof(Position));
     Gender                = SqlUtils.EvalString(dataItem, nameof(Gender));
     Birthday              = SqlUtils.EvalString(dataItem, nameof(Birthday));
     Education             = SqlUtils.EvalString(dataItem, nameof(Education));
     Graduation            = SqlUtils.EvalString(dataItem, nameof(Graduation));
     Address               = SqlUtils.EvalString(dataItem, nameof(Address));
     WeiXin                = SqlUtils.EvalString(dataItem, nameof(WeiXin));
     Qq                    = SqlUtils.EvalString(dataItem, nameof(Qq));
     WeiBo                 = SqlUtils.EvalString(dataItem, nameof(WeiBo));
     Interests             = SqlUtils.EvalString(dataItem, nameof(Interests));
     Signature             = SqlUtils.EvalString(dataItem, nameof(Signature));
 }
Exemplo n.º 29
0
        void dgContents_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                var keywordId  = SqlUtils.EvalInt(e.Item.DataItem, "KeywordId");
                var keywords   = SqlUtils.EvalString(e.Item.DataItem, "Keywords");
                var reply      = SqlUtils.EvalString(e.Item.DataItem, "Reply");
                var isDisabled = TranslateUtils.ToBool(SqlUtils.EvalString(e.Item.DataItem, "IsDisabled"));
                var matchType  = EMatchTypeUtils.GetEnumType(SqlUtils.EvalString(e.Item.DataItem, "MatchType"));
                var addDate    = SqlUtils.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 = ModalKeywordAddText.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>";
            }
        }
Exemplo n.º 30
0
        private void rptContents_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingItem)
            {
                return;
            }

            if (e.Item.DataItem == null)
            {
                return;
            }

            var id                 = SqlUtils.EvalInt(e.Item.DataItem, nameof(UserInfo.Id));
            var userName           = SqlUtils.EvalString(e.Item.DataItem, nameof(UserInfo.UserName));
            var createDate         = SqlUtils.EvalDateTime(e.Item.DataItem, nameof(UserInfo.CreateDate));
            var lastActivityDate   = SqlUtils.EvalDateTime(e.Item.DataItem, nameof(UserInfo.LastActivityDate));
            var countOfLogin       = SqlUtils.EvalInt(e.Item.DataItem, nameof(UserInfo.CountOfLogin));
            var countOfFailedLogin = SqlUtils.EvalInt(e.Item.DataItem, nameof(UserInfo.CountOfFailedLogin));
            var groupId            = SqlUtils.EvalInt(e.Item.DataItem, nameof(UserInfo.GroupId));
            var isChecked          = SqlUtils.EvalBool(e.Item.DataItem, nameof(UserInfo.IsChecked));
            var isLockedOut        = SqlUtils.EvalBool(e.Item.DataItem, nameof(UserInfo.IsLockedOut));
            var displayName        = SqlUtils.EvalString(e.Item.DataItem, nameof(UserInfo.DisplayName));
            var email              = SqlUtils.EvalString(e.Item.DataItem, nameof(UserInfo.Email));
            var mobile             = SqlUtils.EvalString(e.Item.DataItem, nameof(UserInfo.Mobile));

            var ltlUserName      = (Literal)e.Item.FindControl("ltlUserName");
            var ltlEmail         = (Literal)e.Item.FindControl("ltlEmail");
            var ltlMobile        = (Literal)e.Item.FindControl("ltlMobile");
            var ltlGroupName     = (Literal)e.Item.FindControl("ltlGroupName");
            var ltlLoginCount    = (Literal)e.Item.FindControl("ltlLoginCount");
            var ltlCreationDate  = (Literal)e.Item.FindControl("ltlCreationDate");
            var ltlSelect        = (Literal)e.Item.FindControl("ltlSelect");
            var hlChangePassword = (HyperLink)e.Item.FindControl("hlChangePassword");
            var hlEditLink       = (HyperLink)e.Item.FindControl("hlEditLink");

            var showPopWinString = ModalUserView.GetOpenWindowString(userName);
            var state            = isChecked ? string.Empty : @"<span style=""color:red;"">[待审核]</span>";

            if (isLockedOut)
            {
                state += @"<span style=""color:red;"">[已锁定]</span>";
            }
            else if (ConfigManager.SystemConfigInfo.IsUserLockLogin &&
                     ConfigManager.SystemConfigInfo.UserLockLoginCount <= countOfFailedLogin)
            {
                if (_lockType == EUserLockType.Forever)
                {
                    state += @"<span style=""color:red;"">[已锁定]</span>";
                }
                else
                {
                    var ts    = new TimeSpan(DateTime.Now.Ticks - lastActivityDate.Ticks);
                    var hours = Convert.ToInt32(ConfigManager.SystemConfigInfo.UserLockLoginHours - ts.TotalHours);
                    if (hours > 0)
                    {
                        state += $@"<span style=""color:red;"">[已锁定{hours}小时]</span>";
                    }
                }
            }

            ltlUserName.Text = $@"<a href=""javascript:;"" onclick=""{showPopWinString}"">{userName}</a> {state}";

            if (!string.IsNullOrEmpty(displayName))
            {
                ltlUserName.Text += $"({displayName})";
            }
            ltlEmail.Text        = email;
            ltlMobile.Text       = mobile;
            ltlGroupName.Text    = UserGroupManager.GetUserGroupInfo(groupId).GroupName;
            ltlLoginCount.Text   = countOfLogin.ToString();
            ltlCreationDate.Text = DateUtils.GetDateAndTimeString(createDate);

            hlEditLink.NavigateUrl = PageUserAdd.GetRedirectUrlToEdit(id, GetRedirectUrl());
            hlChangePassword.Attributes.Add("onclick", ModalUserPassword.GetOpenWindowString(userName));
            ltlSelect.Text = $@"<input type=""checkbox"" name=""UserIDCollection"" value=""{id}"" />";
        }