Exemple #1
0
 protected void btnConfirm_Click(object sender, EventArgs e)
 {
     //设置user群组
     Userdata.deleteUsergroup(Request.QueryString["id"].ToString());
     for (int i = 0; i < cblUsergroup.Items.Count; i++)
     {
         if (cblUsergroup.Items[i].Selected == true)
         {
             Userdata.addUsergroup(Request.QueryString["id"].ToString(), cblUsergroup.Items[i].Value);
         }
     }
 }
Exemple #2
0
    protected void btnConfirm_Click(object sender, EventArgs e)
    {
        Userdata user = new Userdata();

        user = Userdata.getUserInfo(txtID.Text);
        if (user.ID != null)
        {
            JScript.Alert("用户已存在", this);
            return;
        }


        user.Class    = ddlClass.SelectedValue;
        user.ID       = txtID.Text;
        user.Name     = txtName.Text;
        user.Pwd      = txtPWD.Text;
        user.Station  = txtStation.Text;
        user.Workshop = ddlWorkShop.SelectedValue;//System.Web.HttpContext.Current.Request.Cookies["workshop"].Value;



        //添加用户
        if (user.AddUser() < 1)
        {
            JScript.Alert("添加用户失败!", this);
        }



        //设置user群组
        //Userdata.deleteUsergroup(Request.QueryString["id"].ToString());
        for (int i = 0; i < cblUsergroup.Items.Count; i++)
        {
            if (cblUsergroup.Items[i].Selected == true)
            {
                Userdata.addUsergroup(user.ID, cblUsergroup.Items[i].Value);
            }
        }
    }