//保存 protected void Button_Save_Click(object sender, EventArgs e) { string ls_tip = "保存成功!"; try { string[] lv_jsrsysname, lv_jsrcnname;//接收人系统名、中文名 lv_jsrsysname = this.f_ReceivesysNameList.Value.ToString().Split('+'); lv_jsrcnname = this.f_ReceiveChNameList.Value.ToString().Split('+'); HyoaClass.Hyoa_sms Hyoa_sms = new HyoaClass.Hyoa_sms(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt; for (int i = 0; i < lv_jsrsysname.Length; i++) { Hyoa_sms.ID = Hyoa_global.GetRandom(); Hyoa_sms.DOCID = Hyoa_global.GetRandom(); Hyoa_sms.hy_fsrid = this.txtdjrid.Value; Hyoa_sms.hy_fsrname = this.f_SendChName.Text; Hyoa_sms.hy_fsrsjh = this.f_SendMobileNo.Text; Hyoa_sms.hy_jsrid = lv_jsrsysname[i]; Hyoa_sms.hy_jsrname = lv_jsrcnname[i]; dt = Hyoa_user.Getuserallinfobyloginid(lv_jsrsysname[i]); if (dt.Rows.Count > 0) { Hyoa_sms.hy_jsrsjh = dt.Rows[0]["hy_mobile"].ToString(); } else { Hyoa_sms.hy_jsrsjh = lv_jsrsysname[i]; } Hyoa_sms.hy_createtime = System.DateTime.Now.ToString(); Hyoa_sms.hy_from = ""; Hyoa_sms.hy_content = this.f_smsContents.Text; Hyoa_sms.hy_isnowsend = 1; Hyoa_sms.hy_takedate = ""; Hyoa_sms.hy_taketime = ""; Hyoa_sms.hy_state = 0; Hyoa_sms.hy_tableid = "Mudelsms"; Hyoa_sms.Insert(); } } catch { } finally { //处理完成后的提示及跳转 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() { string lsydry=""; if (this.Request.QueryString["docid"] != null) { string ls_docid = this.Request.QueryString["docid"].ToString(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); string lssql = "select * from hyc_" + Request.QueryString["tableid"].ToString() + " where DOCID='" + ls_docid + "'"; DataTable dt = Hyoa_global.GetDataTable(lssql); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string lsusername = ""; if(dt.Rows.Count>0) { lsusername = ""; string[] lvhy_readuserlist; string[] lvhy_readdatelist; lvhy_readuserlist = dt.Rows[0]["hy_readuserlist"].ToString().Split(','); lvhy_readdatelist = dt.Rows[0]["hy_readdatelist"].ToString().Split(','); for (int j = 1; j < lvhy_readuserlist.Length; j++) { lsydry += "<TR height=27px>"; lsydry += "<TD align=\"center\" class=\"Tdcellright\">"+j.ToString()+"</TD>"; DataTable dtuser = Hyoa_user.Getuserallinfobyloginid(lvhy_readuserlist[j]); if (dtuser.Rows.Count > 0) { lsusername = dtuser.Rows[0]["hy_username"].ToString(); } else { lsusername = "******"; } dtuser.Clear(); lsydry += "<TD align=\"center\" class=\"Tdcellright\">" + lsusername + "</TD>"; if (lvhy_readdatelist.Length > j) { lsydry += "<TD align=\"center\" class=\"Tdcellright\">" + lvhy_readdatelist[j] + "</TD>"; } else { lsydry += "<TD align=\"center\" class=\"Tdcellright\"> </TD>"; } lsydry += "</TR>"; } } this.lblydry.Text = lsydry; } }
private void DataPlay() { //文档ID HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); if (this.Request.QueryString["tableid"] != null) { this.txttableid.Text = this.Request.QueryString["tableid"].ToString(); } if (this.Request.QueryString["flowid"] != null) { this.txtflowid.Text = this.Request.QueryString["flowid"].ToString(); } if (this.Request.QueryString["tacheid"] != null) { this.txtcurtacheid.Text = this.Request.QueryString["tacheid"].ToString(); } if (this.Request.QueryString["nexttacheids"] != null) { string pis_nexttacheids = this.Request.QueryString["nexttacheids"].ToString(); string pis_nexttachenames = this.Request.QueryString["nexttachenames"].ToString(); //-----条件流程的情况 start----- //根据模块ID得到流程信息 DataTable dt = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.txtflowid.Text, this.txtcurtacheid.Text); if (dt.Rows.Count > 0) { //给相应的域赋值 //当前环节 this.Hy_CurrTacheName_Show.Text = dt.Rows[0]["hy_curtachename"].ToString(); //后续环节 if (pis_nexttacheids != "") { string[] piv_nexttacheids = pis_nexttacheids.Split(','); string[] piv_nexttachenames = pis_nexttachenames.Split(','); for (var i = 0; i < piv_nexttacheids.Length; i++) { Hy_nexttachename.Items.Add(new ListItem(piv_nexttachenames[i], piv_nexttacheids[i])); } this.Hy_nexttachename.SelectedIndex = 0; //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值 string ls_temp_tacheid = piv_nexttacheids[0]; HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid); if (dt_getrddoissendsmsandmsg.Rows.Count > 0) { if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是") this.f_isSendsms_clr.Checked = true; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是") this.f_isSendjstx_clr.Checked = true; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是") this.f_isSendsms_cyr.Checked = true; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是") this.f_isSendjstx_cyr.Checked = true; this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString(); this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString(); } } } dt.Clear(); //后序环节处理人部门 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); //先得到后续环节处理人集合 DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { this.Hy_deptlist_clr.Items.Insert(0, "--请选择--"); ls_temp1 = ""; int t = 1; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ",")) { } else { //解决多级部门后续提交时部门显示的问题 added by xf 20131226 string ls_deptname = ""; if (dt.Rows[i]["hy_deptid"].ToString().Length == 3) { ls_deptname = dt.Rows[i]["hy_deptname"].ToString(); } else { ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString()); } this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString(); } } this.Hy_deptlist_clr.SelectedIndex = 0; } } dt.Clear(); //后序环节传阅人部门 HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept(); dt = Hyoa_dept.Getdepts(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //解决多级部门后续提交时部门显示的问题 added by xf 20131226 string ls_deptname = ""; if (dt.Rows[i]["hy_deptid"].ToString().Length == 3) { ls_deptname = dt.Rows[i]["hy_deptname"].ToString(); } else { ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString()); } this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString())); } //this.Hy_deptlist.DataSource = dt; //this.Hy_deptlist.DataTextField = "hy_deptname"; //this.Hy_deptlist.DataValueField = "hy_deptid"; //this.Hy_deptlist.DataBind(); this.Hy_deptlist.SelectedIndex = 0; } dt.Clear(); //后序环节处理人员 //先得到后续环节处理人集合 dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); //后序环节传阅人员 dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString()); if (dt.Rows.Count > 0) { this.Hy_rylist.DataSource = dt; this.Hy_rylist.DataTextField = "hy_username"; this.Hy_rylist.DataValueField = "hy_userid"; this.Hy_rylist.DataBind(); //this.Hy_rylist.SelectedIndex = 0; } dt.Clear(); //-----条件流程的情况 end----- } else { //-----非条件流程的情况 start----- //根据模块ID得到流程信息 DataTable dt = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.txtflowid.Text, this.txtcurtacheid.Text); if (dt.Rows.Count > 0) { //给相应的域赋值 //当前环节 this.Hy_CurrTacheName_Show.Text = dt.Rows[0]["hy_curtachename"].ToString(); //后续环节 this.Hy_nexttachename.DataSource = dt; this.Hy_nexttachename.DataTextField = "hy_nexttachename"; this.Hy_nexttachename.DataValueField = "hy_nexttacheid"; this.Hy_nexttachename.DataBind(); this.Hy_nexttachename.SelectedIndex = 0; //得到 后续环节的默认环节 对应的 提醒默认值,然后进行赋值 string ls_temp_tacheid = dt.Rows[0]["hy_nexttacheid"].ToString(); HyoaClass.Hyoa_flowtache Hyoa_flowtache = new HyoaClass.Hyoa_flowtache(); DataTable dt_getrddoissendsmsandmsg = Hyoa_flowtache.Getflowtachebyflowidtacheid(this.txtflowid.Text, ls_temp_tacheid); if (dt_getrddoissendsmsandmsg.Rows.Count > 0) { if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendSms"].ToString() == "是") this.f_isSendsms_clr.Checked = true; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdDoIsSendMessage"].ToString() == "是") this.f_isSendjstx_clr.Checked = true; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendSms"].ToString() == "是") this.f_isSendsms_cyr.Checked = true; if (dt_getrddoissendsmsandmsg.Rows[0]["hy_rdPassIsSendMessage"].ToString() == "是") this.f_isSendjstx_cyr.Checked = true; this.txthy_ifshowcurcomp.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurcomp"].ToString(); this.txthy_ifshowcurdept.Text = dt_getrddoissendsmsandmsg.Rows[0]["hy_ifshowcurdept"].ToString(); } } dt.Clear(); //后序环节处理人部门 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); //先得到后续环节处理人集合 DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { this.Hy_deptlist_clr.Items.Insert(0, "--请选择--"); ls_temp1 = ""; int t = 1; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_deptid"].ToString() + ",")) { } else { //解决多级部门后续提交时部门显示的问题 added by xf 20131226 string ls_deptname = ""; if (dt.Rows[i]["hy_deptid"].ToString().Length == 3) { ls_deptname = dt.Rows[i]["hy_deptname"].ToString(); } else { ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString()); } this.Hy_deptlist_clr.Items.Insert(t, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_deptid"].ToString(); } } this.Hy_deptlist_clr.SelectedIndex = 0; } } dt.Clear(); //后序环节传阅人部门 HyoaClass.Hyoa_dept Hyoa_dept = new HyoaClass.Hyoa_dept(); dt = Hyoa_dept.Getdepts(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { //解决多级部门后续提交时部门显示的问题 added by xf 20131226 string ls_deptname = ""; if (dt.Rows[i]["hy_deptid"].ToString().Length == 3) { ls_deptname = dt.Rows[i]["hy_deptname"].ToString(); } else { ls_deptname = GetAllDeptNameByDeptId(dt.Rows[i]["hy_deptid"].ToString()); } this.Hy_deptlist.Items.Insert(i, new ListItem(ls_deptname, dt.Rows[i]["hy_deptid"].ToString())); } //this.Hy_deptlist.DataSource = dt; //this.Hy_deptlist.DataTextField = "hy_deptname"; //this.Hy_deptlist.DataValueField = "hy_deptid"; //this.Hy_deptlist.DataBind(); this.Hy_deptlist.SelectedIndex = 0; } dt.Clear(); //后序环节处理人员 //先得到后续环节处理人集合 dt_nextflowuser.Clear(); dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql=""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } } dt.Clear(); //后序环节传阅人员 dt = Hyoa_user.Getusersbydeptid(this.Hy_deptlist.SelectedValue.ToString()); if (dt.Rows.Count > 0) { this.Hy_rylist.DataSource = dt; this.Hy_rylist.DataTextField = "hy_username"; this.Hy_rylist.DataValueField = "hy_userid"; this.Hy_rylist.DataBind(); //this.Hy_rylist.SelectedIndex = 0; } dt.Clear(); //-----非条件流程的情况 end----- } //----考虑只显示本单位的情况start----- if (this.txthy_ifshowcurcomp.Text == "是") { DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; ls_dept1 = ls_dept1.Substring(0, 3); string ls_curdept = Session["hydeptid"].ToString(); ls_curdept = ls_curdept.Substring(0, 3); if (ls_dept1 == ls_curdept) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } DataTable dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } dt.Clear(); } } //----考虑只显示本单位的情况end------- //----考虑只显示和登记人同单位的情况start----- if (this.txthy_ifshowcurcomp.Text == "和登记人同单位") { if (Request.QueryString["docid"] != null) { //得到登记人的部门ID string ls_djrbmid = ""; string sql = "select * from hyc_" + this.txttableid.Text+" where DOCID='" + Request.QueryString["docid"].ToString()+"'"; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString(); DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; if (ls_dept1.Substring(0, 3) == ls_djrbmid.Substring(0, 3)) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } DataTable dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } dt.Clear(); } } } } //----考虑只显示和登记人同单位的情况end------- //----考虑只显示登记人的分管领导的情况start----- if (this.txthy_ifshowcurcomp.Text == "登记人的分管领导") { if (Request.QueryString["docid"] != null) { //得到登记人的部门ID string ls_djrbmid = ""; string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'"; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { ls_djrbmid = dt_flowmain.Rows[0]["hy_djrbmid"].ToString(); DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门(登记人的分管领导(部门ID前3位不一样后边一样)) for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; if (ls_dept1.Substring(3) == ls_djrbmid.Substring(3)) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } DataTable dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } dt.Clear(); } } } } //----考虑只显示登记人的分管领导的情况end------- //----只显示登记人start----- if (this.txthy_ifshowcurdept.Text == "只显示登记人") { if (Request.QueryString["docid"] != null) { string sql = "select * from hyc_" + this.txttableid.Text + " where DOCID='" + Request.QueryString["docid"].ToString() + "'"; DataTable dt_flowmain = Hyoa_global.GetDataTable(sql); if (dt_flowmain.Rows.Count > 0) { //先清空 this.Hy_deptlist_clr.Items.Clear(); Hy_deptlist_clr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrbmname"].ToString(), dt_flowmain.Rows[0]["hy_djrbmid"].ToString())); //先清空 this.Hy_hjclr.Items.Clear(); Hy_hjclr.Items.Insert(0, new ListItem(dt_flowmain.Rows[0]["hy_djrname"].ToString(), dt_flowmain.Rows[0]["hy_djrid"].ToString())); } } } //----只显示登记人end------- //----只显示当前用户本部门人员start----- if (this.txthy_ifshowcurdept.Text == "是") { if (Request.QueryString["docid"] != null) { DataTable tempTable = new DataTable(); DataColumn col = new DataColumn("value1", typeof(String)); //定义新的一列 tempTable.Columns.Add(col); //追加一列 add DataColumn col2 = new DataColumn("value2", typeof(String)); //定义新的一列 tempTable.Columns.Add(col2); //追加一列 add //更新部门 for (var j = 0; j < this.Hy_deptlist_clr.Items.Count; j++) { string ls_dept1 = this.Hy_deptlist_clr.Items[j].Value; if (ls_dept1 == Session["hydeptid"].ToString()) { DataRow dr = tempTable.NewRow(); dr["value1"] = Hy_deptlist_clr.Items[j].Text; dr["value2"] = Hy_deptlist_clr.Items[j].Value; tempTable.Rows.Add(dr); } } //先清空 this.Hy_deptlist_clr.Items.Clear(); this.Hy_deptlist_clr.DataSource = tempTable; this.Hy_deptlist_clr.DataTextField = "value1"; this.Hy_deptlist_clr.DataValueField = "value2"; this.Hy_deptlist_clr.DataBind(); this.Hy_hjclr.Items.Clear(); //在调用这个部门对应的人员 HyoaClass.Hyoa_flowtacheuser Hyoa_flowtacheuser = new HyoaClass.Hyoa_flowtacheuser(); DataTable dt_nextflowuser = Hyoa_flowtacheuser.Getflowtacheusersbyflowidtacheid(this.txtflowid.Text, this.Hy_nexttachename.SelectedValue.ToString()); if (dt_nextflowuser.Rows.Count > 0) { string ls_temp1 = ""; for (int i = 0; i < dt_nextflowuser.Rows.Count; i++) { ls_temp1 += "," + dt_nextflowuser.Rows[i]["hy_userid"].ToString(); } ls_temp1 += ","; string sql = ""; if (this.Hy_deptlist_clr.SelectedValue.ToString() == "--请选择--") { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT(CONCAT('%,',b.hy_userid),',%') order by a.hy_deptsort,b.hy_sort"; } } else { if (Session["conntype"].ToString() == "SQL") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like '%,'+b.hy_userid+',%' and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } if (Session["conntype"].ToString() == "ORACLE") { sql = "select * from hyt_dept a,hyt_user b where a.hy_deptid=b.hy_deptid and '" + ls_temp1 + "' like CONCAT('%,',b.hy_userid),',%') and b.hy_deptid='" + this.Hy_deptlist_clr.SelectedValue.ToString() + "' order by a.hy_deptsort,b.hy_sort"; } } DataTable dt = Hyoa_global.GetDataTable_USER(sql); if (dt.Rows.Count > 0) { ls_temp1 = ""; int t = 0; for (int i = 0; i < dt.Rows.Count; i++) { if ((ls_temp1 + ",").Contains("," + dt.Rows[i]["hy_userid"].ToString() + ",")) { } else { this.Hy_hjclr.Items.Insert(t, new ListItem(dt.Rows[i]["hy_username"].ToString(), dt.Rows[i]["hy_userid"].ToString())); t += 1; ls_temp1 += "," + dt.Rows[i]["hy_userid"].ToString(); } } } dt.Clear(); } } } //----只显示当前用户本部门人员end------- //----自动传阅 start------------ DataTable dt_zdcy = Hyoa_flowwork.Getflowworkbyflowidtacheidnexttacheid(this.txtflowid.Text, this.txtcurtacheid.Text, this.Hy_nexttachename.SelectedValue); if (dt_zdcy.Rows.Count > 0) { if (dt_zdcy.Rows[0]["hy_zdcyuserids"] != null) { if (dt_zdcy.Rows[0]["hy_zdcyuserids"].ToString() != "") { int ii=0; //自动加载 string[] lv_zdcyuserids = dt_zdcy.Rows[0]["hy_zdcyuserids"].ToString().Split(','); for (int i = 0; i < lv_zdcyuserids.Length; i++) { //根据系统名得到中文名 DataTable dt_user = Hyoa_user.Getuserallinfobyloginid(lv_zdcyuserids[i]); if (dt_user.Rows.Count > 0) { this.Hy_selectedcyr.Items.Insert(ii, new ListItem(dt_user.Rows[0]["hy_username"].ToString(), lv_zdcyuserids[i])); ii = ii + 1; } } } } } //----自动传阅 end------------ }
private void DataPlay() { HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); this.btn_submit.Visible = true; //保存 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); string ls_att = ""; this.lbupfile.Text = "无附件!"; string lshy_fatherfield = ""; if (this.Request.QueryString["fatherfield"] != null) { lshy_fatherfield = this.Request.QueryString["fatherfield"].ToString(); //父文档配置的域名 } if (this.Request.QueryString["fatherid"] != null) { DataTable dt = Hyoa_fileatt.GetfileattByFatheridandFatherfield(this.Request.QueryString["fatherid"].ToString(), lshy_fatherfield); //是否弹出窗口 if (dt.Rows.Count > 0) { for(int j=0;j<dt.Rows.Count;j++) { DataTable dt_user = Hyoa_user.Getuserallinfobyloginid(dt.Rows[j]["hy_userid"].ToString()); ls_att += "<input type='checkbox' name='docids' value='" + dt.Rows[j]["ID"].ToString() + "'>" + "<a href=\"" + "\\" + dt.Rows[j]["hy_filepath"].ToString() + "\" target=_blank>" + dt.Rows[j]["hy_filename"].ToString() + "(上传人:" + dt_user.Rows[0]["hy_username"].ToString() + " 时间:" + dt.Rows[j]["hy_djsj"].ToString() + ")" + "</a><br />"; } this.lbupfile.Text = ls_att + "<br />"; this.lbupfile.Text += "<input type=\"button\" onclick=\"delfileatt();\" value=\" 删 除\" class=btn7 name=\"Button_Return\" /><font color=red>(只能删除自己上传的附件)</font>"; } } }
private void DataPlay() { this.btn_submit.Visible = true; //保存 this.txtdjrid.Value = this.Session["hyuid"].ToString(); this.f_SendChName.Text = this.Session["hyuname"].ToString(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt2 = Hyoa_user.Getuserallinfobyloginid(this.txtdjrid.Value); this.f_SendMobileNo.Text = dt2.Rows[0]["hy_mobile"].ToString(); }
protected void WebPageOpen() { Session["hyuid"] = ""; Session["hyuname"] = ""; Session["hydeptid"] = ""; Session["hydeptname"] = ""; Session["hydeptids_jz"] = ""; Session["hydeptnames_jz"] = ""; Session["hyisadmin"] = ""; Session["hypost"] = ""; Session["mystyle"] = ""; Session["conntype"] = System.Configuration.ConfigurationManager.AppSettings["HYOA_CONNTYPE"].ToString(); string ls_uid = ""; string ls_pwd = ""; string ls_key = ""; string ls_url = ""; if (this.Request.QueryString["uid"] != null) { ls_uid = this.Request.QueryString["uid"].ToString(); ls_uid = ls_uid.ToLower(); } if (this.Request.QueryString["pwd"] != null) { ls_pwd = this.Request.QueryString["pwd"].ToString(); ls_pwd = ls_pwd.ToLower(); } if (this.Request.QueryString["key"] != null) ls_key = this.Request.QueryString["key"].ToString(); int pos = Request.RawUrl.IndexOf("&redirectto="); if (pos > 0) ls_url = this.Request.RawUrl.Substring(pos + 12); //if (ls_key != "cd04fa144ec48507") // Response.Write("<script language=javascript>alert('非常抱歉,您的访问地址有误,请联系管理员!');self.close();</script>"); String password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(ls_pwd, "MD5"); HyoaClass.Hyoa_user Users = new HyoaClass.Hyoa_user(); if (Users.Login(ls_uid, password)) { DataTable dt = Users.Getuserallinfobyloginid(ls_uid); if (dt.Rows.Count > 0) { Session["hyuid"] = ls_uid; Session["hyuname"] = dt.Rows[0]["hy_username"].ToString(); Session["hydeptid"] = dt.Rows[0]["hy_deptid"].ToString(); Session["hydeptname"] = dt.Rows[0]["hy_deptname"].ToString(); Session["hypost"] = dt.Rows[0]["hy_post"].ToString(); //得到兼职 DataTable dt_jz = Users.Getjzinfobyuserid(ls_uid); if (dt_jz.Rows.Count > 0) { Session["hydeptids_jz"] = ""; Session["hydeptnames_jz"] = ""; for (int ii = 0; ii < dt_jz.Rows.Count; ii++) { if (Session["hydeptids_jz"] == "") { Session["hydeptids_jz"] = dt_jz.Rows[ii]["hy_deptid"].ToString(); Session["hydeptnames_jz"] = dt_jz.Rows[ii]["hy_deptname"].ToString(); } else { Session["hydeptids_jz"] += "," + dt_jz.Rows[ii]["hy_deptid"].ToString(); Session["hydeptnames_jz"] += "," + dt_jz.Rows[ii]["hy_deptname"].ToString(); } } } //得到风格 HyoaClass.Hyoa_mystyle Hyoa_mystyle = new HyoaClass.Hyoa_mystyle(); DataTable dt_mystyle = Hyoa_mystyle.Getstylebyuserid(ls_uid); if (dt_mystyle.Rows.Count > 0 && dt_mystyle.Rows[0]["hy_style"].ToString() != "") Session["mystyle"] = dt_mystyle.Rows[0]["hy_style"].ToString(); else Session["mystyle"] = "/hyhtml/images/"; this.Response.Redirect(ls_url); } dt.Clear(); } else { this.Response.Redirect("../"); return; } }
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"; //登录失败 string username = ""; string password = ""; username = this.Request.Form["txt_username"].ToString().ToLower(); password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.Request.Form["txt_password"].ToString(), "MD5"); HyoaClass.Hyoa_user Users = new HyoaClass.Hyoa_user(); if (Users.Login(username, password)) { DataTable dt = Users.Getuserallinfobyloginid(username); if (dt.Rows.Count > 0) { if (dt.Rows[0]["hy_isenabled"].ToString() == "否") { //账号被禁用了 } else { Session["hyuid"] = username; Session["hyuname"] = dt.Rows[0]["hy_username"].ToString(); Session["hydeptid"] = dt.Rows[0]["hy_deptid"].ToString(); Session["hydeptname"] = dt.Rows[0]["hy_deptname"].ToString(); Session["hypost"] = dt.Rows[0]["hy_post"].ToString(); //得到兼职 DataTable dt_jz = Users.Getjzinfobyuserid(username); if (dt_jz.Rows.Count > 0) { Session["hydeptids_jz"] = ""; Session["hydeptnames_jz"] = ""; for (int i = 0; i < dt_jz.Rows.Count; i++) { if (Session["hydeptids_jz"] == "") { Session["hydeptids_jz"] = dt_jz.Rows[i]["hy_deptid"].ToString(); Session["hydeptnames_jz"] = dt_jz.Rows[i]["hy_deptname"].ToString(); } else { Session["hydeptids_jz"] += "," + dt_jz.Rows[i]["hy_deptid"].ToString(); Session["hydeptnames_jz"] += "," + dt_jz.Rows[i]["hy_deptname"].ToString(); } } } //得到风格 HyoaClass.Hyoa_mystyle Hyoa_mystyle = new HyoaClass.Hyoa_mystyle(); DataTable dt_mystyle = Hyoa_mystyle.Getstylebyuserid(username); if (dt_mystyle.Rows.Count > 0 && dt_mystyle.Rows[0]["hy_style"].ToString() != "") Session["mystyle"] = dt_mystyle.Rows[0]["hy_style"].ToString(); else Session["mystyle"] = "/hyhtml/images/"; //Session["jqmtheme"] = this.Request.Form["ddlfengge"].ToString(); ls_flag = "1"; } } } hy_json = "{\"success\":" + ls_success + ",\"flag\":\"" + ls_flag + "\"}"; Response.Write(hy_json); }
/// <summary> /// 认证模式,密码是明码格式还是MD5格式 /// pi_type 0:密码是明码格式 1:密码是MD5格式 /// </summary> /// <param name="pi_type"></param> private void LoginCommand(string pi_type) { //if (Session["checkcode"].ToString().Equals(this.txt_checkcode.Value)) String password = ""; if (pi_type == "0") { password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(this.txt_password.Value, "MD5"); } if (pi_type == "1") { password = this.txt_password.Value.ToUpper(); } HyoaClass.Hyoa_user Users = new HyoaClass.Hyoa_user(); if (Users.Login(this.txt_username.Value.ToLower(), password)) { DataTable dt = Users.Getuserallinfobyloginid(this.txt_username.Value.ToLower()); if (dt.Rows.Count > 0) { if (dt.Rows[0]["hy_isenabled"].ToString() == "否") { //账号被禁用了 Response.Write("<script>alert('该账号已被禁用,请联系管理员!');</script>"); } else { Session["hyuid"] = this.txt_username.Value.ToLower(); Session["hyuname"] = dt.Rows[0]["hy_username"].ToString(); Session["hydeptid"] = dt.Rows[0]["hy_deptid"].ToString(); Session["hydeptname"] = dt.Rows[0]["hy_deptname"].ToString(); Session["hypost"] = dt.Rows[0]["hy_post"].ToString(); //得到兼职 DataTable dt_jz = Users.Getjzinfobyuserid(this.txt_username.Value.ToLower()); if (dt_jz.Rows.Count > 0) { Session["hydeptids_jz"] = ""; Session["hydeptnames_jz"] = ""; for (int i = 0; i < dt_jz.Rows.Count; i++) { if (Session["hydeptids_jz"] == "") { Session["hydeptids_jz"] = dt_jz.Rows[i]["hy_deptid"].ToString(); Session["hydeptnames_jz"] = dt_jz.Rows[i]["hy_deptname"].ToString(); } else { Session["hydeptids_jz"] += "," + dt_jz.Rows[i]["hy_deptid"].ToString(); Session["hydeptnames_jz"] += "," + dt_jz.Rows[i]["hy_deptname"].ToString(); } } } //得到风格 HyoaClass.Hyoa_mystyle Hyoa_mystyle = new HyoaClass.Hyoa_mystyle(); DataTable dt_mystyle = Hyoa_mystyle.Getstylebyuserid(this.txt_username.Value.ToLower()); if (dt_mystyle.Rows.Count > 0 && dt_mystyle.Rows[0]["hy_style"].ToString() != "") Session["mystyle"] = dt_mystyle.Rows[0]["hy_style"].ToString(); else Session["mystyle"] = "/hyhtml/images/"; HyoaClass.Hyoa_license Hyoa_license = new HyoaClass.Hyoa_license(); DataTable dtlicense = Hyoa_license.Getlicensesbybsquseridanddate(this.Session["hyuid"].ToString()); if (dtlicense.Rows.Count > 0) { ifshowopengwsq.Text = "1"; } else { //////为用户创建一个票证,并将其放入cookie或者url中(具体看你怎么设置票证的保存方式) ////FormsAuthentication.SetAuthCookie(this.txt_username.Value, true); this.Response.Redirect(this.lblurl.Text); } } } dt.Clear(); } else { this.RegisterClientScriptBlock("scripterror", "<script language=javascript>alert('输入的用户名或者密码不正确!')</script>"); return; } }