Пример #1
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            if (null != Request.QueryString["userid"])
            {
                string userid = Request.QueryString["userid"].ToString();

                List<UserRolesOR> listUR = new List<UserRolesOR>();
                foreach (ListItem li in cblRoseList.Items)
                {
                    if (li.Selected)
                    {
                        UserRolesOR tur = new UserRolesOR();
                        tur.UserGuid = userid;
                        tur.RoleGuid = li.Value;
                        listUR.Add(tur);
                    }
                }
                if (listUR.Count == 0)
                {
                    base.Alert("请选择角色。");
                }
                UserRolesDA rs = new UserRolesDA();
                if (rs.AddUserRoles(listUR))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "", @"<script language='javascript'>
                    $(document).ready(function(){
                        $.DialogClose('xz');
                    });
                    </script>");
                    //base.Close(true);
                }
                else
                {
                    base.Alert("授权失败!");
                }
            }
            else
            {
                base.Alert("获取用户ID失败!");
            }
        }
Пример #2
0
        private void initUserRose()
        {
            if (null != Request.QueryString["userid"])
            {
                string userid = Request.QueryString["userid"];

                UserRolesDA rs = new UserRolesDA();
                ObservableCollection<UserRolesOR> listUserRose = rs.GetUserRoseBuyUserID(userid);
                foreach (UserRolesOR obj in listUserRose)
                {
                    checkCBList(obj.RoleGuid);
                }
            }
            else
            {
                base.Alert("获取用户ID失败!");
            }
        }