Beispiel #1
0
        private void MyBind()
        {
            //后期改为XML存储或Json存储
            M_RoleInfo roleMod = roleBll.SelReturnModel(RoleID);

            RoleName_L.Text = roleMod.RoleName;
            string json = SafeSC.ReadFileStr("/Config/AuthList.config");

            AuthDT = JsonConvert.DeserializeObject <DataTable>(json);
            //AuthDT = SqlHelper.ExecuteTable(CommandType.Text, "SELECT layer,[name],[text],owner,[desc] FROM ZL_AuthList");
            DataTable tabDT = GetAuthModel();

            TabRPT.DataSource = tabDT;
            TabRPT.DataBind();
            ownerRPT.DataSource = tabDT;
            ownerRPT.DataBind();
            M_ARoleAuth authMod = authBll.SelModelByRid(RoleID);

            if (authMod != null)
            {
                function.Script(this, "SetChkVal('model','" + authMod.model + "');");
                function.Script(this, "SetChkVal('content','" + authMod.content + "');");
                function.Script(this, "SetChkVal('crm','" + authMod.crm + "');");
                function.Script(this, "SetChkVal('label','" + authMod.label + "');");
                function.Script(this, "SetChkVal('shop','" + authMod.shop + "');");
                function.Script(this, "SetChkVal('store','" + authMod.store + "');");
                function.Script(this, "SetChkVal('page','" + authMod.page + "');");
                function.Script(this, "SetChkVal('user','" + authMod.user + "');");
                function.Script(this, "SetChkVal('other','" + authMod.other + "');");
                function.Script(this, "SetChkVal('pub','" + authMod.pub + "');");
            }
            //AuthDT=AuthDT.DefaultView.ToTable(false, "layer,name,text,owner,desc".Split(','));
            //string json = JsonConvert.SerializeObject(AuthDT,Formatting.Indented);
            //SafeSC.WriteFile("/test/AuthList.config", json);
        }