918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/712bd9e6/ca967f19/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/712bd9e6/ca967f19/App_Web_l0cr3nog.9.cs
?#pragma checksum "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\left\authority.aspx.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "C815B618D3E78DC77C60DD0206C08B5CB6E8B89A"

#line 1 "D:\wwwroot\bgsciences\wwwroot\sysmanage\files\left\authority.aspx.cs"
using System;
using System.Collections;
using System.Configuration;
using System.Data;

using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;


public partial class sysmanage_files_left_authority : System.Web.UI.Page
{
    protected string strlist = string.Empty;
    int cols = 4;                           //4列
    private int _uploadID;

    public int UploadID
    {
        get
        {
            return this._uploadID;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        login.OnLine();

        if (!IsPostBack)
        {
            if (Request.Form["Option"] != null && !Request.Form["Option"].Trim().Equals(""))
            {

                string strcoulum = Request.Form["col"];
                int uid = Convert.ToInt32(Request.Form["uid"]);
                string strsql = "update S_Authorization set coulums = '" + strcoulum + "' where id = " + uid + "";
                
                if (SQLServerHelper.execNonQuery(strsql))
                {
                    Session["leftcoulum"] = strcoulum;
                    Session.Timeout = 60;//
                    HttpCookie cook3 = new HttpCookie("leftcoulum", strcoulum);
                    cook3.Expires.AddDays(1);
                    Response.SetCookie(cook3);
                    Response.Write("权限分配成功");
                }
                Response.End();

            }
            BindCol();
            if (Request.QueryString["groupid"] != null && Request.QueryString["groupid"] != "")
            {
                int id = Convert.ToInt32(Request.QueryString["groupid"]);
                _uploadID = id;
                SetCoulum(id);
            }

        }
    }

    /// <summary>
    /// 绑定一级栏目
    /// </summary>
    protected void BindCol()
    {
        DataTable dt = SQLServerHelper.ExecuteTable("select * from J_leftcoulum where fid = 0");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            TableRow r = new TableRow();  //new出一行
            r.BorderColor = System.Drawing.Color.Blue;
            r.BorderStyle = BorderStyle.Dashed;
            r.CssClass = "ss";           //行Css形状
            TableCell c1 = new TableCell();  //new出单元格
            c1.ColumnSpan = cols;            //界说列数
            c1.Width = Unit.Percentage(100);
            CheckBox ck = new CheckBox();   //new出CheckBox
            ck.ID = dt.Rows[i]["id"].ToString();  //绑定CheckBox ID
            ck.Text = dt.Rows[i]["sname"].ToString();  //绑定CheckBox Text
            ck.EnableViewState = false;
            c1.HorizontalAlign = HorizontalAlign.Left;
            c1.Controls.Add(ck);
            r.Cells.Add(c1);
            tbsubcolumn.Rows.Add(r);          //将行放到Table中
            string sc_list = BindColKids(Convert.ToInt32(dt.Rows[i]["id"])); //绑定二级分类
            ck.Attributes.Add("onclick", "javascript:select_check(this,'" + sc_list + "');");  //给一级CheckBox加点击后子类全选事务
        }
    }
    /// <summary>
    /// 绑定二级栏目
    /// </summary>
    /// <param name="fid">一级分类ID</param>
    /// <returns>返回凭据一级分类查处的二级分类</returns>
    protected string BindColKids(int fid)
    {
        DataTable dtkids = SQLServerHelper.ExecuteTable("select * from J_leftcoulum where fid = " + fid + "");
        TableRow r2 = new TableRow();
        r2.CssClass = "kids";
        r2.Width = Unit.Parse("100px");
        TableCell c2 = new TableCell();
        c2.ColumnSpan = (100 / cols);
        string ss = string.Empty;
        for (int i = 0; i < dtkids.Rows.Count; i++)
        {


            CheckBox ck = new CheckBox();
            ck.ID = dtkids.Rows[i]["id"].ToString();
            ss += ck.ID;
            ss += ",";
            ck.Text = dtkids.Rows[i]["sname"].ToString();
            c2.HorizontalAlign = HorizontalAlign.Left;
            c2.Controls.Add(ck);
            r2.Cells.Add(c2);
            tbsubcolumn.Rows.Add(r2);

        }
        return ss;
    }
    /// <summary>
    /// 凭据用户ID加载栏目权限
    /// </summary>
    /// <param name="id"></param>
    protected void SetCoulum(int id)
    {
        DataTable dtcol = SQLServerHelper.ExecuteTable("select coulums from S_Authorization where id = " + id + "");
        if (dtcol.Rows.Count != 0)
        {
            char[] a = { ',' };
            string coulum = dtcol.Rows[0]["coulums"].ToString().TrimEnd(a);
            ClientScript.RegisterStartupScript(this.GetType(), "onload", "<script language='javascript'>checktrue('" + coulum + "')</script>");
        }
    }

    protected void bt_Click(object sender, EventArgs e)
    {

    }
}


#line default
#line hidden