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); }
protected void Save_Btn_Click(object sender, EventArgs e) { M_ARoleAuth model = new M_ARoleAuth(); model.Rid = RoleID; model.model = Request.Form["model"]; model.content = Request.Form["content"]; model.crm = Request.Form["crm"]; model.label = Request.Form["label"]; model.shop = Request.Form["shop"]; model.store = Request.Form["store"]; model.page = Request.Form["page"]; model.user = Request.Form["user"]; model.other = Request.Form["other"]; model.pub = Request.Form["pub"]; authBll.Insert(model); function.WriteSuccessMsg("操作成功"); }