示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                HttpCookie cookie = Request.Cookies["userId"];
                if (null == cookie)
                {
                    Response.Write("<script language=javascript>window.parent.location='../Login.aspx';</script>");//
                }
                else
                {
                    int userId = (Convert.ToInt32(cookie.Value));

                    ddrDept.DataTextField  = "itemName";
                    ddrDept.DataValueField = "siId";
                    ddrDept.DataSource     = ClassHelper.GetSystemItem("DEPT");
                    ddrDept.DataBind();

                    ddrStatus.DataTextField  = "itemName";
                    ddrStatus.DataValueField = "siId";
                    ddrStatus.DataSource     = ClassHelper.GetSystemItem("USER_STATUS");
                    ddrStatus.DataBind();

                    BLL.role roleBll = new BLL.role();
                    ddrRole.DataTextField  = "roleName";
                    ddrRole.DataValueField = "roleId";
                    ddrRole.DataSource     = roleBll.GetList("roleId<>1");
                    ddrRole.DataBind();

                    ShowInfo(userId);
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BLL.dept pBll     = new BLL.dept();
                string   placeSql = "";
                string   roleSql  = "roleId<>1";
                if (Request.Cookies["isAdmin"].Value != "1")
                {
                    placeSql = " deptId in (" + pBll.GetAllChild(int.Parse(Request.Cookies["deptId"].Value)) + ") ";
                    roleSql  = "roleId>2";
                }

                ClassHelper.AddDeptList(ddrPlace);

                BLL.role roleBll = new BLL.role();
                ddrRole.DataTextField  = "roleName";
                ddrRole.DataValueField = "roleId";
                ddrRole.DataSource     = roleBll.GetList(roleSql);
                ddrRole.DataBind();
                ddrRole.Items.Insert(0, new ListItem("请选择", "0"));
                ddrRole.SelectedValue = "2";
                ddrRole.Enabled       = false;
            }
        }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    int userId = (Convert.ToInt32(Request.Params["id"]));

                    BLL.dept placeBll = new BLL.dept();
                    ddrPlace.DataTextField  = "deptName";
                    ddrPlace.DataValueField = "deptId";
                    ddrPlace.DataSource     = placeBll.GetList("");
                    ddrPlace.DataBind();
                    ddrPlace.Items.Insert(0, new ListItem("请选择", "0"));

                    BLL.role roleBll = new BLL.role();
                    ddrRole.DataTextField  = "roleName";
                    ddrRole.DataValueField = "roleId";
                    ddrRole.DataSource     = roleBll.GetList("roleId<>1");
                    ddrRole.DataBind();

                    try
                    {
                        ShowInfo(userId);
                    }
                    catch (Exception ex)
                    { }
                }
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BLL.dept pBll = new BLL.dept();
                string placeSql = "";
                string roleSql = "roleId<>1";
                if (Request.Cookies["isAdmin"].Value != "1")
                {
                    placeSql = " deptId in (" + pBll.GetAllChild(int.Parse(Request.Cookies["deptId"].Value)) + ") ";
                    roleSql = "roleId>2";
                }

                ClassHelper.AddDeptList(ddrPlace);

                BLL.role roleBll = new BLL.role();
                ddrRole.DataTextField = "roleName";
                ddrRole.DataValueField = "roleId";
                ddrRole.DataSource = roleBll.GetList(roleSql);
                ddrRole.DataBind();
                ddrRole.Items.Insert(0, new ListItem("请选择", "0"));

            }
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    int userId=(Convert.ToInt32(Request.Params["id"]));

                    BLL.dept placeBll = new BLL.dept();
                    ddrPlace.DataTextField = "deptName";
                    ddrPlace.DataValueField = "deptId";
                    ddrPlace.DataSource = placeBll.GetList("");
                    ddrPlace.DataBind();
                    ddrPlace.Items.Insert(0,new ListItem("请选择","0"));

                    BLL.role roleBll = new BLL.role();
                    ddrRole.DataTextField = "roleName";
                    ddrRole.DataValueField = "roleId";
                    ddrRole.DataSource = roleBll.GetList("roleId<>1");
                    ddrRole.DataBind();

                    try
                    {
                        ShowInfo(userId);
                    }
                    catch (Exception ex)
                    { }

                }
            }
        }