示例#1
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        DataTable dtuser = Hyoa_user.Getuserallinfo(this.txtuserid.Text);

        if (dtuser.Rows.Count > 0)
        {
            for (int i = 0; i < dtuser.Rows.Count; i++)
            {
                Hyoa_user.id = dtuser.Rows[i]["id"].ToString();
                Hyoa_user.hy_loginuid = dtuser.Rows[i]["hy_loginuid"].ToString();
                Hyoa_user.hy_userid = dtuser.Rows[i]["hy_userid"].ToString();
                Hyoa_user.hy_deptid = dtuser.Rows[i]["hy_deptid"].ToString();
                Hyoa_user.hy_username = this.txtusername.Text;
                Hyoa_user.hy_post = dtuser.Rows[i]["hy_post"].ToString();
                Hyoa_user.hy_ifleader = dtuser.Rows[i]["hy_ifleader"].ToString();
                Hyoa_user.hy_officetel = this.txtofficetel.Value;
                Hyoa_user.hy_hometel = this.txthometel.Value;
                Hyoa_user.hy_mobile = this.txtmobile.Value;
                Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
                Hyoa_user.hy_sort = float.Parse(dtuser.Rows[i]["hy_sort"].ToString());
                Hyoa_user.hy_isenabled = dtuser.Rows[i]["hy_isenabled"].ToString();
                Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
                Hyoa_user.hy_birthday = dtuser.Rows[i]["hy_birthday"].ToString();
                Hyoa_user.hy_ifsrtx = dtuser.Rows[i]["hy_ifsrtx"].ToString();
                Hyoa_user.hy_fjh = dtuser.Rows[i]["hy_fjh"].ToString();
                Hyoa_user.hy_xb = dtuser.Rows[i]["hy_xb"].ToString();
                Hyoa_user.hy_zzmm = dtuser.Rows[i]["hy_zzmm"].ToString();
                Hyoa_user.hy_xl = dtuser.Rows[i]["hy_xl"].ToString();
                Hyoa_user.hy_byyx = dtuser.Rows[i]["hy_byyx"].ToString();
                Hyoa_user.hy_jdwsj = dtuser.Rows[i]["hy_jdwsj"].ToString();
                Hyoa_user.hy_jtzz = dtuser.Rows[i]["hy_jtzz"].ToString();
                Hyoa_user.hy_sfzhm = dtuser.Rows[i]["hy_sfzhm"].ToString();
                Hyoa_user.hy_bz = dtuser.Rows[i]["hy_bz"].ToString();
                Hyoa_user.hy_jsids = dtuser.Rows[i]["hy_jsids"].ToString();
                Hyoa_user.hy_jsnames = dtuser.Rows[i]["hy_jsnames"].ToString();
                Hyoa_user.hy_field1 = dtuser.Rows[i]["hy_field1"].ToString();
                Hyoa_user.hy_field2 = dtuser.Rows[i]["hy_field2"].ToString();
                Hyoa_user.hy_field3 = dtuser.Rows[i]["hy_field3"].ToString();
                Hyoa_user.hy_field4 = dtuser.Rows[i]["hy_field4"].ToString();
                Hyoa_user.hy_field5 = dtuser.Rows[i]["hy_field5"].ToString();
                Hyoa_user.Update();
            }
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
示例#2
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        HyoaClass.Hyoa_user_detail Hyoa_user_detail = new HyoaClass.Hyoa_user_detail();
        if (this.txtop.Value == "add")
        {
            //先判断这个用户是否已经存在
            DataTable dtjudge = Hyoa_user.Getuser(this.txtuserid.Text);
            if (dtjudge.Rows.Count > 0)
            {
                Response.Write("<script>alert('该用户名已注册,请重新注册!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_user.hy_userid = this.txtuserid.Text;
                Hyoa_user.hy_deptid = this.hy_deptid.Text;
                Hyoa_user.hy_username = this.txtusername.Value;
                Hyoa_user.hy_post = this.txtposition.Value;
                Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
                Hyoa_user.hy_officetel = this.txtofficetel.Value;
                Hyoa_user.hy_hometel = this.txthometel.Value;
                Hyoa_user.hy_mobile = this.txtmobile.Value;
                Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
                Hyoa_user.hy_sort = System.Int32.Parse(this.txtuserno.Value);
                Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
                Hyoa_user.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_user.Insert();
            }
        }
        else
        {
            Hyoa_user.hy_userid = this.txtuserid.Text;
            Hyoa_user.hy_deptid = this.hy_deptid.Text;
            Hyoa_user.hy_username = this.txtusername.Value;
            Hyoa_user.hy_post = this.txtposition.Value;
            Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
            Hyoa_user.hy_officetel = this.txtofficetel.Value;
            Hyoa_user.hy_hometel = this.txthometel.Value;
            Hyoa_user.hy_mobile = this.txtmobile.Value;
            Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
            Hyoa_user.hy_sort = System.Int32.Parse(this.txtuserno.Value);
            Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
            Hyoa_user.Update();
        }

        //先判断这个用户详细信息是否已经存在
        DataTable dtdetail = Hyoa_user_detail.Getuserdetail(this.txtuserid.Text);
        if (dtdetail.Rows.Count > 0)
        {
            //更新详细信息
            Hyoa_user_detail.hy_userid = this.txtuserid.Text;
            Hyoa_user_detail.hy_birthday = this.txtbirthday.Value;
            Hyoa_user_detail.hy_ifsrtx = "";
            Hyoa_user_detail.hy_fjh = this.txtfjh.Value;
            Hyoa_user_detail.hy_xb = this.ddlxb.SelectedValue;
            Hyoa_user_detail.hy_zzmm = this.txtzzmm.Value;
            Hyoa_user_detail.hy_xl = this.txtxl.Value;
            Hyoa_user_detail.hy_byyx = this.txtbyyx.Value;
            Hyoa_user_detail.hy_jdwsj = this.txtjdwsj.Value;
            Hyoa_user_detail.hy_jtzz = this.txtjtzz.Value;
            Hyoa_user_detail.hy_sfzhm = this.txtsfzhm.Value;
            Hyoa_user_detail.Update();
        }
        else
        {
            //插入详细信息
            Hyoa_user_detail.hy_userid = this.txtuserid.Text;
            Hyoa_user_detail.hy_birthday = this.txtbirthday.Value;
            Hyoa_user_detail.hy_ifsrtx = "";
            Hyoa_user_detail.hy_fjh = this.txtfjh.Value;
            Hyoa_user_detail.hy_xb = this.ddlxb.SelectedValue;
            Hyoa_user_detail.hy_zzmm = this.txtzzmm.Value;
            Hyoa_user_detail.hy_xl = this.txtxl.Value;
            Hyoa_user_detail.hy_byyx = this.txtbyyx.Value;
            Hyoa_user_detail.hy_jdwsj = this.txtjdwsj.Value;
            Hyoa_user_detail.hy_jtzz = this.txtjtzz.Value;
            Hyoa_user_detail.hy_sfzhm = this.txtsfzhm.Value;
            Hyoa_user_detail.Insert();
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
示例#3
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("/login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        if (this.txtop.Value == "add")
        {
            //先判断这个用户是否已经存在
            DataTable dtjudge = Hyoa_user.Getuser(this.txtuserid.Text);
            if (dtjudge.Rows.Count > 0)
            {
                Response.Write("<script>alert('该用户名已注册,请重新注册!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_user.hy_userid = this.txtuserid.Text;
                Hyoa_user.hy_deptid = this.hy_deptid.Text;
                Hyoa_user.hy_username = this.txtusername.Text ;
                Hyoa_user.hy_post = this.txtposition.Value;
                Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
                Hyoa_user.hy_officetel = this.txtofficetel.Value;
                Hyoa_user.hy_hometel = this.txthometel.Value;
                Hyoa_user.hy_mobile = this.txtmobile.Value;
                Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
                Hyoa_user.hy_sort = System.Int32.Parse(this.txtuserno.Value);
                Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
                Hyoa_user.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_user.Insert();
            }
        }
        else
        {
            Hyoa_user.hy_userid = this.txtuserid.Text;
            Hyoa_user.hy_deptid = this.hy_deptid.Text;
            Hyoa_user.hy_username = this.txtusername.Text ;
            Hyoa_user.hy_post = this.txtposition.Value;
            Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
            Hyoa_user.hy_officetel = this.txtofficetel.Value;
            Hyoa_user.hy_hometel = this.txthometel.Value;
            Hyoa_user.hy_mobile = this.txtmobile.Value;
            Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
            Hyoa_user.hy_sort = System.Int32.Parse(this.txtuserno.Value);
            Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
            Hyoa_user.Update();
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
示例#4
0
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.txtop.Value == "add")
        {
            //先判断这个用户是否已经存在
            DataTable dtjudge = Hyoa_user.Getuserbyuserid(this.txtuserid.Text);
            if (dtjudge.Rows.Count > 0)
            {
                Response.Write("<script>alert('该用户名已注册,请重新注册!');history.back();</script>");
                return;
            }
            else
            {
                //判断是否超过用户数限制
                HyoaClass_conn.Hyoa_nbheyi Hyoa_nbheyi = new HyoaClass_conn.Hyoa_nbheyi();
                DataTable dt1 = Hyoa_nbheyi.Getfirstnbheyi();
                Int32 li_user1 = 0;
                if (dt1.Rows.Count > 0)
                {
                    li_user1 = System.Int32.Parse(dt1.Rows[0]["hy_usernum"].ToString()) + 1;
                }
                DataTable dt2 = Hyoa_user.Getusers_jzcw();
                Int32 li_user2 = 0;
                li_user2 = System.Int32.Parse(dt2.Rows.Count.ToString());
                if (li_user1 <= li_user2)
                {
                    //删除最近注册的账号
                    Response.Write("<script>alert('您的系统注册用户数授权已满,请联系管理员或宁波合益!');</script>");
                    return;
                }

                Hyoa_user.id = Hyoa_global.GetRandom();
                Hyoa_user.hy_loginuid = this.txtuserid.Text;
                Hyoa_user.hy_userid = this.txtuserid.Text;
                Hyoa_user.hy_deptid = this.hy_deptid.Text;
                Hyoa_user.hy_username = this.txtusername.Value;
                Hyoa_user.hy_post = this.txtposition.Value;
                Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
                Hyoa_user.hy_officetel = this.txtofficetel.Value;
                Hyoa_user.hy_hometel = this.txthometel.Value;
                Hyoa_user.hy_mobile = this.txtmobile.Value;
                Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
                Hyoa_user.hy_sort = float.Parse(this.txtuserno.Value);
                Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
                Hyoa_user.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
                Hyoa_user.hy_birthday = this.txtbirthday.Value;
                Hyoa_user.hy_ifsrtx = "";
                Hyoa_user.hy_fjh = this.txtfjh.Value;
                Hyoa_user.hy_xb = this.ddlxb.SelectedValue;
                Hyoa_user.hy_zzmm = this.txtzzmm.Value;
                Hyoa_user.hy_xl = this.txtxl.Value;
                Hyoa_user.hy_byyx = this.txtbyyx.Value;
                Hyoa_user.hy_jdwsj = this.txtjdwsj.Value;
                Hyoa_user.hy_jtzz = this.txtjtzz.Value;
                Hyoa_user.hy_sfzhm = this.txtsfzhm.Value;
                Hyoa_user.hy_bz = "";
                Hyoa_user.hy_jsids = this.txtjsids.Value;
                Hyoa_user.hy_jsnames = this.txtjsnames.Value;
                Hyoa_user.hy_field1 = "";
                Hyoa_user.hy_field2 = this.ddlhy_field2.SelectedValue.ToString();
                Hyoa_user.hy_field3 = "";
                Hyoa_user.hy_field4 = "";
                Hyoa_user.hy_field5 = "";
                Hyoa_user.Insert();

                //写新增人员系统日志start
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "新增";
                Hyoa_log.hy_oppcontent = "新增用户:" + this.txtusername.Value;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
            }
        }
        else
        {
            Hyoa_user.id = this.txtid.Text;
            Hyoa_user.hy_loginuid = this.txtuserid.Text;
            Hyoa_user.hy_userid = this.txtuserid.Text;
            Hyoa_user.hy_deptid = this.hy_deptid.Text;
            Hyoa_user.hy_username = this.txtusername.Value;
            Hyoa_user.hy_post = this.txtposition.Value;
            Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
            Hyoa_user.hy_officetel = this.txtofficetel.Value;
            Hyoa_user.hy_hometel = this.txthometel.Value;
            Hyoa_user.hy_mobile = this.txtmobile.Value;
            Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
            Hyoa_user.hy_sort = float.Parse(this.txtuserno.Value);
            Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
            Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
            Hyoa_user.hy_birthday = this.txtbirthday.Value;
            Hyoa_user.hy_ifsrtx = "";
            Hyoa_user.hy_fjh = this.txtfjh.Value;
            Hyoa_user.hy_xb = this.ddlxb.SelectedValue;
            Hyoa_user.hy_zzmm = this.txtzzmm.Value;
            Hyoa_user.hy_xl = this.txtxl.Value;
            Hyoa_user.hy_byyx = this.txtbyyx.Value;
            Hyoa_user.hy_jdwsj = this.txtjdwsj.Value;
            Hyoa_user.hy_jtzz = this.txtjtzz.Value;
            Hyoa_user.hy_sfzhm = this.txtsfzhm.Value;
            Hyoa_user.hy_bz = "";
            Hyoa_user.hy_jsids = this.txtjsids.Value;
            Hyoa_user.hy_jsnames = this.txtjsnames.Value;
            Hyoa_user.hy_field1 = "";
            Hyoa_user.hy_field2 = this.ddlhy_field2.SelectedValue.ToString();
            Hyoa_user.hy_field3 = "";
            Hyoa_user.hy_field4 = "";
            Hyoa_user.hy_field5 = "";
            Hyoa_user.Update();

            //写新增人员系统日志start
            HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
            Hyoa_log.ID = System.Guid.NewGuid().ToString();
            Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            Hyoa_log.hy_oppip = userip;
            Hyoa_log.hy_opptype = "修改";
            Hyoa_log.hy_oppcontent = "修改用户:" + this.txtusername.Value;
            Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
            Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
            Hyoa_log.Insert();
        }

        //根据角色分配权限
        if (this.txtjsids.Value != this.txtjsids2.Text)
        {
            //选择的角色有所变化,则需要更新

            HyoaClass.Hyoa_jiaose Hyoa_jiaose = new HyoaClass.Hyoa_jiaose();
            HyoaClass.Hyoa_roleuser Hyoa_roleuser = new HyoaClass.Hyoa_roleuser();
            HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser();

            ///////////////////删除老角色的权限///////////////////////////////////
            string[] lv_deljiaoseid = this.txtjsids2.Text.Split(',');
            if (lv_deljiaoseid.Length > 0)
            {
                for (int i = 0; i < lv_deljiaoseid.Length; i++)
                {
                    if (lv_deljiaoseid[i] != "")
                    {
                        DataTable dt = Hyoa_jiaose.Getdocbyid(lv_deljiaoseid[i]);
                        if (dt.Rows.Count > 0)
                        {
                            //更新对应的ROLE
                            if (dt.Rows[0]["hy_roleids"].ToString() != "")
                            {
                                string[] lv_roleid;
                                lv_roleid = dt.Rows[0]["hy_roleids"].ToString().Split(',');
                                for (int j = 0; j < lv_roleid.Length; j++)
                                {
                                    if (lv_roleid[j] != "")
                                    {
                                        Hyoa_roleuser.Deletebyroleidanduserid(lv_roleid[j], this.txtuserid.Text);
                                    }
                                }
                            }
                            //更新对应的flowtache
                            if (dt.Rows[0]["hy_flowtacheids"].ToString() != "")
                            {
                                string[] lv_flowtacheidid;
                                lv_flowtacheidid = dt.Rows[0]["hy_flowtacheids"].ToString().Split(',');
                                for (int j = 0; j < lv_flowtacheidid.Length; j++)
                                {
                                    if (lv_flowtacheidid[j] != "")
                                    {
                                        string ls_temp = lv_flowtacheidid[j];
                                        string[] lv_temp = ls_temp.Split('_');
                                        if (lv_temp.Length == 2)
                                        {
                                            string ls_flowid = lv_temp[0];
                                            string ls_tacheid = lv_temp[1];
                                            Hyoa_flowtacheuser.Deletebyroleidtacheiduserid(ls_flowid, ls_tacheid, this.txtuserid.Text);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            ///////////////////增加新角色的权限///////////////////////////////////
            string[] lv_addjiaoseid = this.txtjsids.Value.Split(',');
            if (lv_addjiaoseid.Length > 0)
            {
                for (int i = 0; i < lv_addjiaoseid.Length; i++)
                {
                    if (lv_addjiaoseid[i] != "")
                    {
                        DataTable dt = Hyoa_jiaose.Getdocbyid(lv_addjiaoseid[i]);
                        if (dt.Rows.Count > 0)
                        {
                            //更新对应的ROLE
                            if (dt.Rows[0]["hy_roleids"].ToString() != "")
                            {
                                string[] lv_roleid;
                                lv_roleid = dt.Rows[0]["hy_roleids"].ToString().Split(',');
                                for (int j = 0; j < lv_roleid.Length; j++)
                                {
                                    if (lv_roleid[j] != "")
                                    {
                                        Hyoa_roleuser.ID = Hyoa_global.GetRandom();
                                        Hyoa_roleuser.hy_roleid = lv_roleid[j];
                                        Hyoa_roleuser.hy_userid = this.txtuserid.Text;
                                        Hyoa_roleuser.Insert();
                                    }
                                }
                            }
                            //更新对应的flowtache
                            if (dt.Rows[0]["hy_flowtacheids"].ToString() != "")
                            {
                                string[] lv_flowtacheidid;
                                lv_flowtacheidid = dt.Rows[0]["hy_flowtacheids"].ToString().Split(',');
                                for (int j = 0; j < lv_flowtacheidid.Length; j++)
                                {
                                    if (lv_flowtacheidid[j] != "")
                                    {
                                        string ls_temp = lv_flowtacheidid[j];
                                        string[] lv_temp = ls_temp.Split('_');
                                        if (lv_temp.Length == 2)
                                        {
                                            string ls_flowid = lv_temp[0];
                                            string ls_tacheid = lv_temp[1];
                                            Hyoa_flowtacheuser.ID = Hyoa_global.GetRandom();
                                            Hyoa_flowtacheuser.hy_flowid = ls_flowid;
                                            Hyoa_flowtacheuser.hy_tacheid = ls_tacheid;
                                            Hyoa_flowtacheuser.hy_userid = this.txtuserid.Text;
                                            Hyoa_flowtacheuser.Insert();
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }
    //保存
    protected void Button_Save_Click(object sender, EventArgs e)
    {
        if (this.Session["hyuid"].ToString() == "")
            this.Response.Redirect("../login.aspx");

        string ls_tip = "保存成功!";

        //新文档时
        HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user();
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        if (this.txtop.Value == "add")
        {
            //先判断这个用户是否已经存在
            DataTable dtjudge = Hyoa_user.Getuserbyuserid(this.txtuserid.Text);
            if (dtjudge.Rows.Count > 0)
            {
                Response.Write("<script>alert('该用户名已注册,请重新注册!');history.back();</script>");
                return;
            }
            else
            {
                Hyoa_user.id = Hyoa_global.GetRandom();
                Hyoa_user.hy_loginuid = this.txtuserid.Text;
                Hyoa_user.hy_userid = this.txtuserid.Text;
                Hyoa_user.hy_deptid = this.hy_deptid.Text;
                Hyoa_user.hy_username = this.txtusername.Value;
                Hyoa_user.hy_post = this.txtposition.Value;
                Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
                Hyoa_user.hy_officetel = this.txtofficetel.Value;
                Hyoa_user.hy_hometel = this.txthometel.Value;
                Hyoa_user.hy_mobile = this.txtmobile.Value;
                Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
                Hyoa_user.hy_sort = float.Parse(this.txtuserno.Value);
                Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
                Hyoa_user.hy_createtime = System.DateTime.Now.ToString();
                Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
                Hyoa_user.hy_birthday = this.txtbirthday.Value;
                Hyoa_user.hy_ifsrtx = "";
                Hyoa_user.hy_fjh = this.txtfjh.Value;
                Hyoa_user.hy_xb = this.ddlxb.SelectedValue;
                Hyoa_user.hy_zzmm = this.txtzzmm.Value;
                Hyoa_user.hy_xl = this.txtxl.Value;
                Hyoa_user.hy_byyx = this.txtbyyx.Value;
                Hyoa_user.hy_jdwsj = this.txtjdwsj.Value;
                Hyoa_user.hy_jtzz = this.txtjtzz.Value;
                Hyoa_user.hy_sfzhm = this.txtsfzhm.Value;
                Hyoa_user.hy_bz = "";
                Hyoa_user.hy_jsids = this.txtjsids.Value;
                Hyoa_user.hy_jsnames = this.txtjsnames.Value;
                Hyoa_user.hy_field1 = "";
                Hyoa_user.hy_field2 = "";
                Hyoa_user.hy_field3 = "";
                Hyoa_user.hy_field4 = "";
                Hyoa_user.hy_field5 = "";
                Hyoa_user.Insert();

                //写新增人员系统日志start
                HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
                Hyoa_log.ID = System.Guid.NewGuid().ToString();
                Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
                string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
                if (userip == null || userip == "")
                {
                    userip = Request.ServerVariables["REMOTE_ADDR"];
                }
                Hyoa_log.hy_oppip = userip;
                Hyoa_log.hy_opptype = "新增";
                Hyoa_log.hy_oppcontent = "新增用户:" + this.txtusername.Value;
                Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
                Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
                Hyoa_log.Insert();
            }
        }
        else
        {
            Hyoa_user.id = this.txtid.Text;
            Hyoa_user.hy_loginuid = this.txtuserid.Text;
            Hyoa_user.hy_userid = this.txtuserid.Text;
            Hyoa_user.hy_deptid = this.hy_deptid.Text;
            Hyoa_user.hy_username = this.txtusername.Value;
            Hyoa_user.hy_post = this.txtposition.Value;
            Hyoa_user.hy_ifleader = this.ddlifleader.SelectedValue.ToString();
            Hyoa_user.hy_officetel = this.txtofficetel.Value;
            Hyoa_user.hy_hometel = this.txthometel.Value;
            Hyoa_user.hy_mobile = this.txtmobile.Value;
            Hyoa_user.hy_virtualnumber = this.txtvirtualtel.Value;
            Hyoa_user.hy_sort = float.Parse(this.txtuserno.Value);
            Hyoa_user.hy_isenabled = this.ddlisenabled.SelectedValue.ToString();
            Hyoa_user.hy_edittime = System.DateTime.Now.ToString();
            Hyoa_user.hy_birthday = this.txtbirthday.Value;
            Hyoa_user.hy_ifsrtx = "";
            Hyoa_user.hy_fjh = this.txtfjh.Value;
            Hyoa_user.hy_xb = this.ddlxb.SelectedValue;
            Hyoa_user.hy_zzmm = this.txtzzmm.Value;
            Hyoa_user.hy_xl = this.txtxl.Value;
            Hyoa_user.hy_byyx = this.txtbyyx.Value;
            Hyoa_user.hy_jdwsj = this.txtjdwsj.Value;
            Hyoa_user.hy_jtzz = this.txtjtzz.Value;
            Hyoa_user.hy_sfzhm = this.txtsfzhm.Value;
            Hyoa_user.hy_bz = "";
            Hyoa_user.hy_jsids = this.txtjsids.Value;
            Hyoa_user.hy_jsnames = this.txtjsnames.Value;
            Hyoa_user.hy_field1 = "";
            Hyoa_user.hy_field2 = "";
            Hyoa_user.hy_field3 = "";
            Hyoa_user.hy_field4 = "";
            Hyoa_user.hy_field5 = "";
            Hyoa_user.Update();

            //写新增人员系统日志start
            HyoaClass.Hyoa_log Hyoa_log = new HyoaClass.Hyoa_log();
            Hyoa_log.ID = System.Guid.NewGuid().ToString();
            Hyoa_log.hy_createtime = System.DateTime.Now.ToString();
            string userip = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
            if (userip == null || userip == "")
            {
                userip = Request.ServerVariables["REMOTE_ADDR"];
            }
            Hyoa_log.hy_oppip = userip;
            Hyoa_log.hy_opptype = "修改";
            Hyoa_log.hy_oppcontent = "修改用户:" + this.txtusername.Value;
            Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString();
            Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString();
            Hyoa_log.Insert();
        }

        //处理完成后的提示及跳转
        if (this.txtifpop.Value == "")
        {
            Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Value + "'</script>");
        }
        else
        {
            Response.Write("<script>alert('" + ls_tip + "');self.close();</script>");
        }
    }