//获取投票数量的比例 public string GetItemproportion(string pis_xxid, Boolean bl) { string rValue; HyoaClass.DAO db = new HyoaClass.DAO(); //总参与投票数 double ls_tpall; string ls_sql1 = " Select * from hyk_whzx_tpgl_tpmx where hy_tpztid ='" + this.txtdocid.Value + "' "; DataTable dt1 = db.GetDataTable(ls_sql1); ls_tpall = dt1.Rows.Count; //得到某一个选项投票数 double ls_tpxx; string ls_sql2 = " Select * from hyk_whzx_tpgl_tpmx where hy_tpztid ='" + this.txtdocid.Value + "' and hy_tpxxid ='" + pis_xxid + "' "; DataTable dt2 = db.GetDataTable(ls_sql2); ls_tpxx = dt2.Rows.Count; double ls_num = 0.0; if (ls_tpxx != 0) { ls_num = (ls_tpxx / ls_tpall) * 100; } if (bl) { rValue = ls_num.ToString("#0.#0") + "%"; } else { rValue = ls_num.ToString("#0.#0"); } dt1.Clear(); dt2.Clear(); db.Close(); return rValue; }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() =="") this.Response.Redirect("/login.aspx"); if (!IsPostBack) { string lstr = ""; HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "select * from hyp_flowmain where hy_mudelid = 'clgl' and hy_tableid='0b5c53fe-114b-4fa3-8b59-4163b3053504'"; if (this.Request.QueryString["startdate"] != null) { if (this.Request.QueryString["startdate"].ToString() != "") { lssql += " and hy_field31>='" + this.Request.QueryString["startdate"].ToString() + "'"; } } if (this.Request.QueryString["enddate"] != null) { if (this.Request.QueryString["enddate"].ToString() != "") { lssql += " and hy_field31<='" + this.Request.QueryString["enddate"].ToString() + "'"; } } if (this.Request.QueryString["hy_field1"] != null) { if (this.Request.QueryString["hy_field1"].ToString() != "") { lssql += " and hy_field1 like '%" + this.Request.QueryString["hy_field1"].ToString() + "%'"; } } lssql += " order by hy_field31 desc"; DataTable dt = db.GetDataTable(lssql); for (int i = 0; i < dt.Rows.Count; i++) { lstr += "<TR >"; lstr += "<td >" + dt.Rows[i]["hy_field1"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field2"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field3"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field4"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field5"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field6"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field7"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field8"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field9"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field10"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field11"].ToString() + "</td>"; lstr += "<td >" + dt.Rows[i]["hy_field12"].ToString() + "</td>"; lstr += "</tr>"; } this.lbltr.Text = lstr; db.Close(); } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //新文档时 string lscolunid = "", sql = ""; HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.DAO db = new HyoaClass.DAO(); if (this.txtselcolid.Value =="") { Response.Write("<script>alert('请选择查询的字段!');window.location.href = window.location.href;</script>"); return; } if (this.txtop.Value == "add") { //判断是否重复 string sql1 = "select * from hyt_searchconfig where hy_mudelid='" + this.ddlmudelid.SelectedValue + "' and hy_tableid='" + this.ddltableid.SelectedValue + "'"; DataTable dt = db.GetDataTable(sql1); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该模块已添加,请修改!');window.location.href = window.location.href;</script>"); return; } lscolunid = Hyoa_global.GetRandom(); sql = "insert into hyt_searchconfig (ID,hy_mudelid,hy_tableid,hy_sort,hy_columnshowid,hy_columnshow,hy_ifsearch,hy_xszdid,hy_xszd,hy_kckry,hy_kckryid) values ("; sql += "'" + lscolunid + "','" + this.ddlmudelid.SelectedValue + "','" + this.ddltableid.SelectedValue + "'," + float.Parse(this.txtsort.Text) + ""; sql += ",'" + this.txtselcolid.Value + "','" + this.txtselcol.Value + "','" + this.ddlifsearch.SelectedValue + "'"; sql += ",'" + this.txtselsearchid.Value + "','" + this.txtselsearch.Value + "','" + this.hy_field41_1.Value + "','" + this.hy_field43_1.Value + "')"; db.Execute(sql); } else { sql = "update hyt_searchconfig set hy_mudelid='" + this.ddlmudelid.SelectedValue + "', hy_tableid='" + this.ddltableid.SelectedValue + "',"; sql += "hy_sort=" + float.Parse(this.txtsort.Text) + ",hy_columnshowid='" + this.txtselcolid.Value + "',hy_columnshow='" + this.txtselcol.Value + "',"; sql += " hy_ifsearch='" + this.ddlifsearch.SelectedValue + "',hy_xszdid='" + this.txtselsearchid.Value + "',hy_xszd='" + this.txtselsearch.Value + "', "; sql += " hy_kckry='" + this.hy_field41_1.Value + "',hy_kckryid='" + this.hy_field43_1.Value + "' where ID='" + this.txtdocid.Value + "'"; db.Execute(sql); } db.Close(); //处理完成后的提示及跳转 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 btndelinfo_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sql = "delete from hyt_searchconfig where ID='" + v_uids[i] + "'"; db.Execute(sql); } } db.Close(); this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void Page_Load(object sender, EventArgs e) { string ls_mudelid=""; string ls_tableid = ""; string ls_value = ""; if (this.Request.QueryString["mudelid"] != null) { ls_mudelid = this.Request.QueryString["mudelid"].ToString(); } if (this.Request.QueryString["tableid"] != null) { ls_tableid = this.Request.QueryString["tableid"].ToString(); } if (this.Request.QueryString["lsvalue"] != null) { ls_value = this.Request.QueryString["lsvalue"].ToString(); //物品名称 } HyoaClass.DAO db = new HyoaClass.DAO(); //string lssql = "select b.hy_deptname,a.hy_officetel,a.hy_mobile,a.hy_virtualnumber,a.hy_userid,a.hy_post,a.hy_hometel from hyt_user as a ,hyt_dept as b where a.hy_username='******' and a.hy_deptid=b.hy_deptid"; string lssql = "select * from hyt_user as a ,hyt_dept as b where a.hy_username='******' and a.hy_deptid=b.hy_deptid"; DataTable dt = db.GetDataTable(lssql); if (dt.Rows.Count > 0) { string lssql2 = "select * from hyt_user_detail where hy_userid='" + dt.Rows[0]["hy_userid"].ToString() + "'"; DataTable dt2 = db.GetDataTable(lssql2); if (dt2.Rows.Count > 0) { this.Response.Write(dt.Rows[0]["hy_deptname"].ToString() + "#" + dt.Rows[0]["hy_officetel"].ToString() + "#" + dt.Rows[0]["hy_mobile"].ToString() + "#" + dt.Rows[0]["hy_virtualnumber"].ToString() + "#" + dt.Rows[0]["hy_userid"].ToString() + "#" + dt.Rows[0]["hy_post"].ToString() + "#" + dt.Rows[0]["hy_hometel"].ToString() + "#" + dt2.Rows[0]["hy_xb"].ToString() + "#" + dt2.Rows[0]["hy_zzmm"].ToString() + "#" + dt2.Rows[0]["hy_xl"].ToString()); } else { this.Response.Write(dt.Rows[0]["hy_deptname"].ToString() + "#" + dt.Rows[0]["hy_officetel"].ToString() + "#" + dt.Rows[0]["hy_mobile"].ToString() + "#" + dt.Rows[0]["hy_virtualnumber"].ToString() + "#" + dt.Rows[0]["hy_userid"].ToString() + "#" + dt.Rows[0]["hy_post"].ToString() + "#" + dt.Rows[0]["hy_hometel"].ToString() + "###"); } } else { this.Response.Write(""); } db.Close(); //return ; }
protected void Page_Load(object sender, EventArgs e) { string ls_value = ""; if (this.Request.QueryString["lsvalue"] != null) { ls_value = this.Request.QueryString["lsvalue"].ToString(); } HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "select * from hyt_user as a ,hyt_dept as b where a.hy_username='******' and a.hy_deptid=b.hy_deptid"; DataTable dt = db.GetDataTable(lssql); string ls_str = ""; if (dt.Rows.Count > 0) { ls_str = dt.Rows[0]["hy_deptname"].ToString() + "," + dt.Rows[0]["hy_deptid"].ToString(); } this.Response.Write(ls_str); db.Close(); }
protected void btndelinfo_Click(object sender, EventArgs e) { //HyoaClass.Hyoa_iplimit Hyoa_iplimit = new HyoaClass.Hyoa_iplimit(); HyoaClass.DAO db = new HyoaClass.DAO(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //Hyoa_iplimit.ID = v_uids[i]; //Hyoa_iplimit.Delete(); string lssql = "delete from hyp_flowmain where hy_mudelid ='moduleqjzl' and hy_tableid='ac5e8ddd-d74c-4c9d-b0bf-5c23fc77b589' and DOCID='" + v_uids[i] + "'"; db.Execute(lssql); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); db.Close(); }
protected void Page_Load(object sender, EventArgs e) { if(Request.QueryString["key"]!=null) { string ls_key = ""; ls_key = Request.QueryString["key"].ToString(); DataTable dt; string sql = "select * from hyt_user where hy_userid like '%" + ls_key + "%'"; HyoaClass.DAO db = new HyoaClass.DAO(); dt = db.GetDataTable(sql); string ls_name = ""; this.Response.Write("<div align=left id=sampleLayer style=\"position:absolute; top:130px; left:240px; width:250px; height:100px; background:#EEEEEE; overflow:scroll; border: 1px solid #919191; font-family:Verdana; font-size:8pt\">"); for (int i = 0; i < dt.Rows.Count; i++) { ls_name = ls_name + dt.Rows[i]["hy_userid"].ToString(); this.Response.Write("<li><a href=\"#\" onclick=\"if(document.forms[0].txthy_jsrname.value==''){document.forms[0].txthy_jsrname.value='" + dt.Rows[i]["hy_username"].ToString() + "';document.forms[0].txthy_jsrid.value='" + dt.Rows[i]["hy_userid"].ToString() + "';}else{document.forms[0].txthy_jsrname.value=document.forms[0].txthy_jsrname.value+'+" + dt.Rows[i]["hy_username"].ToString() + "';document.forms[0].txthy_jsrid.value=document.forms[0].txthy_jsrid.value+'+" + dt.Rows[i]["hy_userid"].ToString() + "';} document.all('sampleLayer').style.visibility='hidden'; \">" + dt.Rows[i]["hy_username"].ToString() + "</a></li>"); } this.Response.Write("</div>"); db.Close(); return; } }
//得到某一个字段的HTML Written by xf 20110515 //pi_flag 0:不赋值 1:需赋值 //ifsearch:是否查询时使用 0:非查询时使用 1:查询时使用 //docid:旧文档使用时,文档ID,新文档则为空就可以 //ifhavarole:是否有权限 0:lable输出 1:input输出 public string GetFieldHtml(string hy_mudelid, string hy_fieldid, string pi_flag, string hy_tableid, string ifsearch, string docid, string ifhavarole) { HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(hy_mudelid, hy_fieldid, hy_tableid); HyoaClass.DAO db = new HyoaClass.DAO(); string lsField = ""; string field_css = ""; string field_value = ""; string field_functionhy_onclick = ""; string field_functionhy_ondblclick = ""; string field_functionhy_onchange = ""; string field_functionhy_onkeydown = ""; string field_functionhy_onkeyup = ""; string field_wordlimit = ""; if (dtfield.Rows.Count > 0) { //得到该字段的样式start if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { if (ifsearch == "0") field_css += " readonly "; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { field_css += " class='" + dtfield.Rows[0]["hy_class"].ToString() + "' "; } if (dtfield.Rows[0]["hy_width"].ToString() != "") { field_css += " style='width:" + dtfield.Rows[0]["hy_width"].ToString() + ";"; } else { field_css += " style='"; } if (dtfield.Rows[0]["hy_height"].ToString() != "") { field_css += " height:" + dtfield.Rows[0]["hy_height"].ToString() + "'"; } else { field_css += "'"; } //得到字数限制 if (dtfield.Rows[0]["hy_wordlimit"].ToString() != "") { field_wordlimit += " maxlength='" + dtfield.Rows[0]["hy_wordlimit"].ToString() + "' "; } //默认值 //默认值取值的方式,查询时不使用默认值 if (ifsearch == "0") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0") field_value += dtfield.Rows[0]["hy_defaultvalue"].ToString(); if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1") { DataTable dtdefault = db.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString()); if (dtdefault.Rows.Count > 0) field_value += dtdefault.Rows[0][0].ToString(); } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2") { field_value += Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString(); } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3") { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") field_value += System.DateTime.Now.ToShortDateString(); else field_value += System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } //自动生成值的情况 Added by xf 20110719 if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4") { if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { //得到目前最大的数值,然后+1,未找到则赋值为1 HyoaClass.DAO db_autovalue = new HyoaClass.DAO(); DataTable dt_autovalue = db_autovalue.GetDataTable("select max(hy_field36) as maxint from hyp_flowmain where hy_tableid='" + dtfield.Rows[0]["hy_tableid"].ToString() + "'"); if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "") field_value += "1"; else field_value += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString(); } else { field_value += System.Guid.NewGuid().ToString(); } } } } //事件 if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { field_functionhy_onclick += " onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { field_functionhy_ondblclick += " ondblclick=\"" + dtfield.Rows[0]["hy_ondblclick"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { field_functionhy_onchange += " onchange=\"" + dtfield.Rows[0]["hy_onchange"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { field_functionhy_onkeydown += " onkeydown=\"" + dtfield.Rows[0]["hy_onkeydown"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { field_functionhy_onkeyup += " onkeyup=\"" + dtfield.Rows[0]["hy_onkeyup"].ToString() + "\" "; } //得到该字段的样式end string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString(); //是否需要赋值,如果需要赋值,得到当前字段对应的值(日期型需要根据格式进行转换) string field_docvalue = ""; //this.Response.Write("<script>alert('" + pi_flag + "');</script>"); if (pi_flag == "1") { HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); DataTable dt_flowmain = Hyoa_flowmain.Getflowmain(docid); if (dt_flowmain.Rows.Count > 0) { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") { field_docvalue = System.DateTime.Parse(dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString()).ToShortDateString(); } else { //如果SQL为数值的字段部分,则需要截取小数点后边两位 if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值") { if (dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString().Contains(".") == true) field_docvalue = float.Parse(dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString()).ToString("F2"); else field_docvalue = dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString(); } else { field_docvalue = dt_flowmain.Rows[0][dtfield.Rows[0]["hy_sqlfield"].ToString()].ToString(); } } } } //如果没有权限,直接输出lable //this.Response.Write("<script>alert('" + ifhavarole + "');</script>"); if (ifhavarole == "0") { //痕迹保留 if (field_type == "痕迹保留") { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } else { //附件组件 if (field_type == "附件组件") { //根据docid得到目前已上传的附件信息 HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid); if (dt_fileatt.Rows.Count > 0) { for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++) { string ls_name = ""; DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString()); if (dt_user.Rows.Count > 0) { ls_name = dt_user.Rows[0]["hy_username"].ToString(); } lsField += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + " " + ls_name + " [" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "</a><br />"; } } else { lsField += " "; } } else { //ztmztmztm2start if (field_docvalue.Length > 8) { if (field_docvalue.Substring(0, 8) == "1900-1-1") { field_docvalue = " "; } } //ztmztmztm2end lsField = field_docvalue + " "; } } } else { //单行文本 if (field_type == "文本") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } //多行文本 if (field_type == "多行文本") { //格式化内容,将<br>转为/n if (field_docvalue.Contains("<br>")) field_docvalue = field_docvalue.Replace("<br>", "\n"); if (pi_flag == "0") lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + field_wordlimit + " >" + field_value + "</textarea>"; else lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + field_wordlimit + " >" + field_docvalue + "</textarea>"; } //日期 if (field_type == "日期") { //this.Response.Write("<script>alert('aaaaaa');</script>"); //this.Response.Write("<script>alert('" + pi_flag + "');</script>"); if (ifsearch == "0") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else { //add ztm3 start if (field_docvalue.Length > 7) { if (field_docvalue.Substring(0, 8) == "1900-1-1") { field_docvalue = ""; } } //add ztm3 end lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } } else { //this.Response.Write("<script>alert('aaaa');</script>"); lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">至"; lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">"; } } //文本加按钮 if (field_type == "文本加按钮") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\"> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\"> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; } //多行文本加按钮 if (field_type == "多行文本加按钮") { //格式化内容,将<br>转为/n if (field_docvalue.Contains("<br>")) field_docvalue = field_docvalue.Replace("<br>", "\n"); if (pi_flag == "0") lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_wordlimit + " " + field_css + " >" + field_value + "</textarea> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; else lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_wordlimit + " " + field_css + " >" + field_docvalue + "</textarea> <input type=button id=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" name=\"btn_" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "\" value=" + dtfield.Rows[0]["hy_fieldname"].ToString() + " class=btn3 " + field_functionhy_onclick + " >"; } //数值 if (field_type == "数值") { if (ifsearch == "0") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } else { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">到"; lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + field_wordlimit + " value=\"" + field_value + "\">"; } } //对话框列表(下拉框 if (field_type == "对话框列表") { lsField = "<select name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onchange + field_css + "> "; //第一项:请选择 lsField += "<option value=''>--请选择--</option>"; //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (pi_flag == "0") { lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>"; } else { if (field_docvalue == lv_options[ii].ToString()) lsField += "<option value='" + lv_options[ii].ToString() + "' selected>" + lv_options[ii].ToString() + "</option>"; else lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>"; } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (pi_flag == "0") { lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>"; } else { if (field_docvalue == dtoptions.Rows[ii][0].ToString()) lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "' selected>" + dtoptions.Rows[ii][0].ToString() + "</option>"; else lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>"; } } } } lsField += "</select>"; } //复选框 if (field_type == "复选框") { //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (pi_flag == "0") { if (field_value == lv_options[ii].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } else { if (field_docvalue.Contains(lv_options[ii].ToString())) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (pi_flag == "0") { if (field_value == dtoptions.Rows[ii][0].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } else { if (field_docvalue.Contains(dtoptions.Rows[ii][0].ToString())) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } } } } } //单选框 if (field_type == "单选框") { //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (pi_flag == "0") { if (field_value == lv_options[ii].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } else { if (field_docvalue == lv_options[ii].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (pi_flag == "0") { if (field_value == dtoptions.Rows[ii][0].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } else { if (field_docvalue == dtoptions.Rows[ii][0].ToString()) lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1_" + ii.ToString() + "\" " + field_functionhy_onclick + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } } } } } //口令 if (field_type == "口令") { if (pi_flag == "0") lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_value + "\">"; else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + field_wordlimit + " value=\"" + field_docvalue + "\">"; } //附件组件 if (field_type == "附件组件") { lsField = ""; //根据docid得到目前已上传的附件信息 HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt(); DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatherid(docid); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); if (dt_fileatt.Rows.Count > 0) { for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++) { string ls_name = ""; DataTable dt_user = Hyoa_user.Getuser(dt_fileatt.Rows[ii]["hy_userid"].ToString()); if (dt_user.Rows.Count > 0) { ls_name = dt_user.Rows[0]["hy_username"].ToString(); } lsField += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a> " + ls_name + " [" + dt_fileatt.Rows[ii]["hy_djsj"].ToString() + "]" + "<br />"; } } lsField += "<input type=button id=\"uploadfile1\" value='附件管理' class=btn3 onclick=\"window.open('/ggdy/main_fileatt.aspx?fatherid=" + docid + "','newwindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no');\" "; } //说明文字 if (field_type == "说明文字") { lsField = "<span id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\">" + field_value + "</span>"; } //编辑器 if (field_type == "编辑器") { //lsField = "<textarea name=\"hy_content1_1\" id=\"hy_content1_1\" style=\"display:none\" runat="server">" + field_docvalue + "</textarea>"; lsField += "<iframe ID=\"eWebEditor1\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "&style=Portal\" frameborder=\"0\" scrolling=\"no\" width=\"100%\" height=\"350\"></iframe>"; } //痕迹保留 //this.Response.Write("<script>alert('" + field_type + "');</script>"); if (field_type == "痕迹保留") { //判断是否为第一环节 HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork(); DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*"); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text) { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=1&jsxd=0','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } else { //判断是否为最后一个环节 dtflowwork.Clear(); dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text); if (dtflowwork.Rows.Count > 0) { if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**") { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=0&jsxd=1','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } else { lsField += "<input type=button id=\"btn_zwxg\" value='正 文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + docid + "&tacheByhj=0&jsxd=0','newwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" "; } } } } } } db.Close(); } return lsField; }
//旧文档OPEN时的特殊处理 private void hywebopen_olddoc() { //办公系统效能分析添加 add by wjs at 20150604 hyXnxtSaveLogs("", "阅读一篇文章", "阅读"); // hyXnxtFlowLogs("从" + this.hy_curtachename.Text + "环节提交到环节" + this.txtnexttachename.Value + "", "提交"); //如果是车辆管理,显示打印按钮 if (this.hy_mudelid.Text == "clgl") { this.td_print_clsq.Visible = true; } if (this.hy_mudelid.Text == "clgl" && this.hy_tableid.Text == "8b10b316-98d6-4a50-bc15-52745bb119bb" && this.hy_curtacheid.Text == "tache0006") { string lssqlclgl = " select * from hyp_flowmain where not(docid='" + this.txtdocid.Value + "') and hy_mudelid = 'clgl' and hy_tableid='8b10b316-98d6-4a50-bc15-52745bb119bb' and hy_field5='" + this.hy_field5.Text + "' and hy_curtacheid='**' order by hy_field31,hy_field33 desc"; HyoaClass.DAO dbclgl = new HyoaClass.DAO(); DataTable dtclgl = dbclgl.GetDataTable(lssqlclgl); if (dtclgl.Rows.Count > 0) { this.hy_field11.Text = dtclgl.Rows[0]["hy_field12"].ToString(); } else { this.hy_field11.Text = "0"; } } //发布投票 //if (this.hy_mudelid.Text == "moduletpgl" && this.hy_tableid.Text == "bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd") //{ // HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); // if (Hyoa_global.isHaveRole("Rolefbtp", Session["hyuid"].ToString())) // { // //未核对时显示发布投票按钮 // if (this.hy_field100.Text == "0") // { // this.td_pub.Visible = true; //发布投票 // } // } // else // { // this.td_pub.Visible = false; //发布投票 // } //} ////////群教评论s 只要是旧文档且是群教评论填写评论 if (this.hy_mudelid.Text == "moduleqjpl" && this.hy_tableid.Text == "7e41913d-c365-4edb-bb42-b0a8a50738cb") { this.tb_qjpltitle.Visible = true; this.tb_qjplbody.Visible = true; this.tr_qjpl.Visible = true; //得到已经评论内容 HyoaClass.Hyoa_bcyj Hyoa_qjpl = new HyoaClass.Hyoa_bcyj(); DataTable dt_qjpl = Hyoa_qjpl.GetdocsByfatherid(this.txtdocid.Value); if (dt_qjpl.Rows.Count > 0) { //输出评论记录 this.lblbody_qjpl.Text = ""; for (var i = 0; i < dt_qjpl.Rows.Count; i++) { this.lblbody_qjpl.Text += dt_qjpl.Rows[i]["hy_bcbody"].ToString() + "<br> "; this.lblbody_qjpl.Text += "(评论人:" + dt_qjpl.Rows[i]["hy_bcusername"].ToString() + " 所在部门:" + dt_qjpl.Rows[i]["hy_bcdeptname"].ToString(); this.lblbody_qjpl.Text += " 评论时间:" + dt_qjpl.Rows[i]["hy_bctime"].ToString(); //+ " IP:" + dt_bcyj.Rows[i]["hy_bcip"].ToString(); this.lblbody_qjpl.Text += ")<br><hr height=1 color=#DEEEFE></hr>"; } } } ////////群教评论e //如果是信息管理,显示转邮件按钮 if (this.hy_mudelid.Text == "xxgl" && this.hy_tableid.Text == "1a564b74-3d94-4cef-bb94-f0c0342ae8dd") this.td_returnmail.Visible = true; //如果是公告批示,显示转邮件按钮 if (this.hy_mudelid.Text == "moduleggps" && this.hy_tableid.Text == "bb523c42-d9ae-40cd-9bba-c3a99c2e1d54") this.td_returnmail_ggps.Visible = true; //如果是群教专栏,显示转邮件按钮 if (this.hy_mudelid.Text == "moduleqjzl" && this.hy_tableid.Text == "ac5e8ddd-d74c-4c9d-b0bf-5c23fc77b589") this.td_returnmail_qjzl.Visible = true; //如果是重要材料上报,显示转邮件按钮 if (this.hy_mudelid.Text == "gzyhbsh" && this.hy_tableid.Text == "7d03c313-186d-4859-9efa-acde27f4eff2") this.td_returnmail_zyclsb.Visible = true; //如果是iso900,显示转邮件按钮 if (this.hy_mudelid.Text == "moduleiso" && this.hy_tableid.Text == "c8246158-511f-4ce9-b7b9-3b7edf136a87") this.td_returnmail_iso.Visible = true; //知识管理,打开增加点击数 if (this.hy_mudelid.Text == "zsgl" && this.hy_tableid.Text == "3b5a9b5a-d1a3-4f85-b560-ef8c38a031cf") { HyoaClass.DAO db_djs = new HyoaClass.DAO(); db_djs.Execute("update hyp_flowmain set hy_field36=hy_field36+1 where DOCID='" + this.txtdocid.Value + "'"); db_djs.Close(); } //工作月汇报,输出WORD按钮隐藏/显示 if (this.hy_mudelid.Text == "gzyhb" && this.hy_tableid.Text == "b04d9f4a-e5af-4813-888b-c46f58cc3ad3") { this.td_inputword.Visible = true; } //工作月汇报,输出WORD按钮隐藏/显示 if (this.hy_mudelid.Text == "djgz" && this.hy_tableid.Text == "0e5efe98-49a5-4ccd-9532-8cac74ab328d") { this.td_inputword_dj.Visible = true; } }
//新文档OPEN时的特殊处理 private void hywebopen_newdoc() { HyoaClass.DAO db = new HyoaClass.DAO(); DataTable dt; string lsyear = System.DateTime.Now.Year.ToString(); string lssql = ""; //物品采购自动读取流水号 格式:CG2014000001 if (this.hy_mudelid.Text == "bgypcg" && this.hy_tableid.Text == "26e9b719-3ded-4fd2-a43b-6a45e30ccd1e") { int ls_lsh = 1; string ls_year = "", ls_lb = ""; //读取流水号表中的流水号 lssql = "select * from hyp_flowmain where hy_mudelid='Mudellsh' and hy_field1='物品采购' and hy_field4='启用' "; dt = db.GetDataTable(lssql); if (dt.Rows.Count > 0) { ls_lsh = int.Parse(dt.Rows[0]["hy_field37"].ToString()); ls_lb = dt.Rows[0]["hy_field2"].ToString(); ls_year = dt.Rows[0]["hy_field3"].ToString(); this.hy_field16.Text = ls_lb + ls_year + bzero(ls_lsh); //打开时显示 } } //维修管理自动读取流水号 格式:WX2014000001 if (this.hy_mudelid.Text == "modulewxgl" && this.hy_tableid.Text == "b6938f55-5042-4c22-bd26-78fcded8cfbf") { int ls_lsh = 1; string ls_year = "", ls_lb = ""; //读取流水号表中的流水号 lssql = "select * from hyp_flowmain where hy_mudelid='Mudellsh' and hy_field1='维修管理' and hy_field4='启用' "; dt = db.GetDataTable(lssql); if (dt.Rows.Count > 0) { ls_lsh = int.Parse(dt.Rows[0]["hy_field37"].ToString()); ls_lb = dt.Rows[0]["hy_field2"].ToString(); ls_year = dt.Rows[0]["hy_field3"].ToString(); this.hy_field16.Text = ls_lb + ls_year + bzero(ls_lsh); //打开时显示 } } ////请假管理中用到 //if (this.hy_mudelid.Text == "qjsq" && this.hy_tableid.Text == "d4af25f1-c7c0-4df9-a3b4-2c968ec3f2bc") //{ // if (this.hy_curtacheid.Text == "tache0001") // { // //得到180天内加班天数 // string lsdate = System.DateTime.Now.ToString();//今天日期 // DateTime today = DateTime.Today; // DateTime newDate = today.AddDays(-2001); // string lsdatefor60day = newDate.ToShortDateString(); //180天前 // lssql = "select sum(convert(float,hy_field16) ) from hyp_flowmain where hy_mudelid='jbsq' and hy_tableid='c980c86b-da0c-4758-b3d8-7236240c77da' and hy_curtacheid='**' and hy_djrid='" + this.Session["hyuid"].ToString() + "' and hy_field31>'" + lsdatefor60day + "' and hy_field31<'" + lsdate + "'"; // dt = db.GetDataTable(lssql); // this.hy_field11.Text = dt.Rows[0][0].ToString(); // //得到180天内调休天数 // dt.Clear(); // lssql = "select sum(convert(float,hy_field2) ) from hyp_flowmain where hy_mudelid='qjsq' and hy_tableid='d4af25f1-c7c0-4df9-a3b4-2c968ec3f2bc' and hy_curtacheid='**' and hy_field1='调休' and hy_djrid='" + this.Session["hyuid"].ToString() + "' and hy_field31>'" + lsdatefor60day + "'"; // dt = db.GetDataTable(lssql); // this.hy_field12.Text = dt.Rows[0][0].ToString(); // //得到今年年休假天数 // //dt.Clear(); // //lssql = "select sum(convert(float,hy_field2) ) from hyp_flowmain where hy_mudelid='qjsq' and hy_tableid='d4af25f1-c7c0-4df9-a3b4-2c968ec3f2bc' and hy_curtacheid='**' and hy_field1='年休假' and hy_djrid='" + this.Session["hyuid"].ToString() + "' and hy_field31>'" + lsyear + "-1-1" + "' and hy_field31<'" + lsyear + "-12-31" + "'"; // //dt = db.GetDataTable(lssql); // //this.hy_field13.Text = dt.Rows[0][0].ToString(); // //得到年休天数 // //lssql = "select hy_field36 from hyp_flowmain where hy_mudelid='modulenxjwh' and hy_tableid='ed3f3e1b-1c2c-49b4-91de-5bcc35b83ffa' and hy_field1='" + this.Session["hyuid"].ToString() + "'"; // //dt = db.GetDataTable(lssql); // //if(dt.Rows.Count>0) // // this.hy_field14.Text = dt.Rows[0][0].ToString(); // } //} db.Close(); }
//保存 protected void btn_save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../../login.aspx"); HyoaClass.DAO db = new HyoaClass.DAO(); string ls_ids = this.hy_xztpxx.Value; //Response.Write("<script language=javascript>alert('选项ID:" + ls_ids + "');</script>"); //生成投票日志,便于统计投票结果 if (this.txtop.Value == "add") { if (this.hy_tpfs.Value == "多选") { string[] lv_id = ls_ids.Split('+'); for (int i = 0; i < lv_id.Length; i++) { string ls_sql = "insert into hyk_whzx_tpgl_tpmx (id,hy_tpztid,hy_tpxxid,hy_tpr,hy_tprid,hy_tpip,hy_tpsj) values ("; ls_sql += "'" + System.Guid.NewGuid().ToString() + "','" + this.txtdocid.Value + "','" + lv_id[i] + "'"; ls_sql += ",'" + Session["hyuname"].ToString() + "','" + Session["hyuid"].ToString() + "','" + IPAddress() + "',getdate()"; ls_sql += ")"; db.Execute(ls_sql); } } else { string sql = "insert into hyk_whzx_tpgl_tpmx (id,hy_tpztid,hy_tpxxid,hy_tpr,hy_tprid,hy_tpip,hy_tpsj) values ("; sql += "'" + System.Guid.NewGuid().ToString() + "','" + this.txtdocid.Value + "','" + ls_ids + "'"; sql += ",'" + Session["hyuname"].ToString() + "','" + Session["hyuid"].ToString() + "','" + IPAddress() + "',getdate()"; sql += ")"; db.Execute(sql); } } ////参与投票积分日志 //InsertScoresLogs(this.txtmudelid.Value, this.txtdocid.Value, Session["hyuname"].ToString(), Session["hyuid"].ToString(), // Session["hydeptname"].ToString(), Session["hydeptid"].ToString(), "投票积分", System.Int32.Parse(this.hy_cssz2.Value), "参与投票", "0"); //将待办事宜置为已办事宜 string ls_sqlAA = "update hyt_dbsy set hy_ifyb='1' where hy_mudelid ='" + this.txtmudelid.Value + "' and docid='" + this.txtdocid.Value + "' and hy_dbrid='" + Session["hyuid"].ToString() + "'"; db.Execute(ls_sqlAA); db.Close(); //处理完成后的提示及跳转 string ls_tip = "投票成功!"; 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() { if (this.Request.QueryString["op"] != null) { HyoaClass.DAO db = new HyoaClass.DAO(); this.txtop.Value = this.Request.QueryString["op"].ToString(); //我要投票还是查看投票 this.txtdocid.Value = this.Request.QueryString["id"].ToString(); //文档ID //我要投票 if (this.Request.QueryString["op"] == "add") { //判断是否已经投票过 string issql = "select * from hyk_whzx_tpgl_tpmx where hy_tpztid='" + this.txtdocid.Value + "' and hy_tprid ='" + Session["hyuid"].ToString() + "'"; DataTable isdt = db.GetDataTable(issql); if (isdt.Rows.Count > 0) { Response.Write("<script>alert('您已经投票了!');window.location='list_tpgl_wytp.aspx'</script>"); } //显示我要投票 this.btn_submit.Visible = true; } //根据id得到信息 string sql = "select * from hyk_whzx_tpgl where id='" + this.txtdocid.Value + "'"; DataTable dt = db.GetDataTable(sql); if (dt.Rows.Count > 0) { #region 根据id得到信息 this.txtdjr.Value = dt.Rows[0]["hy_djr"].ToString(); this.txtdjrid.Value = dt.Rows[0]["hy_djrid"].ToString(); this.hy_lbl1.Text = System.DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToString("yyyy-MM-dd"); this.hy_lbl2.Text = dt.Rows[0]["hy_tplb"].ToString(); this.hy_lbl3.Text = System.DateTime.Parse(dt.Rows[0]["hy_tpkssj"].ToString()).ToString("yyyy-MM-dd"); this.hy_lbl4.Text = System.DateTime.Parse(dt.Rows[0]["hy_tpjssj"].ToString()).ToString("yyyy-MM-dd"); this.hy_lbl5.Text = dt.Rows[0]["hy_xxsm"].ToString(); this.hy_lbl6.Text = dt.Rows[0]["hy_bt"].ToString(); //判断该投票是否已经过期 if (Convert.ToDateTime(System.DateTime.Now.ToString("yyyy-MM-dd")) > Convert.ToDateTime(this.hy_lbl4.Text)) { //将该文档设为“结束投票” string ls_sql = "update hyk_whzx_tpgl set hy_jssj=getdate(),hy_gjzt='结束投票' where id='" + this.txtdocid.Value + "'"; db.Execute(ls_sql); Response.Write("<script>alert('对不起,该投票已经结束!');window.location='list_tpgl_wytp.aspx'</script>"); return; } //根据单选或多选得到选项 this.hy_tpfs.Value = dt.Rows[0]["hy_ktxx"].ToString(); //单选还是多选 string lssql = "select * from hyk_whzx_tpgl_tpxx where hy_tpztid='" + this.txtdocid.Value + "'"; DataTable dt2 = db.GetDataTable(lssql); if (this.hy_tpfs.Value == "多选") { this.GridView1.Visible = false; GridView2.DataSource = dt2; GridView2.DataBind(); } else { this.GridView2.Visible = false; GridView1.DataSource = dt2; GridView1.DataBind(); } dt2.Clear(); #endregion } dt.Clear(); db.Close(); } }
protected void btntbbz_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "update hyp_flowmain set hy_field3='已备注' where hy_mudelid = 'kqgl' and hy_tableid = '74e7e280-4fc5-4ccb-be3d-0f995ac2c934' and hy_field4!='' and hy_field3='是'"; db.Execute(lssql); db.Close(); this.lblReturnInformation.Text = "同步成功!"; }
private void DataPlay(int PageNo) { //判断当前用户是否有新建删除权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString()) || Hyoa_global.isHaveRole("Roleqjzl", this.Session["hyuid"].ToString())) { this.isrole.Value = "1"; this.tdnewdoc.Visible = true; //新建 this.tddeldoc.Visible = true; //删除 } else { this.isrole.Value = "0"; this.tdnewdoc.Visible = false; //新建 this.tddeldoc.Visible = false; //删除 } //得到当前页号 this.curpage.Text = PageNo.ToString(); //HyoaClass.Hyoa_iplimit Hyoa_iplimit = new HyoaClass.Hyoa_iplimit(); DataTable dt; HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "select * from hyp_flowmain where hy_mudelid ='moduleqjzl' and hy_tableid='ac5e8ddd-d74c-4c9d-b0bf-5c23fc77b589'"; //dt = Hyoa_iplimit.Getiplimits(); if (this.Request.QueryString["keyword"] != null) { lssql += " and hy_field1='" + this.Request.QueryString["keyword"].ToString() + "'"; } lssql += " order by hy_field32 desc "; dt = db.GetDataTable(lssql); DataTable tempTable = dt.Clone(); for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); db.Close(); ///只有管理员岗位能删除(大榭特有) //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) { } else { this.tddeldoc.Visible = false; //this.delcontrol_my.Visible = false; } }
protected void btndcinfo_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); String[] v_uids = this.txtuids.Value.Split(','); for (var i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string ls_sql = "update hyp_flowmain set hy_field59='已导出' where DOCID = '" + v_uids[i] + "' "; db.Execute(ls_sql); } } this.txtuids.Value = ""; //DataPlay(1); db.Close(); 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[] lvrow; string[] lvcol; lvrow = this.txtsubmit.Text.Split('*'); HyoaClass.DAO db = new HyoaClass.DAO(); DataTable dt; string lssql = ""; string lssqlupdata = ""; string lssqlupdatapeo = ""; int lsvalue = 0; for (int i = 0; i < lvrow.Length; i++) { lvcol = lvrow[i].Split('+'); lssql = "select * from hyp_flowmain where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; dt = db.GetDataTable(lssql); //this.Response.Write("<script>alert('" + lvcol[1] + "');</script>"); if (dt.Rows[0]["hy_field1"].ToString() == lvcol[1]) { if (dt.Rows[0]["hy_field11"].ToString() == "") { lsvalue = 1; } else { lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field11"].ToString()) + 1; } //票数+1 lssqlupdata = "update hyp_flowmain set hy_field11=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdata); //记录投票人信息记录 lssqlupdatapeo = "update hyp_flowmain set hy_field7=hy_field7+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdatapeo); } if (dt.Rows[0]["hy_field2"].ToString() == lvcol[1]) { if (dt.Rows[0]["hy_field12"].ToString() == "") { lsvalue = 1; } else { lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field12"].ToString()) + 1; } lssqlupdata = "update hyp_flowmain set hy_field12=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdata); //记录投票人信息记录 lssqlupdatapeo = "update hyp_flowmain set hy_field8=hy_field8+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdatapeo); } if (dt.Rows[0]["hy_field3"].ToString() == lvcol[1]) { if (dt.Rows[0]["hy_field13"].ToString() == "") { lsvalue = 1; } else { lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field13"].ToString()) + 1; } lssqlupdata = "update hyp_flowmain set hy_field13=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdata); //记录投票人信息记录 lssqlupdatapeo = "update hyp_flowmain set hy_field9=hy_field9+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdatapeo); } if (dt.Rows[0]["hy_field4"].ToString() == lvcol[1]) { if (dt.Rows[0]["hy_field14"].ToString() == "") { lsvalue = 1; } else { lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field14"].ToString()) + 1; } lssqlupdata = "update hyp_flowmain set hy_field14=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdata); //记录投票人信息记录 lssqlupdatapeo = "update hyp_flowmain set hy_field17=hy_field17+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdatapeo); } if (dt.Rows[0]["hy_field5"].ToString() == lvcol[1]) { if (dt.Rows[0]["hy_field15"].ToString() == "") { lsvalue = 1; } else { lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field15"].ToString()) + 1; } lssqlupdata = "update hyp_flowmain set hy_field15=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdata); //记录投票人信息记录 lssqlupdatapeo = "update hyp_flowmain set hy_field18=hy_field18+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdatapeo); } if (dt.Rows[0]["hy_field6"].ToString() == lvcol[1]) { if (dt.Rows[0]["hy_field16"].ToString() == "") { lsvalue = 1; } else { lsvalue = System.Int32.Parse(dt.Rows[0]["hy_field16"].ToString()) + 1; } lssqlupdata = "update hyp_flowmain set hy_field16=" + lsvalue.ToString() + " where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdata); //记录投票人信息记录 lssqlupdatapeo = "update hyp_flowmain set hy_field19=hy_field19+'+" + this.Session["hyuname"].ToString() + "' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; db.Execute(lssqlupdatapeo); } string lsupmain = "update hyp_flowmain set hy_field42=hy_field42+'+"+this.Session["hyuname"].ToString()+"' where hy_mudelid='moduletpgl' and hy_tableid='bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd' and DOCID='" + lvcol[0] + "'"; //this.txttest.Text = lsupmain; db.Execute(lsupmain); } db.Close(); this.Response.Write("<script>alert('投票成功!');window.close();</script>"); }
//发布 protected void btnpubinfo_Click(object sender, EventArgs e) { //判断选中的投票项目是否一致 HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); HyoaClass.DAO db = new HyoaClass.DAO(); string ls_tplb = "", ls_cyr = ""; String[] v_uids = this.txtuids.Value.Split(','); //通过ID得到信息 DataTable dt = Hyoa_flowmain.Getflowmain(v_uids[0]); if (dt.Rows.Count > 0) { ls_tplb = dt.Rows[0]["hy_field20"].ToString(); ls_cyr = dt.Rows[0]["hy_field41"].ToString(); if (ls_cyr != "" && ls_cyr.IndexOf('+') < 0) { Response.Write("<script>alert('多个可投票人员需要用加号分割,发布投票失败!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>"); return; } } //判断该投票类别是否已经发布过 string ls_sql22 = "select * from hyp_flowmain where hy_field20='" + ls_tplb + "' and hy_field100=1 "; DataTable dtlb = db.GetDataTable(ls_sql22); if (dtlb.Rows.Count > 0) { Response.Write("<script>alert('该投票类别已发布,发布投票失败!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>"); return; } //for (var i = 0; i < v_uids.Length; i++) //{ // //通过ID得到信息 // DataTable dt1 = Hyoa_flowmain.Getflowmain(v_uids[i]); // if (dt1.Rows.Count > 0) // { // if (ls_tpxm != dt1.Rows[0]["hy_field10"].ToString()) // { // Response.Write("<script>alert('选择的投票项目不一致,发布投票失败!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>"); // return; // } // if (dt.Rows[0]["hy_field100"].ToString() == "1") // { // Response.Write("<script>alert('选择的投票项目已发布,发布投票失败!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>"); // return; // } // } //} //Response.Write("<script>alert('" + ls_tpxm + "');</script>"); //return; //发布投票时发送邮件给参与投票人 HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string ls_yqmlists = ""; if (ls_cyr == "") { //从人员库中读取人员 string sql2 = "select * from hyt_user order by hy_sort"; DataTable dt2 = db.GetDataTable(sql2); if (dt.Rows.Count > 0) { for (int i = 0; i < dt2.Rows.Count; i++) { string ls_jsrid = dt2.Rows[i]["hy_userid"].ToString(); string ls_jsrname = dt2.Rows[i]["hy_username"].ToString(); string ls_yqm = ""; string ls_yqms = GetRandom3(); if (ls_jsrid == "admin") { ls_yqm = "000" + ls_yqms; } else { ls_yqm = ls_jsrid.Substring(ls_jsrid.Length - 3) + ls_yqms; //获得6位数字的随机数 } //string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom(); string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom(); string ls_title = "[投票管理]-请参与" + ls_tplb + "的投票"; string ls_body = "您投票的邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入投票页面!</a>"; String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values "; ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','admin','管理员','" + ls_jsrid + "','','" + ls_jsrname + "','" + ls_title + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') "; db.Execute(ls_sql); //将邀请码 if (ls_yqmlists == "") { ls_yqmlists = ls_yqm; } else { ls_yqmlists = ls_yqmlists + "+" + ls_yqm; } } } } else { string ls_jsrname = ls_cyr; string[] lv_jsrname = ls_jsrname.Split('+'); for (var i = 0; i < lv_jsrname.Length; i++) { if (lv_jsrname[i] != "") { string ls_jsrid = ""; string sqluser = "******" + lv_jsrname[i] + "'"; DataTable dtuser = db.GetDataTable(sqluser); if (dtuser.Rows.Count > 0) { ls_jsrid = dtuser.Rows[0]["hy_userid"].ToString(); } string ls_yqm = ""; string ls_yqms = GetRandom3(); if (lv_jsrname[i] == "管理员") { ls_yqm = "000" + ls_yqms; } else { //Response.Write("<script>alert('" + ls_jsrid + "')</script>"); //return; if (ls_jsrid != "" && ls_jsrid.Length - 3 > 0) { ls_yqm = ls_jsrid.Substring(ls_jsrid.Length - 3) + ls_yqms; //获得6位数字的随机数 } } ////发送待办 //string ls_dburl = "wstp.aspx?rnd=" + Hyoa_global.GetRandom(); //string ls_body = this.Session["hyuname"].ToString() + "发起投票,请您参与"; //Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_jsrid[i].ToString(), lv_jsrname[i].ToString(), // this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), ls_dburl, "待办", this.hy_mudelid.Text, "待办箱", "一般", ls_body, "请参与", 0, "", ""); //给参与的人发送邮件 //string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom(); string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom(); string ls_title = "[投票管理]-请参与" + ls_tplb + "的投票"; string ls_body = "您投票的邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入投票页面!</a>"; String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values "; ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','admin','管理员','" + ls_jsrid + "','','" + lv_jsrname[i].ToString() + "','" + ls_title + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') "; db.Execute(ls_sql); //将邀请码 if (ls_yqmlists == "") { ls_yqmlists = ls_yqm; } else { ls_yqmlists = ls_yqmlists + "+" + ls_yqm; } } } } //更新表 string sql = "update hyp_flowmain set hy_field30='" + ls_yqmlists + "',hy_field100=1 where hy_field20='" + ls_tplb + "'"; db.Execute(sql); db.Close(); db.Dispose(); this.txtuids.Value = ""; //DataPlay(System.Int32.Parse(this.curpage.Text)); Response.Write("<script>alert('发布投票成功!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>"); }
//旧文档OPEN时的特殊处理 private void hywebopen_olddoc() { //如果是车辆管理,显示打印按钮 if (this.hy_mudelid.Text == "clgl") { this.td_print_clsq.Visible = true; } if (this.hy_mudelid.Text == "clgl" && this.hy_tableid.Text == "8b10b316-98d6-4a50-bc15-52745bb119bb" && this.hy_curtacheid.Text == "tache0006") { string lssqlclgl = " select * from hyp_flowmain where not(docid='" + this.txtdocid.Value + "') and hy_mudelid = 'clgl' and hy_tableid='8b10b316-98d6-4a50-bc15-52745bb119bb' and hy_field5='" + this.hy_field5.Text + "' and hy_curtacheid='**' order by hy_field31,hy_field33 desc"; HyoaClass.DAO dbclgl = new HyoaClass.DAO(); DataTable dtclgl = dbclgl.GetDataTable(lssqlclgl); if (dtclgl.Rows.Count > 0) { this.hy_field11.Text = dtclgl.Rows[0]["hy_field12"].ToString(); } else { this.hy_field11.Text = "0"; } } //如果是信息管理,显示转邮件按钮 if (this.hy_mudelid.Text == "xxgl" && this.hy_tableid.Text=="1a564b74-3d94-4cef-bb94-f0c0342ae8dd") this.td_returnmail.Visible = true; //知识管理,打开增加点击数 if (this.hy_mudelid.Text == "zsgl" && this.hy_tableid.Text == "3b5a9b5a-d1a3-4f85-b560-ef8c38a031cf") { HyoaClass.DAO db_djs = new HyoaClass.DAO(); db_djs.Execute("update hyp_flowmain set hy_field36=hy_field36+1 where DOCID='" + this.txtdocid.Value + "'"); db_djs.Close(); } //工作月汇报,输出WORD按钮隐藏/显示 if (this.hy_mudelid.Text == "gzyhb" && this.hy_tableid.Text == "b04d9f4a-e5af-4813-888b-c46f58cc3ad3") { this.td_inputword.Visible = true; } }
//保存 protected void Button_Save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("/login.aspx"); string ls_tip = "保存成功!"; //新文档时 HyoaClass.Hyoa_flowinfor Hyoa_flowinfor = new HyoaClass.Hyoa_flowinfor(); if (this.txtop.Value == "add") { //先判断是否已经存在 DataTable dt = Hyoa_flowinfor.Getflowinfor(this.txtid.Text); if (dt.Rows.Count > 0) { Response.Write("<script>alert('该流程已存在,请重新填写!');history.back();</script>"); return; } else { Hyoa_flowinfor.hy_flowid = this.txtid.Text; Hyoa_flowinfor.hy_flowname = this.txtname.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Insert(); } } else { Hyoa_flowinfor.hy_flowid = this.txtid.Text; Hyoa_flowinfor.hy_flowname = this.txtname.Value; Hyoa_flowinfor.hy_sort = System.Int32.Parse(this.txtsort.Value); Hyoa_flowinfor.hy_mudelid = this.ddlmudelid.SelectedValue; Hyoa_flowinfor.Update(); } //保存时更新选中的模块对应的流程字段(hy_flowid) HyoaClass.DAO db = new HyoaClass.DAO(); string sql; sql = "select a.id from hyt_flowfield a,hyt_tableconfig b where a.hy_tableid=b.ID and b.hy_ifflowdoc='是' and a.hy_mudelid='"+this.ddlmudelid.SelectedValue+"'"; DataTable dt_update = db.GetDataTable(sql); if (dt_update.Rows.Count > 0) { for (var i = 0; i < dt_update.Rows.Count; i++) { sql = "update hyt_flowfield set hy_flowid='" + this.txtid.Text + "' where id='" + dt_update.Rows[i]["id"].ToString()+"'"; db.Execute(sql); } } db.Close(); //处理完成后的提示及跳转 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_Del_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "delete from hyp_flowmain where DOCID='" + this.txtdocid.Value + "'"; db.Execute(lssql); string lssqldbsy = "delete from hyt_dbsy where DOCID='" + this.txtdocid.Value + "'"; db.Execute(lssqldbsy); db.Close(); //处理完成后的提示及跳转(增加刷新附件功能) string ls_tip = "删除成功!"; if (this.txtifpop.Value == "") { Response.Write("<script>window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>window.opener.location.reload();window.opener=null;window.open('','_self');window.close();</script>"); } //效能办公日志记录 hyXnxtSaveLogs("", "删除一条记录", "删除"); }
private void DataPlay(int PageNo) { //////加载类别 HyoaClass.DAO db = new HyoaClass.DAO(); ////string sqltype = "select * from hyp_flowmain where hy_mudelid='cxzl' and hy_tableid='08e3fb12-65d4-4752-9503-5b414882c9ad' order by hy_field36"; ////DataTable dttype = db.GetDataTable(sqltype); ////if (dttype.Rows.Count > 0) ////{ //// this.hy_field1_1.DataSource = dttype; //// this.hy_field1_1.DataTextField = "hy_field1"; //// this.hy_field1_1.DataValueField = "hy_field1"; //// this.hy_field1_1.DataBind(); //// this.hy_field1_1.Items.Insert(0, ""); ////} //得到当前模块对应的role HyoaClass.Hyoa_mudel Hyoa_mudel = new HyoaClass.Hyoa_mudel(); DataTable dt_mudel = Hyoa_mudel.Getmudel(this.txtmudelid.Value); string ls_role = "Role9999"; if (dt_mudel.Rows.Count > 0) ls_role = dt_mudel.Rows[0]["hy_roleid"].ToString(); //判断当前用户是否有删除权限 HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole(ls_role, this.Session["hyuid"].ToString())) { this.isrole.Value = "1"; this.tddeldoc.Visible = true; //删除 } else { this.isrole.Value = "0"; this.tddeldoc.Visible = false; //删除 } string lstype=""; if (this.Request.QueryString["type"] != null) { lstype = Request.QueryString["type"].ToString(); } //得到当前页号 this.curpage.Text = PageNo.ToString(); string sql = ""; sql = "select * from hyp_flowmain where hy_mudelid='" + this.txtmudelid.Value + "' and (hy_field5='' or hy_field5 like '%" + Session["hyuid"].ToString() + "%') and hy_tableid='" + this.txttableid.Value + "' and ((charindex('" + Session["hyuid"].ToString() + "',hy_field5)>0) or (hy_field4='') or (hy_djrid='" + Session["hyuid"].ToString() + "') ) "; if (this.hy_djsj_start_1.Value != "") sql += " and hy_djsj>='" + this.hy_djsj_start_1.Value + "' "; if (this.hy_djsj_end_1.Value != "") sql += " and hy_djsj<='" + this.hy_djsj_end_1.Value + "' "; if (this.hy_djrname_1.Value != "") sql += " and hy_djrname like '%" + this.hy_djrname_1.Value + "%' "; if (this.hy_djrbmname_1.Value != "") sql += " and hy_djrbmname like '%" + this.hy_djrbmname_1.Value + "%' "; if (this.hy_field10_1.Value != "") sql += " and hy_field10 like '%" + this.hy_field10_1.Value + "%' "; if (this.hy_field2_1.Value != "") sql += " and hy_field2 like '%" + this.hy_field2_1.Value + "%' "; if (lstype != "") sql += " and hy_field1 ='" + lstype + "' "; sql += " order by hy_djsj desc "; DataTable dt = db.GetDataTable(sql); DataTable tempTable = dt.Clone(); for (int i = (PageNo - 1) * System.Int32.Parse(PageSize.Text); i < PageNo * System.Int32.Parse(PageSize.Text); i++) { if (i > dt.Rows.Count - 1) break; DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.ShowTotalRecord.Text = TotalRecord.ToString(); //计算及显示总页数 int TotalPage; if (TotalRecord < System.Int32.Parse(PageSize.Text)) { TotalPage = 1; } else { if (TotalRecord % System.Int32.Parse(PageSize.Text) != 0) { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text) + 1; } else { TotalPage = TotalRecord / System.Int32.Parse(PageSize.Text); } } this.ShowTotalPage.Text = TotalPage.ToString(); this.rptlist.DataSource = tempTable; this.rptlist.DataBind(); dt.Clear(); db.Close(); ///只有管理员岗位能删除(大榭特有) //HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role9999", this.Session["hyuid"].ToString())) { } else { this.tddeldoc.Visible = false; //this.delcontrol_my.Visible = false; } }
public string CreateCharts() { string strXML; string lssql; string lscolor; lscolor = "color='D64646'"; strXML = ""; //统计日期 string lsdatestart=""; string lsdateend=""; string lsif=""; if (this.Request.QueryString["datestart"] != null) { if (this.Request.QueryString["datestart"].ToString() != "") { lsdatestart = this.Request.QueryString["datestart"].ToString(); lsif = lsif + " and hy_field31>='" + lsdatestart + "'"; } } if (this.Request.QueryString["dateend"] != null) { if (this.Request.QueryString["dateend"].ToString() != "") { lsdateend = this.Request.QueryString["dateend"].ToString(); lsif = lsif + " and hy_field31<='" + lsdateend + "'"; } } HyoaClass.DAO db = new HyoaClass.DAO(); lssql = "select sum(convert(float,hy_field9)) as fs,b.hy_deptname as hy_field6 from hyt_user as a,hyt_dept as b,hyp_flowmain as c where a.hy_deptid=b.hy_deptid and rtrim(ltrim(c.hy_field6))=a.hy_username and c.hy_mudelid='xxgl' and c.hy_tableid='f1265875-5494-465f-ac33-6fa43d208c8f' " + lsif + " group by b.hy_deptname"; DataTable dt = db.GetDataTable(lssql); //HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); //DataTable dt = Hyoa_user.GetusersOrderbydeptsortandusersort(); //HyoaClass.DAO db=new HyoaClass.DAO(); //DataTable dtfs; string lssumdate=""; if (lsdatestart != "") { lssumdate = lsdatestart; } if (lsdateend != "") { lssumdate = lssumdate + "至" + lsdateend; } else { lssumdate = lssumdate + "至今"; } dt.DefaultView.Sort = "fs desc"; DataTable dtTemp = dt.DefaultView.ToTable(); //strXML +="<graph caption='绩效统计' showNames='1' showvalues='" + 100 + "' baseFontSize='12' xAxisName='Name' yAxisName='Point' decimalPrecision='0' formatNumberScale='0'>"; strXML += "<graph caption='" + lssumdate + "信息统计' showNames='1' baseFontSize='12' xAxisName='姓 名' yAxisName='Point' decimalPrecision='0' formatNumberScale='0'>"; int n = 0; for (int i = 0; i < dtTemp.Rows.Count; i++) { //lscolor = lscolor.Substring(0, 9) + (i * 100).ToString() + "'"; if (System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) > 50) { lscolor = "color='FF0202'"; } if (System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) > 20 && System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) <= 50) { lscolor = "color='FA01DA'"; } if (System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) > 5 && System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) <= 20) { lscolor = "color='9002FD'"; } if (System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) > 1 && System.Double.Parse(dtTemp.Rows[i]["fs"].ToString()) <= 5) { lscolor = "color='00FD65'"; } //lssql = "select sum(convert(int,hy_field12)) from hyp_flowmain where hy_mudelid='rsgl' and hy_tableid='6047076e-6a95-4fb8-aec8-5551d3900590' and hy_field10 = '" + dt.Rows[i]["hy_userid"].ToString() + "'"; //dtfs = db.GetDataTable(lssql); strXML += "<set name='" + dtTemp.Rows[i]["hy_field6"].ToString() + "' value='" + dtTemp.Rows[i]["fs"].ToString() + "' " + lscolor + " />"; n++; } //strXML += "<set name='人员1' value='" + "30" + "' color='D64646' />"; //strXML += "<set name='人员2' value='" + "60" + "' color='8E468E' />"; //strXML += "<set name='人员3' value='" + "90" + "' color='8E468E' />"; db.Close(); strXML += "</graph>"; string lsnlen = ""; lsnlen = (n * 115).ToString(); //this.lbscrbdataY.Text = " <font color=red>生产日报</font><br>当日实绩:" + xmldata[5] + "吨<br>" + "月度计划:" + xmldata[0] + "吨<br>" + "月度累计:" + xmldata[1] + "吨<br>" + "完成月计划:" + xmldata[2] + "%<br>" + "年度累计:" + xmldata[6] + "吨<br>" + "完成年计划:" + xmldata[7] + "%<br>"; return FusionCharts.RenderChartHTML("/app/FusionChartsFree/Charts/FCF_Column3D.swf", "ChartId", strXML, "myNext", lsnlen, "500", false); /////ztmend }
public string CreateCharts() { string strXML; string lssql; string lscolor; lscolor = "color='D64646'"; strXML = ""; //统计日期 string lsdatestart=""; string lsdateend=""; string lsif = ""; if (this.Request.QueryString["datestart"] != null) { if (this.Request.QueryString["datestart"].ToString() != "") { lsdatestart = this.Request.QueryString["datestart"].ToString(); lsif = lsif + " and hy_djsj>='" + lsdatestart + "' "; } } if (this.Request.QueryString["dateend"] != null) { if (this.Request.QueryString["dateend"].ToString() != "") { lsdateend = this.Request.QueryString["dateend"].ToString(); DateTime dts = Convert.ToDateTime(lsdateend); DateTime date_effect = dts.AddDays(1);//加一天 lsif = lsif + " and hy_djsj<='" + date_effect.ToString("yyyy-MM-dd").ToString() + "' "; } } HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dt = Hyoa_user.GetusersOrderbydeptsortandusersort(); HyoaClass.DAO db = new HyoaClass.DAO(); DataTable dtfs; string lssumdate = ""; if (lsdatestart != "") { lssumdate = lsdatestart; } if (lsdateend != "") { lssumdate = lssumdate + "至" + lsdateend; } else { lssumdate = lssumdate + "至今"; } //strXML +="<graph caption='绩效统计' showNames='1' showvalues='" + 100 + "' baseFontSize='12' xAxisName='Name' yAxisName='Point' decimalPrecision='0' formatNumberScale='0'>"; strXML += "<graph caption='" + lssumdate + "绩效统计' showNames='1' baseFontSize='12' xAxisName='姓 名' yAxisName='Point' decimalPrecision='0' formatNumberScale='0'>"; for (int i = 0; i < dt.Rows.Count; i++) { lscolor = lscolor.Substring(0, 9) + (i*100).ToString() + "'"; lssql = "select sum(convert(float,hy_field12)) from hyp_flowmain where hy_mudelid='rsgl' and hy_tableid='6047076e-6a95-4fb8-aec8-5551d3900590'" + lsif + " and hy_field1 = '" + dt.Rows[i]["hy_username"].ToString() + "'"; dtfs = db.GetDataTable(lssql); //增加0的数据不显示 added by xf 20110722 if(dtfs.Rows[0][0].ToString()!="" && dtfs.Rows[0][0].ToString()!="0") strXML += "<set name='" + dt.Rows[i]["hy_username"].ToString() + "' value='" + dtfs.Rows[0][0].ToString() + "' " + lscolor + " />"; } //strXML += "<set name='人员1' value='" + "30" + "' color='D64646' />"; //strXML += "<set name='人员2' value='" + "60" + "' color='8E468E' />"; //strXML += "<set name='人员3' value='" + "90" + "' color='8E468E' />"; db.Close(); strXML += "</graph>"; return FusionCharts.RenderChartHTML("/app/FusionChartsFree/Charts/FCF_Pie3D.swf", "ChartId", strXML, "myNext", "1024", "500", false); /////ztmend }
protected void btnImport_Click(object sender, EventArgs e) { String sql; sql = ""; if (this.lblDisplay.Text == "") { this.lblReturnInformation.Text = "请先保存Excel文件!"; } else { sql = ""; sql = " select 姓名,日期,签到时间,签退时间,是否旷工,例外情况,部门 from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=''" + this.lblDisplay.Text + "'';User ID=admin;Password=;Extended properties=Excel 5.0')...Sheet1$ "; HyoaClass.DAO db = new HyoaClass.DAO(); HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); DataTable dt = db.GetDataTable(sql); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); DataTable dtuser; for (int j = 0; j < dt.Rows.Count; j++) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //文档ID Hyoa_flowmain.DOCID = Hyoa_global.GetRandom(); Hyoa_flowmain.hy_mudelid = "kqgl"; Hyoa_flowmain.hy_tableid = "74e7e280-4fc5-4ccb-be3d-0f995ac2c934"; Hyoa_flowmain.hy_flowid = ""; Hyoa_flowmain.hy_flowname = ""; Hyoa_flowmain.hy_curtacheid = ""; Hyoa_flowmain.hy_curtachename = ""; Hyoa_flowmain.hy_curclrid = ""; Hyoa_flowmain.hy_curclrname = ""; dtuser = Hyoa_user.GetusersbynameforCX(dt.Rows[j]["姓名"].ToString()); if (dtuser.Rows.Count > 0) { Hyoa_flowmain.hy_djrid = dtuser.Rows[0]["hy_userid"].ToString(); Hyoa_flowmain.hy_djrbmid = dtuser.Rows[0]["hy_deptid"].ToString(); } else { Hyoa_flowmain.hy_djrid = ""; Hyoa_flowmain.hy_djrbmid = ""; } Hyoa_flowmain.hy_djrname = dt.Rows[j]["姓名"].ToString(); Hyoa_flowmain.hy_djrbmname = dt.Rows[j]["部门"].ToString(); Hyoa_flowmain.hy_djsj = System.DateTime.Now.ToString(); Hyoa_flowmain.hy_bt = ""; Hyoa_flowmain.hy_content1 = ""; Hyoa_flowmain.hy_content2 = ""; Hyoa_flowmain.hy_content3 = ""; Hyoa_flowmain.hy_content4 = ""; Hyoa_flowmain.hy_content5 = ""; Hyoa_flowmain.hy_content6 = ""; Hyoa_flowmain.hy_content7 = ""; Hyoa_flowmain.hy_content8 = ""; Hyoa_flowmain.hy_content9 = ""; Hyoa_flowmain.hy_content10 = ""; Hyoa_flowmain.hy_content11 = ""; Hyoa_flowmain.hy_content12 = ""; Hyoa_flowmain.hy_content13 = ""; Hyoa_flowmain.hy_content14 = ""; Hyoa_flowmain.hy_content15 = ""; Hyoa_flowmain.hy_field1 = dt.Rows[j]["签到时间"].ToString(); Hyoa_flowmain.hy_field2 = dt.Rows[j]["签退时间"].ToString(); if (dt.Rows[j]["是否旷工"].ToString() == "True") { Hyoa_flowmain.hy_field3 = "是"; } else { Hyoa_flowmain.hy_field3 = ""; } Hyoa_flowmain.hy_field4 = dt.Rows[j]["例外情况"].ToString(); Hyoa_flowmain.hy_field5 = ""; Hyoa_flowmain.hy_field6 = ""; Hyoa_flowmain.hy_field7 = ""; Hyoa_flowmain.hy_field8 = ""; Hyoa_flowmain.hy_field9 = ""; Hyoa_flowmain.hy_field10 = ""; Hyoa_flowmain.hy_field11 = ""; Hyoa_flowmain.hy_field12 = ""; Hyoa_flowmain.hy_field13 = ""; Hyoa_flowmain.hy_field14 = ""; Hyoa_flowmain.hy_field15 = ""; Hyoa_flowmain.hy_field16 = ""; Hyoa_flowmain.hy_field17 = ""; Hyoa_flowmain.hy_field18 = ""; Hyoa_flowmain.hy_field19 = ""; Hyoa_flowmain.hy_field20 = ""; Hyoa_flowmain.hy_field21 = ""; Hyoa_flowmain.hy_field22 = ""; Hyoa_flowmain.hy_field23 = ""; Hyoa_flowmain.hy_field24 = ""; Hyoa_flowmain.hy_field25 = ""; Hyoa_flowmain.hy_field26 = ""; Hyoa_flowmain.hy_field27 = ""; Hyoa_flowmain.hy_field28 = ""; Hyoa_flowmain.hy_field29 = ""; Hyoa_flowmain.hy_field30 = ""; Hyoa_flowmain.hy_field31 = dt.Rows[j]["日期"].ToString(); ; Hyoa_flowmain.hy_field32 = ""; Hyoa_flowmain.hy_field33 = ""; Hyoa_flowmain.hy_field34 = ""; Hyoa_flowmain.hy_field35 = ""; Hyoa_flowmain.hy_field36 = 0; Hyoa_flowmain.hy_field37 = 0; Hyoa_flowmain.hy_field38 = 0; Hyoa_flowmain.hy_field39 = 0; Hyoa_flowmain.hy_field40 = 0; Hyoa_flowmain.hy_field41 = ""; Hyoa_flowmain.hy_field42 = ""; Hyoa_flowmain.hy_field43 = ""; Hyoa_flowmain.hy_field44 = ""; Hyoa_flowmain.hy_field45 = ""; Hyoa_flowmain.hy_field46 = ""; Hyoa_flowmain.hy_field47 = ""; Hyoa_flowmain.hy_field48 = ""; Hyoa_flowmain.hy_field49 = ""; Hyoa_flowmain.hy_field50 = ""; Hyoa_flowmain.hy_field51 = ""; Hyoa_flowmain.hy_field52 = ""; Hyoa_flowmain.hy_field53 = ""; Hyoa_flowmain.hy_field54 = ""; Hyoa_flowmain.hy_field55 = ""; Hyoa_flowmain.hy_field56 = ""; Hyoa_flowmain.hy_field57 = ""; Hyoa_flowmain.hy_field58 = ""; Hyoa_flowmain.hy_field59 = ""; Hyoa_flowmain.hy_field60 = ""; Hyoa_flowmain.hy_field61 = ""; Hyoa_flowmain.hy_field62 = ""; Hyoa_flowmain.hy_field63 = ""; Hyoa_flowmain.hy_field64 = ""; Hyoa_flowmain.hy_field65 = ""; Hyoa_flowmain.hy_field66 = ""; Hyoa_flowmain.hy_field67 = ""; Hyoa_flowmain.hy_field68 = ""; Hyoa_flowmain.hy_field69 = ""; Hyoa_flowmain.hy_field70 = ""; Hyoa_flowmain.hy_field71 = 0; Hyoa_flowmain.hy_field72 = 0; Hyoa_flowmain.hy_field73 = 0; Hyoa_flowmain.hy_field74 = 0; Hyoa_flowmain.hy_field75 = 0; Hyoa_flowmain.hy_field76 = 0; Hyoa_flowmain.hy_field77 = 0; Hyoa_flowmain.hy_field78 = 0; Hyoa_flowmain.hy_field79 = 0; Hyoa_flowmain.hy_field80 = 0; Hyoa_flowmain.hy_field81 = 0; Hyoa_flowmain.hy_field82 = 0; Hyoa_flowmain.hy_field83 = 0; Hyoa_flowmain.hy_field84 = 0; Hyoa_flowmain.hy_field85 = 0; Hyoa_flowmain.hy_field86 = 0; Hyoa_flowmain.hy_field87 = 0; Hyoa_flowmain.hy_field88 = 0; Hyoa_flowmain.hy_field89 = 0; Hyoa_flowmain.hy_field90 = 0; Hyoa_flowmain.hy_field91 = 0; Hyoa_flowmain.hy_field92 = 0; Hyoa_flowmain.hy_field93 = 0; Hyoa_flowmain.hy_field94 = 0; Hyoa_flowmain.hy_field95 = 0; Hyoa_flowmain.hy_field96 = 0; Hyoa_flowmain.hy_field97 = 0; Hyoa_flowmain.hy_field98 = 0; Hyoa_flowmain.hy_field99 = 0; Hyoa_flowmain.hy_field100 = 0; Hyoa_flowmain.hy_iftx = ""; Hyoa_flowmain.hy_zhtxsj = ""; Hyoa_flowmain.hy_readuserlist = ""; Hyoa_flowmain.Insert(); } db.Close(); this.lblReturnInformation.Text = "导入成功"; if (File.Exists(this.lblDisplay.Text)) { System.IO.File.Delete(this.lblDisplay.Text); } } }
//发布投票add by fy 2014-02-23 protected void Button_Pub_Click(object sender, EventArgs e) { //发布投票时发送邮件给参与投票人 HyoaClass.DAO db = new HyoaClass.DAO(); HyoaClass.Hyoa_mail Hyoa_mail = new HyoaClass.Hyoa_mail(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); HyoaClass.Hyoa_user Hyoa_user = new HyoaClass.Hyoa_user(); string ls_yqmlists = ""; if (this.hy_field43.Text == "") { //从人员库中读取人员 DataTable dt = Hyoa_user.GetusersOrderbydeptsortandusersort(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { string ls_jsrid = dt.Rows[i]["hy_userid"].ToString(); string ls_jsrname = dt.Rows[i]["hy_username"].ToString(); string ls_yqm = ""; string ls_yqms = GetRandom3(); if (ls_jsrid == "admin") { ls_yqm = "000" + ls_yqms; } else { ls_yqm = ls_jsrid.Substring(ls_jsrid.Length - 3) + ls_yqms; //获得6位数字的随机数 } //string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom(); string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom(); string ls_body = this.Session["hyuname"].ToString() + "发起投票,您的投票邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入</a>"; String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values "; ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','" + this.hy_djrid.Text + "','" + this.hy_djrname.Text + "','" + ls_jsrid + "','','" + ls_jsrname + "','" + this.hy_field23.Text + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') "; db.Execute(ls_sql); //将邀请码 if (ls_yqmlists == "") { ls_yqmlists = ls_yqm; } else { ls_yqmlists = ls_yqmlists + "+" + ls_yqm; } } } } else { string ls_jsrid = this.hy_field43.Text; string ls_jsrname = this.hy_field41.Text; string[] lv_jsrid = ls_jsrid.Split('+'); string[] lv_jsrname = ls_jsrname.Split('+'); for (var i = 0; i < lv_jsrid.Length; i++) { if (lv_jsrid[i] != "") { string ls_yqm = ""; string ls_yqms = GetRandom3(); if (lv_jsrid[i] == "admin") { ls_yqm = "000" + ls_yqms; } else { ls_yqm = lv_jsrid[i].Substring(lv_jsrid[i].Length - 3) + ls_yqms; //获得6位数字的随机数 } ////发送待办 //string ls_dburl = "wstp.aspx?rnd=" + Hyoa_global.GetRandom(); //string ls_body = this.Session["hyuname"].ToString() + "发起投票,请您参与"; //Hyoa_global.Senddbsy_global(this.txtdocid.Value, lv_jsrid[i].ToString(), lv_jsrname[i].ToString(), // this.Session["hyuid"].ToString(), this.Session["hyuname"].ToString(), ls_dburl, "待办", this.hy_mudelid.Text, "待办箱", "一般", ls_body, "请参与", 0, "", ""); //给参与的人发送邮件 //string ls_dburl = "/wstp.aspx?yqm=" + ls_yqm + "&rnd=" + Hyoa_global.GetRandom(); string ls_dburl = "/wstp.aspx?rnd=" + Hyoa_global.GetRandom(); string ls_body = this.Session["hyuname"].ToString() + "发起投票,您的投票邀请码为:" + ls_yqm + "。<a href=" + ls_dburl + " target=\"_blank\">请点击进入</a>"; String ls_sql = "insert into hyt_mail(ID,DOCID,hy_type,hy_foldername,hy_fsrid,hy_fsrname,hy_jsrid,hy_wbjsrid,hy_jsrname,hy_title,hy_body,hy_datetime,hy_ifsavetofjx,hy_yxj,hy_yjbg,hy_zycd,hy_hz,hy_wbjszh) values "; ls_sql += "('" + Hyoa_global.GetRandom() + "','" + Hyoa_global.GetRandom() + "','收件','收件箱','" + this.hy_djrid.Text + "','" + this.hy_djrname.Text + "','" + lv_jsrid[i].ToString() + "','','" + lv_jsrname[i].ToString() + "','" + this.hy_field23.Text + "','" + ls_body + "','" + System.DateTime.Now.ToString() + "','','','','','','') "; db.Execute(ls_sql); //将邀请码 if (ls_yqmlists == "") { ls_yqmlists = ls_yqm; } else { ls_yqmlists = ls_yqmlists + "+" + ls_yqm; } } } } //更新表 string sql = "update hyp_flowmain set hy_field30='" + ls_yqmlists + "',hy_field100=1 where docid='" + this.txtdocid.Value + "'"; db.Execute(sql); db.Close(); db.Dispose(); Response.Write("<script>alert('发布投票成功!');window.location = '/list_tpgl.aspx?mid=moduletpgl&tableid=bb4c4ac0-53b4-4c7f-89a6-4bde425c24fd';</script>"); }
protected void btnImport_Click(object sender, EventArgs e) { String sql; sql = ""; if (this.lblDisplay.Text == "") { this.lblReturnInformation.Text = "请先保存Excel文件!"; } else { sql = ""; sql = " select 题型,正确答案,题目,分值,选择项1,选择项2,选择项3,选择项4,选择项5,选择项6 from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source=''" + this.lblDisplay.Text + "'';User ID=admin;Password=;Extended properties=Excel 5.0')...Sheet1$ "; HyoaClass.DAO db = new HyoaClass.DAO(); HyoaClass.Hyoa_flowmain Hyoa_flowmain = new HyoaClass.Hyoa_flowmain(); DataTable dt = db.GetDataTable(sql); for (int j = 0; j < dt.Rows.Count; j++) { HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); //文档ID Hyoa_flowmain.DOCID = Hyoa_global.GetRandom(); Hyoa_flowmain.hy_mudelid = "zsgl"; Hyoa_flowmain.hy_tableid = "9b3dd7c5-a4ab-46c5-a1c8-5d7879bdf050"; Hyoa_flowmain.hy_flowid = ""; Hyoa_flowmain.hy_flowname = ""; Hyoa_flowmain.hy_curtacheid = ""; Hyoa_flowmain.hy_curtachename = ""; Hyoa_flowmain.hy_curclrid = ""; Hyoa_flowmain.hy_curclrname = ""; Hyoa_flowmain.hy_djrid = "admin"; Hyoa_flowmain.hy_djrname = "管理员"; Hyoa_flowmain.hy_djrbmid = "003"; Hyoa_flowmain.hy_djrbmname = "管理员组"; Hyoa_flowmain.hy_djsj = System.DateTime.Now.ToString(); Hyoa_flowmain.hy_bt = ""; Hyoa_flowmain.hy_content1 = ""; Hyoa_flowmain.hy_content2 = ""; Hyoa_flowmain.hy_content3 = ""; Hyoa_flowmain.hy_content4 = ""; Hyoa_flowmain.hy_content5 = ""; Hyoa_flowmain.hy_content6 = ""; Hyoa_flowmain.hy_content7 = ""; Hyoa_flowmain.hy_content8 = ""; Hyoa_flowmain.hy_content9 = ""; Hyoa_flowmain.hy_content10 = ""; Hyoa_flowmain.hy_content11 = ""; Hyoa_flowmain.hy_content12 = ""; Hyoa_flowmain.hy_content13 = ""; Hyoa_flowmain.hy_content14 = ""; Hyoa_flowmain.hy_content15 = ""; Hyoa_flowmain.hy_field1 = dt.Rows[j]["题型"].ToString(); Hyoa_flowmain.hy_field2 = dt.Rows[j]["正确答案"].ToString(); Hyoa_flowmain.hy_field3 = dt.Rows[j]["题目"].ToString(); Hyoa_flowmain.hy_field4 = dt.Rows[j]["分值"].ToString(); Hyoa_flowmain.hy_field5 = ""; Hyoa_flowmain.hy_field6 = ""; Hyoa_flowmain.hy_field7 = ""; Hyoa_flowmain.hy_field8 = ""; Hyoa_flowmain.hy_field9 = ""; Hyoa_flowmain.hy_field10 = dt.Rows[j]["选择项1"].ToString(); Hyoa_flowmain.hy_field11 = dt.Rows[j]["选择项2"].ToString(); Hyoa_flowmain.hy_field12 = dt.Rows[j]["选择项3"].ToString(); Hyoa_flowmain.hy_field13 = dt.Rows[j]["选择项4"].ToString(); Hyoa_flowmain.hy_field14 = dt.Rows[j]["选择项5"].ToString(); Hyoa_flowmain.hy_field15 = dt.Rows[j]["选择项6"].ToString(); Hyoa_flowmain.hy_field16 = ""; Hyoa_flowmain.hy_field17 = ""; Hyoa_flowmain.hy_field18 = ""; Hyoa_flowmain.hy_field19 = ""; Hyoa_flowmain.hy_field20 = ""; Hyoa_flowmain.hy_field21 = ""; Hyoa_flowmain.hy_field22 = ""; Hyoa_flowmain.hy_field23 = ""; Hyoa_flowmain.hy_field24 = ""; Hyoa_flowmain.hy_field25 = ""; Hyoa_flowmain.hy_field26 = ""; Hyoa_flowmain.hy_field27 = ""; Hyoa_flowmain.hy_field28 = ""; Hyoa_flowmain.hy_field29 = ""; Hyoa_flowmain.hy_field30 = ""; Hyoa_flowmain.hy_field31 = ""; Hyoa_flowmain.hy_field32 = ""; Hyoa_flowmain.hy_field33 = ""; Hyoa_flowmain.hy_field34 = ""; Hyoa_flowmain.hy_field35 = ""; Hyoa_flowmain.hy_field36 = 0; Hyoa_flowmain.hy_field37 = 0; Hyoa_flowmain.hy_field38 = 0; Hyoa_flowmain.hy_field39 = 0; Hyoa_flowmain.hy_field40 = 0; Hyoa_flowmain.hy_field41 = ""; Hyoa_flowmain.hy_field42 = ""; Hyoa_flowmain.hy_field43 = ""; Hyoa_flowmain.hy_field44 = ""; Hyoa_flowmain.hy_field45 = ""; Hyoa_flowmain.hy_field46 = ""; Hyoa_flowmain.hy_field47 = ""; Hyoa_flowmain.hy_field48 = ""; Hyoa_flowmain.hy_field49 = ""; Hyoa_flowmain.hy_field50 = ""; Hyoa_flowmain.hy_field51 = ""; Hyoa_flowmain.hy_field52 = ""; Hyoa_flowmain.hy_field53 = ""; Hyoa_flowmain.hy_field54 = ""; Hyoa_flowmain.hy_field55 = ""; Hyoa_flowmain.hy_field56 = ""; Hyoa_flowmain.hy_field57 = ""; Hyoa_flowmain.hy_field58 = ""; Hyoa_flowmain.hy_field59 = ""; Hyoa_flowmain.hy_field60 = ""; Hyoa_flowmain.hy_field61 = ""; Hyoa_flowmain.hy_field62 = ""; Hyoa_flowmain.hy_field63 = ""; Hyoa_flowmain.hy_field64 = ""; Hyoa_flowmain.hy_field65 = ""; Hyoa_flowmain.hy_field66 = ""; Hyoa_flowmain.hy_field67 = ""; Hyoa_flowmain.hy_field68 = ""; Hyoa_flowmain.hy_field69 = ""; Hyoa_flowmain.hy_field70 = ""; Hyoa_flowmain.hy_field71 = 0; Hyoa_flowmain.hy_field72 = 0; Hyoa_flowmain.hy_field73 = 0; Hyoa_flowmain.hy_field74 = 0; Hyoa_flowmain.hy_field75 = 0; Hyoa_flowmain.hy_field76 = 0; Hyoa_flowmain.hy_field77 = 0; Hyoa_flowmain.hy_field78 = 0; Hyoa_flowmain.hy_field79 = 0; Hyoa_flowmain.hy_field80 = 0; Hyoa_flowmain.hy_field81 = 0; Hyoa_flowmain.hy_field82 = 0; Hyoa_flowmain.hy_field83 = 0; Hyoa_flowmain.hy_field84 = 0; Hyoa_flowmain.hy_field85 = 0; Hyoa_flowmain.hy_field86 = 0; Hyoa_flowmain.hy_field87 = 0; Hyoa_flowmain.hy_field88 = 0; Hyoa_flowmain.hy_field89 = 0; Hyoa_flowmain.hy_field90 = 0; Hyoa_flowmain.hy_field91 = 0; Hyoa_flowmain.hy_field92 = 0; Hyoa_flowmain.hy_field93 = 0; Hyoa_flowmain.hy_field94 = 0; Hyoa_flowmain.hy_field95 = 0; Hyoa_flowmain.hy_field96 = 0; Hyoa_flowmain.hy_field97 = 0; Hyoa_flowmain.hy_field98 = 0; Hyoa_flowmain.hy_field99 = 0; Hyoa_flowmain.hy_field100 = 0; Hyoa_flowmain.hy_iftx = ""; Hyoa_flowmain.hy_zhtxsj = ""; Hyoa_flowmain.hy_readuserlist = ""; Hyoa_flowmain.Insert(); } db.Close(); this.lblReturnInformation.Text = "导入成功"; if (File.Exists(this.lblDisplay.Text)) { System.IO.File.Delete(this.lblDisplay.Text); } } }
//取消 protected void Button_Qx_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "delete from hyp_flowmain where DOCID='" + this.txtdocid.Value + "'"; db.Execute(lssql); string lssqldbsy = "delete from hyt_dbsy where DOCID='" + this.txtdocid.Value + "'"; db.Execute(lssqldbsy); db.Close(); //处理完成后的提示及跳转(增加刷新附件功能) string ls_tip = "取消成功!"; if (this.txtifpop.Value == "") { Response.Write("<script>window.location='" + this.txturl.Value + "'</script>"); } else { Response.Write("<script>window.opener.location.reload();self.close();</script>"); } }
//得到某一个字段的HTML //pi_flag 0:不赋值 1:需赋值 //ifsearch:是否查询时使用 0:非查询时使用 1:查询时使用 public string GetFieldHtml(string hy_mudelid, string hy_fieldid, string pi_flag, string hy_tableid, string ifsearch) { HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield(); DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(hy_mudelid, hy_fieldid, hy_tableid); HyoaClass.DAO db = new HyoaClass.DAO(); string lsField = ""; string field_css = ""; string field_value = ""; string field_functionhy_onclick = ""; string field_functionhy_ondblclick = ""; string field_functionhy_onchange = ""; string field_functionhy_onkeydown = ""; string field_functionhy_onkeyup = ""; if (dtfield.Rows.Count > 0) { //得到该字段的样式start if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是") { if (ifsearch == "0") field_css += " readonly "; } if (dtfield.Rows[0]["hy_class"].ToString() != "") { field_css += " class='" + dtfield.Rows[0]["hy_class"].ToString() + "' "; } if (dtfield.Rows[0]["hy_width"].ToString() != "") { field_css += " style='width:" + dtfield.Rows[0]["hy_width"].ToString() + ";"; } else { field_css += " style='"; } if (dtfield.Rows[0]["hy_height"].ToString() != "") { field_css += " height:" + dtfield.Rows[0]["hy_height"].ToString() + "'"; } else { field_css += "'"; } //默认值 //默认值取值的方式,查询时不使用默认值 if (ifsearch == "0") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "") { if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0") field_value += dtfield.Rows[0]["hy_defaultvalue"].ToString(); if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1") { DataTable dtdefault = db.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString()); if (dtdefault.Rows.Count > 0) field_value += dtdefault.Rows[0][0].ToString(); } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2") { field_value += Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString(); } if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3") { if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd") field_value += System.DateTime.Now.ToShortDateString(); else field_value += System.DateTime.Now.ToString(); } } } //事件 if (dtfield.Rows[0]["hy_onclick"].ToString() != "") { field_functionhy_onclick += " onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "") { field_functionhy_ondblclick += " ondblclick=\"" + dtfield.Rows[0]["hy_ondblclick"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onchange"].ToString() != "") { field_functionhy_onchange += " onchange=\"" + dtfield.Rows[0]["hy_onchange"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "") { field_functionhy_onkeydown += " onkeydown=\"" + dtfield.Rows[0]["hy_onkeydown"].ToString() + "\" "; } if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "") { field_functionhy_onkeyup += " onkeyup=\"" + dtfield.Rows[0]["hy_onkeyup"].ToString() + "\" "; } //得到该字段的样式end string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString(); //单行文本 if (field_type == "文本") { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + " value=\"" + field_value + "\">"; } //多行文本 if (field_type == "多行文本") { lsField = "<textarea name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + " >" + field_value + "</textarea>"; } //日期 if (field_type == "日期") { if (ifsearch == "0") { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + field_value + "\">"; } else { field_css = " style='width:47%;'"; lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + "onclick=\"WdatePicker({el:$dp.$('" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1')})\"" +field_css + " value=\"" + field_value + "\">至"; lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " +"onclick=\"WdatePicker({el:$dp.$('" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1')})\"" +field_css + " value=\"" + field_value + "\">"; } } //数值 if (field_type == "数值") { if (ifsearch == "0") { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + " value=\"" + field_value + "\">"; } else { field_css = " style='width:47%;'"; lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_start_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + " value=\"" + field_value + "\">到"; lsField += "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_end_1\" " + field_functionhy_onclick + field_functionhy_ondblclick + field_functionhy_onkeydown + field_functionhy_onkeyup + field_css + " value=\"" + field_value + "\">"; } } //对话框列表(下拉框 if (field_type == "对话框列表") { lsField = "<select name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onchange + field_css + "> "; //有哪些选项 lsField += "<option value=''></option>"; if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { lsField += "<option value='" + lv_options[ii].ToString() + "'>" + lv_options[ii].ToString() + "</option>"; } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { lsField += "<option value='" + dtoptions.Rows[ii][0].ToString() + "'>" + dtoptions.Rows[ii][0].ToString() + "</option>"; } } } lsField += "</select>"; } //复选框 if (field_type == "复选框") { //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (field_value == lv_options[ii].ToString()) lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (field_value == dtoptions.Rows[ii][0].ToString()) lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=checkbox checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=checkbox id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } } } } //单选框 if (field_type == "单选框") { //有哪些选项 if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0") { string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#'); for (var ii = 0; ii < lv_options.Length; ii++) { if (field_value == lv_options[ii].ToString()) lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + lv_options[ii].ToString() + "\" />" + lv_options[ii].ToString(); } } if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1") { DataTable dtoptions = db.GetDataTable(dtfield.Rows[0]["hy_options"].ToString()); if (dtoptions.Rows.Count > 0) { for (var ii = 0; ii < dtoptions.Rows.Count; ii++) { if (field_value == dtoptions.Rows[ii][0].ToString()) lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=radio checked=true id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); else lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + (ii.ToString()) + "_1\" type=radio id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + dtoptions.Rows[ii][0].ToString() + "\" />" + dtoptions.Rows[ii][0].ToString(); } } } } //口令 if (field_type == "口令") { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=password id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_functionhy_onclick + field_css + " value=\"" + field_value + "\">"; } //附件组件 if (field_type == "附件组件") { lsField = "<input name=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" type=text id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\" " + field_css + " value=\"" + "\"><input type=button id=\"uploadfile1\" text='附件' class=\"text1\" onclick=\"window.open('/ggdy/uploadfile.aspx?id=" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "');\" "; } //说明文字 if (field_type == "说明文字") { lsField = "<span id=\"" + dtfield.Rows[0]["hy_sqlfield"].ToString() + "_1\">" + field_value + "</span>"; } //编辑器文本 //if (field_type.Equals("ewebeditor")) //{ // tfile.setField(field_name, field_value); //} db.Close(); } return lsField; }
//打开文档显示 private void DataPlay() { HyoaClass.DAO db = new HyoaClass.DAO(); StringBuilder sb = new StringBuilder(); string ls_flag = "0"; //是否为授权人员 string ls_uid = this.Session["hyuid"].ToString(); HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global(); if (Hyoa_global.isHaveRole("Role_search", ls_uid)) { ls_flag = "1"; } int ls_Container = 1; string ls_docids = ""; string sql1 = ""; //查询关键字按|分割 string[] lv_key = ls_keywords.Split('|'); //读取待查模块的字段 if (ls_Modelid != "--请选择--") { sql1 = "select *,(select hy_mudelname from hyt_mudel where hy_mudelid=a.hy_mudelid) as hy_name from hyt_searchconfig a where hy_ifsearch='是' and hy_mudelid='" + ls_Modelid + "'"; sql1 += " order by hy_sort "; } else { sql1 = "select *,(select hy_mudelname from hyt_mudel where hy_mudelid=a.hy_mudelid) as hy_name from hyt_searchconfig a where hy_ifsearch='是'"; sql1 += " order by hy_sort "; } //Response.Write(sql1); //return; DataTable dt = db.GetDataTable(sql1); if (dt.Rows.Count > 0) { //循环查询模块 for (int i = 0; i < dt.Rows.Count; i++) { string sql2 = ""; string ls_or = ""; string ls_mid = dt.Rows[i]["hy_mudelid"].ToString(); string ls_mname = dt.Rows[i]["hy_name"].ToString(); string ls_tid = dt.Rows[i]["hy_tableid"].ToString(); string ls_cid = dt.Rows[i]["hy_columnshowid"].ToString(); //hy_field1,hy_bt,hy_content1 string ls_xsid = dt.Rows[i]["hy_xszdid"].ToString(); string ls_kckryid = "+" + dt.Rows[i]["hy_kckryid"].ToString() + "+"; //根据表单ID得到表单信息 string ls_tname = "", ls_ifflow = "", ls_ifgk = "", ls_ifxssy = ""; HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig = Hyoa_tableconfig.GetTable(ls_tid); if (dt_tableconfig.Rows.Count > 0) { ls_tname = dt_tableconfig.Rows[0]["hy_name"].ToString(); //表单名称 ls_ifflow = dt_tableconfig.Rows[0]["hy_ifflowdoc"].ToString();//是否为流程表单 ls_ifgk = dt_tableconfig.Rows[0]["hy_ispuballByflowYB"].ToString(); //流程结束后是否公开 ls_ifxssy = dt_tableconfig.Rows[0]["hy_ifdisplayall"].ToString(); //是否显示所有记录 } dt_tableconfig.Clear(); if (ls_flag == "1") { //授权查看所有人员 sql2 = "select * from hyp_flowmain a where 1=1 "; } else { //某模块是否授权为可查看人员 if (ls_kckryid.IndexOf("+" + ls_uid + "+") >= 0) { sql2 = "select * from hyp_flowmain a where 1=1 "; } else { //未授权人员根据表单配置判断模块的数据显示情况 if (ls_ifflow == "是") { sql2 = "select * from hyp_flowmain a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID "; //流程模块 if (ls_ifgk == "是") { //流程结束后公开 sql2 += " and (','+b.hy_clrid+',' like '%," + ls_uid + ",%' or ','+b.hy_cyrid+',' like '%," + ls_uid + ",%' or a.hy_curtacheid='**' ) "; } if (ls_ifgk == "否") { //流程结束后不公开 sql2 += " and (','+b.hy_clrid+',' like '%," + ls_uid + ",%' or ','+b.hy_cyrid+',' like '%," + ls_uid + ",%') "; } } if (ls_ifflow == "否") { //非流程模块 if (ls_ifxssy == "是") { //非流程显示所有记录 sql2 = "select * from hyp_flowmain a where 1=1 "; } if (ls_ifxssy == "否") { //非流程不显示所有记录 sql2 = "select * from hyp_flowmain a where a.hy_djrid='" + ls_uid + "' "; } } } } //模块ID和表单ID sql2 += " and (a.hy_mudelid='" + ls_mid + "' and a.hy_tableid='" + ls_tid + "') "; //Response.Write(sql2); //return; //读取配置的查询条件 string[] lv_cid = ls_cid.Split(','); string[] lv_xsid = ls_xsid.Split(','); for (int kk = 0; kk < lv_cid.Length; kk++) { if (lv_cid[kk].ToString() != "") { //将查询的关键字组装起来 string ls_key = ""; for (int jj = 0; jj < lv_key.Length; jj++) { if (ls_key == "") { ls_key = lv_cid[kk] + " like '%" + lv_key[jj] + "%'"; } else { ls_key = ls_key +" "+ ls_op + " " + lv_cid[kk] + " like '%" + lv_key[jj] + "%'"; } } //将查询的字段组装起来 if (ls_or == "") { ls_or = "(" + ls_key + ")"; } else { ls_or = ls_or + " or " + "(" + ls_key + ")"; } } } if (ls_or != "") { sql2 += " and (" + ls_or + ")"; } sql2 += " order by a.hy_djsj desc "; DataTable dt2 = db.GetDataTable(sql2); //Response.Write(sql2+ "<br/>"+dt2.Rows.Count + "<br/>"); //return; if (dt2.Rows.Count > 0) { for (int ik = 0; ik < dt2.Rows.Count; ik++) { string ls_id = ""; ls_id = dt2.Rows[ik]["DOCID"].ToString(); if (ls_docids.IndexOf(ls_id) >= 0) { //存在 } else { string ls_bt = dt2.Rows[ik]["hy_bt"].ToString(); string ls_djr = dt2.Rows[ik]["hy_djrname"].ToString(); string ls_djrbm = dt2.Rows[ik]["hy_djrbmname"].ToString(); string ls_djsj = DateTime.Parse(dt2.Rows[ik]["hy_djsj"].ToString()).ToString("yyyy-MM-dd"); string ls_xsnr = " "; for (int kk = 0; kk < lv_xsid.Length; kk++) { if (lv_xsid[kk] != "") { string ls_zd = lv_xsid[kk]; ls_xsnr += dt2.Rows[ik][ls_zd].ToString() + " "; } } string ls_url = ""; if (ls_mid == "tzgg") { ls_url = "/displaypage.aspx?mid=" + ls_mid + "&docid=" + ls_id + "&rnd=" + System.Guid.NewGuid().ToString(); } else { ls_url = "../main.aspx?op=modify&mid=" + ls_mid + "&tableid=" + ls_tid + "&docid=" + ls_id + "&rnd=" + System.Guid.NewGuid().ToString(); } string ls_dqzt = ""; if (ls_ifflow == "是") { ls_dqzt = dt2.Rows[ik]["hy_curtachename"].ToString(); } string ls_xsnrnew = OutGetStr(ls_xsnr, 150); //for (int jj = 0; jj < lv_key.Length; jj++) //{ // ls_xsnrnew = ReplaceStr(OutGetStr(ls_xsnr, 150), lv_key[jj], "<font color='red'>" + lv_key[jj] + "</font>"); //} sb.Append("<table width=99% border=0 cellPadding=0 cellSpacing=2 bgcolor=\"#FFFFFF\">"); sb.Append("<tr onMouseOver=\"this.className='tr-over'\" onmouseout=\"this.className='TrList'\" class=\"TrList\">"); sb.Append("<td width=\"5%\" height=\"22\" align=\"center\">" + ls_Container + "</td>"); sb.Append("<td width=\"8%\" align=\"center\">" + ls_mname + "</td>"); sb.Append("<td width=\"8%\" align=\"center\">" + ls_djr + "</td>"); sb.Append("<td width=\"8%\" align=\"center\">" + ls_djrbm + "</td>"); sb.Append("<td width=\"10%\" align=\"center\">" + ls_djsj + "</td>"); sb.Append("<td align=\"center\">" + ls_xsnrnew + "</td>"); sb.Append("<td width=\"10%\" align=\"center\">" + ls_dqzt + "</td>"); sb.Append("<td width=\"5%\" align=\"center\"><a href=\"#\" onclick=\"var ss='" + ls_url + "';window.location =ss;\">操作</a></td>"); sb.Append("<td width=\"5%\" align=\"center\"><a href=\"#\" onclick=\"var ss='" + ls_url + "';window.open(ss,'','');\">弹出</a></td>"); sb.Append("</tr>"); sb.Append("</table>"); ls_Container++; if (ls_docids == "") { ls_docids = ls_id; } else { ls_docids = ls_docids + "," + ls_id; } } } } dt2.Clear(); } } //附件查询 string key_fj = ""; for (int jj = 0; jj < lv_key.Length; jj++) { if (key_fj == "") { key_fj = " hy_filename like '%" + lv_key[jj] + "%' "; } else { key_fj = key_fj + ls_op + " hy_filename like '%" + lv_key[jj] + "%' "; } } //string sqlfj = "select * from hyp_fileatt where " + key_fj + " order by hy_djsj desc "; string sqlfj = ""; if (this.Request.QueryString["Modelid"].ToString() != "") { sqlfj = "select *,(select hy_mudelname from hyt_mudel where b.hy_mudelid = hy_mudelid) as hy_mudelname from hyp_fileatt a,hyp_flowmain b "; sqlfj += " where a.hy_fatherid = b.DOCID and b.hy_mudelid = '" + this.Request.QueryString["Modelid"].ToString() + "' "; sqlfj += " and " + key_fj + " order by a.hy_djsj desc "; //sqlfj = "select *,(select hy_mudelid from hyp_flowmain where a.hy_fatherid = DOCID) from hyp_fileatt a "; //sqlfj += " where (select hy_mudelid from hyp_flowmain where a.hy_fatherid = DOCID)= '" + this.Request.QueryString["Modelid"].ToString() + "' and " + key_fj + " order by a.hy_djsj desc "; } else { sqlfj = "select *,(select hy_mudelname from hyt_mudel where b.hy_mudelid = hy_mudelid) as hy_mudelname from hyp_fileatt a,hyp_flowmain b where a.hy_fatherid = b.DOCID and " + key_fj + " order by hy_djsj desc "; } DataTable dt22 = db.GetDataTable(sqlfj); if (dt22.Rows.Count > 0) { for (int ik = 0; ik < dt22.Rows.Count; ik++) { string ls_id = dt22.Rows[ik]["hy_fatherid"].ToString(); if (ls_docids.IndexOf(ls_id) >= 0) { //存在 } else { //不存在时判断是否有权限查看 string ls_xsbzw = "0"; string ls_bt = dt22.Rows[ik]["hy_bt"].ToString(); string ls_djrid = dt22.Rows[ik]["hy_djrid"].ToString(); string ls_djr = dt22.Rows[ik]["hy_djrname"].ToString(); string ls_djrbm = dt22.Rows[ik]["hy_djrbmname"].ToString(); string ls_djsj = DateTime.Parse(dt22.Rows[ik]["hy_djsj"].ToString()).ToString("yyyy-MM-dd"); string ls_xsnr = dt22.Rows[ik]["hy_bt"].ToString() + " "; string ls_midfj = dt22.Rows[ik]["hy_mudelid"].ToString(); string ls_mname = dt22.Rows[ik]["hy_mudelname"].ToString(); string ls_tidfj = dt22.Rows[ik]["hy_tableid"].ToString(); string ls_url = ""; if (ls_midfj == "tzgg") { ls_url = "/displaypage.aspx?mid=" + ls_midfj + "&docid=" + ls_id + "&rnd=" + System.Guid.NewGuid().ToString(); } else { ls_url = "../main.aspx?op=modify&mid=" + ls_midfj + "&tableid=" + ls_tidfj + "&docid=" + ls_id + "&rnd=" + System.Guid.NewGuid().ToString(); } string ls_dqzt = dt22.Rows[ik]["hy_curtachename"].ToString(); string ls_xsnrnew = OutGetStr(ls_xsnr, 150); //判断显示权限 if (ls_flag == "1") { ls_xsbzw="1"; //显示记录 } else { //判断该模块是否有权限显示查询结果 string sql11 = "select * from hyt_searchconfig where hy_ifsearch='是' and hy_mudelid='" + ls_midfj + "'"; DataTable dt11 = db.GetDataTable(sql11); if (dt11.Rows.Count > 0) { string ls_kckryid = "+" + dt.Rows[0]["hy_kckryid"].ToString() + "+"; //某模块是否授权为可查看人员 if (ls_kckryid.IndexOf("+" + ls_uid + "+") >= 0) { ls_xsbzw = "1";//显示记录 } else { //判断该模块是否该人员涉及过 string ls_tname2 = "", ls_ifflow2 = "", ls_trole2 = "", ls_ifgk2 = "", ls_ifxssy2 = ""; HyoaClass.Hyoa_tableconfig Hyoa_tableconfig = new HyoaClass.Hyoa_tableconfig(); DataTable dt_tableconfig2 = Hyoa_tableconfig.GetTable(ls_tidfj); if (dt_tableconfig2.Rows.Count > 0) { ls_tname2 = dt_tableconfig2.Rows[0]["hy_name"].ToString(); //表单名称 ls_ifflow2 = dt_tableconfig2.Rows[0]["hy_ifflowdoc"].ToString();//是否为流程表单 ls_trole2 = dt_tableconfig2.Rows[0]["hy_tablerole"].ToString(); //表单类型 ls_ifgk2 = dt_tableconfig2.Rows[0]["hy_ispuballByflowYB"].ToString(); //流程结束后是否公开 ls_ifxssy2 = dt_tableconfig2.Rows[0]["hy_ifdisplayall"].ToString(); //是否显示所有记录 } dt_tableconfig2.Clear(); //未授权人员根据表单配置判断模块的数据显示情况 if (ls_ifflow2 == "是") { //流程模块 if (ls_ifgk2 == "是") { //流程结束后公开 ls_xsbzw = "1";//显示记录 } else { //流程结束后不公开 string sql2 = "select * from hyp_flowmain a,hyp_flowhistoryinfo_cl b where a.DOCID=b.DOCID and a.DOCID='" + ls_id + "'"; sql2 += " and (','+b.hy_clrid+',' like '%," + ls_uid + ",%' or ','+b.hy_cyrid+',' like '%," + ls_uid + ",%') "; DataTable dt_lcbgk = db.GetDataTable(sql2); if (dt_lcbgk.Rows.Count > 0) { ls_xsbzw = "1";//显示记录 } } } else { //非流程模块 if (ls_ifxssy2 == "是") { //非流程显示所有记录 ls_xsbzw = "1";//显示记录 } else { //非流程不显示所有记录 if (ls_djrid == ls_uid) { ls_xsbzw = "1";//显示记录 } } } } } } if (ls_xsbzw == "1") { #region 显示查询结果内容 sb.Append("<table width=99% border=0 cellPadding=0 cellSpacing=2 bgcolor=\"#FFFFFF\">"); sb.Append("<tr onMouseOver=\"this.className='tr-over'\" onmouseout=\"this.className='TrList'\" class=\"TrList\">"); sb.Append("<td width=\"5%\" height=\"22\" align=\"center\">" + ls_Container + "</td>"); sb.Append("<td width=\"8%\" align=\"center\">" + ls_mname + "</td>"); sb.Append("<td width=\"8%\" align=\"center\">" + ls_djr + "</td>"); sb.Append("<td width=\"8%\" align=\"center\">" + ls_djrbm + "</td>"); sb.Append("<td width=\"10%\" align=\"center\">" + ls_djsj + "</td>"); sb.Append("<td align=\"center\">" + ls_xsnrnew + "</td>"); sb.Append("<td width=\"10%\" align=\"center\">" + ls_dqzt + "</td>"); sb.Append("<td width=\"5%\" align=\"center\"><a href=\"#\" onclick=\"var ss='" + ls_url + "';window.location =ss;\">操作</a></td>"); sb.Append("<td width=\"5%\" align=\"center\"><a href=\"#\" onclick=\"var ss='" + ls_url + "';window.open(ss,'','');\">弹出</a></td>"); sb.Append("</tr>"); sb.Append("</table>"); ls_Container++; if (ls_docids == "") { ls_docids = ls_id; } else { ls_docids = ls_docids + "," + ls_id; } #endregion } } } } dt.Clear(); this.lblsearch.Text = sb.ToString(); db.Close(); }