Hidistro.UI.Web/Admin/Settings/Roles.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Hidistro.UI.Web.Admin.settings
{
    using ASPNET.WebControls;
    using Hidistro.ControlPanel.Store;
    using Hidistro.Core;
    using Hidistro.Entities.Store;
    using Hidistro.UI.Common.Controls;
    using Hidistro.UI.ControlPanel.Utility;
    using Hishop.Components.Validation;
    using System;
    using System.Collections.Generic;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class Roles : AdminPage
    {
        protected Button btnSubmitRoles;
        protected Grid grdGroupList;
        protected HtmlInputHidden htxtRoleId;
        protected HtmlForm thisForm;
        protected TextBox txtAddRoleName;
        protected TextBox txtRoleDesc;

        protected Roles() : base("m09", "szp10")
        {
        }

        public void BindUserGroup()
        {
            this.grdGroupList.DataSource = ManagerHelper.GetRoles();
            this.grdGroupList.DataBind();
        }

        private void btnEditRoles_Click()
        {
            RoleInfo target = new RoleInfo();
            if (string.IsNullOrEmpty(this.txtAddRoleName.Text.Trim()))
            {
                this.ShowMsg("部门名称不能为空,长度限制在60个字符以内", false);
            }
            else
            {
                target.RoleId = int.Parse(this.htxtRoleId.Value);
                RoleInfo role = ManagerHelper.GetRole(target.RoleId);
                if (role != null)
                {
                    if (ManagerHelper.RoleExists(target.RoleName) && (target.RoleName != role.RoleName))
                    {
                        this.ShowMsg("已经存在相同的部门名称", false);
                    }
                    else
                    {
                        target.RoleName = Globals.HtmlEncode(this.txtAddRoleName.Text.Trim()).Replace(",", "");
                        target.Description = Globals.HtmlEncode(this.txtRoleDesc.Text.Trim());
                        target.IsDefault = bool.Parse(base.Request["rdIsDefault"]);
                        ValidationResults results = Hishop.Components.Validation.Validation.Validate<RoleInfo>(target, new string[] { "ValRoleInfo" });
                        string msg = string.Empty;
                        if (!results.IsValid)
                        {
                            foreach (ValidationResult result in (IEnumerable<ValidationResult>) results)
后面还有 82 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。