//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../login.aspx"); string ls_tip = "保存成功!"; //写系统日志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_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); //新文档时 HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept(); if (this.txtop.Value == "add") { Hyoa_dept.hy_deptid = this.hy_deptid.Text; Hyoa_dept.hy_deptname = this.hy_deptname.Text; Hyoa_dept.hy_deptsort = System.Int32.Parse(this.hy_deptsort.Text.ToString()); Hyoa_dept.hy_isenabled = this.hy_isenabled.SelectedValue.ToString(); Hyoa_dept.hy_createtime = System.DateTime.Now.ToString(); Hyoa_dept.Insert(); Hyoa_log.hy_opptype = "新增"; Hyoa_log.hy_oppcontent = "新增部门:" + this.hy_deptname.Text; } else { Hyoa_dept.hy_deptid = this.txtdocid.Value; Hyoa_dept.hy_deptname = this.hy_deptname.Text; Hyoa_dept.hy_deptsort = System.Int32.Parse(this.hy_deptsort.Text.ToString()); Hyoa_dept.hy_isenabled = this.hy_isenabled.SelectedValue.ToString(); Hyoa_dept.Update(); Hyoa_log.hy_opptype = "修改"; Hyoa_log.hy_oppcontent = "修改部门:" + this.hy_deptname.Text; } 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>"); } }
private void DataPlay() { //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}"; string hy_json = ""; string ls_success = "true"; //调用方法成功 string ls_flag = "0"; //删除失败 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string txtuids = ""; if (this.Request.Form["txtuids"] != null) txtuids = this.Request.Form["txtuids"].ToString(); String[] v_uids = txtuids.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "delete from hyt_dbsy where ID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //生成删除日志 start string ls_oppcontent = "表名:hyt_dbsy;文档ID:" + v_uids[i] + "被删除。"; 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 = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end ls_flag = "1"; } } hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}"; Response.Write(hy_json); }
//protected string IPlimted() //{ //IP限制 //string lscurip, configip, lsflag; //lsflag = "0"; //lscurip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; ////return; //MagicPortalClass.DAO dbconfigip = new MagicPortalClass.DAO(); //DataTable dtconfigip = dbconfigip.GetDataTable("select * from JpConfig where fdtype='ip'"); //configip = dtconfigip.Rows[0]["fdname"].ToString(); //dtconfigip.Clear(); //dbconfigip.Close(); //string[] lvconfigip = configip.Split(','); //for (var i = 0; i < lvconfigip.Length; i++) //{ // if (lvconfigip[i].Contains("-") == true) // { // string[] lvconfigipsub = lvconfigip[i].Split('-'); // string[] lvconfigipsub1 = lvconfigipsub[0].Split('.'); // string[] lvconfigipsub2 = lvconfigipsub[1].Split('.'); // string[] lvcurip = lscurip.Split('.'); // if (lvcurip[0] == lvconfigipsub1[0] & lvcurip[1] == lvconfigipsub1[1] & lvcurip[2] == lvconfigipsub1[2] & lvcurip[0] == lvconfigipsub2[0] & lvcurip[1] == lvconfigipsub2[1] & lvcurip[2] == lvconfigipsub2[2]) // { // if ((int.Parse(lvcurip[3]) >= int.Parse(lvconfigipsub1[3]) & int.Parse(lvcurip[3]) <= int.Parse(lvconfigipsub2[3]))) // { // lsflag = "1"; // break; // } // else // { // continue; // } // } // else // { // continue; // } // } // else // { // if (lvconfigip[i] == lscurip) // { // lsflag = "1"; // break; // } // } //} //return lsflag; ////this.aaaa.Value = lscurip; ///////////IP限制结束 //} protected void btnLogin_Click(object sender, EventArgs e) { //if (Session["checkcode"].ToString().Equals(this.txt_checkcode.Value)) //{ String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_password.Value, "MD5"); HyoaClass.Hyoa_user Users = new HyoaClass.Hyoa_user(); //Response.Write("<script>alert('aaaa');</script>"); if (Users.Login(this.txt_username.Value, password)) { // Response.Write("<script>alert('bbb');</script>"); DataTable dt = Users.Getuserallinfo(this.txt_username.Value); if (dt.Rows.Count > 0) { Session["hyuid"] = this.txt_username.Value; Session["hyuname"] = dt.Rows[0]["hy_username"].ToString(); Session["hydeptid"] = dt.Rows[0]["hy_deptid"].ToString(); Session["hydeptname"] = dt.Rows[0]["hy_deptname"].ToString(); //登录日志 start string ls_oppcontent = this.Session["hyuname"].ToString() + "登录"; 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 = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //登录日志 end HyoaClass.Hyoa_license Hyoa_license = new HyoaClass.Hyoa_license(); DataTable dtlicense = Hyoa_license.Getlicensesbybsquseridanddate(this.Session["hyuid"].ToString()); if (dtlicense.Rows.Count > 0) { this.rdsqyh.DataSource = dtlicense; this.rdsqyh.DataTextField = "hy_sqrname"; this.rdsqyh.DataValueField = "hy_sqrid"; this.rdsqyh.DataBind(); this.rdsqyh.Items.Insert(0, new ListItem(this.Session["hyuname"].ToString(), this.Session["hyuid"].ToString())); this.rdsqyh.SelectedIndex = 0; this.table3.Visible = true; } else { this.Response.Redirect(this.lblurl.Text); } } dt.Clear(); } else { this.RegisterClientScriptBlock("scripterror", "<script language=javascript>alert('输入的用户名或者密码不正确!')</script>"); return; } }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //写删除人员系统日志start DataTable dtuser = Hyoa_user.Getuserbyid(v_uids[i]); //如果是admin,提示不能删除 if (dtuser.Rows[0]["hy_userid"].ToString() == "admin") { Response.Write("<script>alert('admin为超级管理员,您无法进行删除!');</script>"); return; } 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 = dtuser.Rows[0]["hy_username"].ToString() + "被删除"; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //写删除人员系统日志end Hyoa_user.id = v_uids[i]; Hyoa_user.Deletebyid(); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); String[] v_uids = this.txtuids.Value.Split(','); string ls_filepath = ""; for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "delete from hyc_" + txttableid.Value + " where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start add by xf 20121016 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cl.DeleteByDOCID(); HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cy.DeleteByDOCID(); //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end //删的时候将附件也删除start HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]); if (dtfileatt.Rows.Count > 0) { for (int k = 0; k < dtfileatt.Rows.Count; k++) { ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString(); if (File.Exists(ls_filepath)) { System.IO.File.Delete(ls_filepath); } Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString(); Hyoa_fileatt.Delete(); } } //删的时候将附件也删除end //生成删除日志 start string ls_oppcontent = "表名:hyc_" + txttableid.Value + ";文档ID:" + v_uids[i] + "被删除。"; 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 = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string ls_fssql = "select * from hyp_wjcd where hy_type='发件' and ID='" + v_uids[i] + "' "; DataTable dt_fs = Hyoa_global.GetDataTable(ls_fssql); if (dt_fs.Rows.Count > 0) { //得到属于此发件的所有收件 string ls_sjsql = "select * from hyp_wjcd where hy_type='收件' and DOCID='" + dt_fs.Rows[0]["DOCID"].ToString() + "' "; DataTable dt_sj = Hyoa_global.GetDataTable(ls_sjsql); if (dt_sj.Rows.Count > 0) { for (var j = 0; j < dt_sj.Rows.Count; j++) { //删除文档时将收件人的待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = dt_sj.Rows[j]["ID"].ToString(); Hyoa_dbsy.Deletebydocid(dt_sj.Rows[j]["ID"].ToString()); //删除文档时将收件人的待办事宜删除end //删除文档时将收件删除start string ls_sjdel = "delete from hyp_wjcd where ID='" + dt_sj.Rows[j]["ID"].ToString() + "' "; Hyoa_global.ExcuteSQL(ls_sjdel); //删除文档时将收件删除end } } } Hyoa_wjcd.ID = v_uids[i]; Hyoa_wjcd.Delete(); //生成删除日志 start string ls_oppcontent = "工作联系单(已发送的);文档ID:" + v_uids[i] + "被删除。同时该工作联系单的所有收件已删除。"; 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 = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); String[] v_uids = this.txtuids.Value.Split(','); for(var i=0;i<v_uids.Length;i++) { if (v_uids[i] != "") { //this.Response.Write("<script>alert('aaa')</script>"); //判断是否有人员 DataTable dt_dept = Hyoa_dept.Getdept(v_uids[i]); DataTable dt_user = Hyoa_user.Getusersbydeptid(v_uids[i]); if (dt_user.Rows.Count > 0) { Response.Write("<script>alert('" + dt_dept.Rows[0]["hy_deptname"].ToString() + "下存在人员,不能进行删除!');</script>"); return; } //判断是否有子部门 DataTable dt_subdept = Hyoa_dept.GetSubDepts(v_uids[i]); if (dt_subdept.Rows.Count > 0) { Response.Write("<script>alert('" + dt_dept.Rows[0]["hy_deptname"].ToString() + "下存在子部门,不能进行删除!');</script>"); return; } //写删除部门系统日志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 = "删除部门:" + dt_dept.Rows[0]["hy_deptname"].ToString(); Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); Hyoa_dept.hy_deptid = v_uids[i]; Hyoa_dept.Delete(); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
//保存 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") { Hyoa_user.id = Hyoa_global.GetRandom(); Hyoa_user.hy_loginuid = ""; 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.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 = ""; Hyoa_user.hy_jsnames = ""; 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(); } //处理完成后的提示及跳转 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 { //判断是否超过用户数限制 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>"); } }
private void DataPlay() { //hy_json = "{\"success\":true,\"total\":\"60\",\"rows\":[{\"hy_mudelid\":\"111\",\"hy_mudelname\":\"1111\",\"hy_roleid\":\"111111\",\"hy_qqroleid\":\"111111\",\"hy_isenabled\":\"111111\"}]}"; string hy_json = ""; string ls_success = "true"; //调用方法成功 string ls_flag = "0"; //删除失败 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string txtuids = ""; if (this.Request.Form["txtuids"] != null) txtuids = this.Request.Form["txtuids"].ToString(); string txttableid = ""; if (this.Request.Form["txttableid"] != null) txttableid = this.Request.Form["txttableid"].ToString(); String[] v_uids = txtuids.Split(','); string ls_filepath = ""; for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "delete from hyc_" + txttableid + " where DOCID='" + v_uids[i] + "'"; Hyoa_global.ExcuteSQL(sql); //删除文档时将待办事宜删除start HyoaClass.Hyoa_dbsy Hyoa_dbsy = new HyoaClass.Hyoa_dbsy(); Hyoa_dbsy.DOCID = v_uids[i]; Hyoa_dbsy.Deletebydocid(v_uids[i]); //删除文档时将待办事宜删除end //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy start add by xf 20121016 HyoaClass.Hyoa_flowhistoryinfo_cl Hyoa_flowhistoryinfo_cl = new HyoaClass.Hyoa_flowhistoryinfo_cl(); Hyoa_flowhistoryinfo_cl.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cl.DeleteByDOCID(); HyoaClass.Hyoa_flowhistoryinfo_cy Hyoa_flowhistoryinfo_cy = new HyoaClass.Hyoa_flowhistoryinfo_cy(); Hyoa_flowhistoryinfo_cy.DOCID = v_uids[i]; Hyoa_flowhistoryinfo_cy.DeleteByDOCID(); //删除文档对应的hyp_flowhistoryinfo_cl hyp_flowhistoryinfo_cy end //删的时候将附件也删除start HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dtfileatt = Hyoa_fileatt.GetfileattByFatherid(v_uids[i]); if (dtfileatt.Rows.Count > 0) { for (int k = 0; k < dtfileatt.Rows.Count; k++) { ls_filepath = Server.MapPath("~/") + dtfileatt.Rows[k]["hy_filepath"].ToString(); if (File.Exists(ls_filepath)) { System.IO.File.Delete(ls_filepath); } Hyoa_fileatt.ID = dtfileatt.Rows[k]["ID"].ToString(); Hyoa_fileatt.Delete(); } } //删的时候将附件也删除end //生成删除日志 start string ls_oppcontent = "表名:hyc_" + txttableid + ";文档ID:" + v_uids[i] + "被删除。"; 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 = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end ls_flag = "1"; } } hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}"; Response.Write(hy_json); }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.Hyoa_wjcd Hyoa_wjcd = new HyoaClass.Hyoa_wjcd(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { Hyoa_wjcd.ID = v_uids[i]; Hyoa_wjcd.Delete(); //生成删除日志 start string ls_oppcontent = "工作联系单(收到的);文档ID:" + v_uids[i] + "被删除。"; 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 = ls_oppcontent; Hyoa_log.hy_oppuserid = this.Session["hyuid"].ToString(); Hyoa_log.hy_oppusername = this.Session["hyuname"].ToString(); Hyoa_log.Insert(); //生成删除日志end } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }