protected void Page_Load(object sender, EventArgs e) { string ls_value1 = ""; string ls_value2 = ""; if (this.Request.QueryString["lsvalue1"] != null) { ls_value1 = this.Request.QueryString["lsvalue1"].ToString(); //类别 } if (this.Request.QueryString["lsvalue2"] != null) { ls_value2 = this.Request.QueryString["lsvalue2"].ToString(); //年份 } //Response.Write(ls_value2); HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "select hy_field37 from hyp_flowmain where hy_mudelid='Mudellsh' and hy_field1='" + ls_value1 + "' and hy_field2='" + ls_value2 + "' order by hy_field36"; //Response.Write(lssql); DataTable dt = db.GetDataTable(lssql); if (dt.Rows.Count > 0) { this.Response.Write(dt.Rows[0][0].ToString()); } else { this.Response.Write("1"); } }
//获取投票数量的比例 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 btndelinfo_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); string sql = ""; String[] v_uids = this.txtuids.Value.Split(','); for (int i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { //删除当前记录 sql = "delete from hyk_whzx_tpgl_tpmx where id='" + v_uids[i] + "'"; db.Execute(sql); ////删除审阅意见记录 //sql = "delete from hyky_syyj where hy_tableid='" + v_uids[i] + "'"; //db.Execute(sql); ////删除待办事宜 //sql = "delete from hyt_dbsy where DOCID='" + v_uids[i] + "'"; //db.Execute(sql); } } this.txtuids.Value = ""; //DataPlay(1); db.Close(); DataPlay(System.Int32.Parse(this.curpage.Text)); }
protected void Page_Load(object sender, EventArgs e) { string lsyear = ""; if (this.Request.QueryString["lsyear"] != null) { lsyear = this.Request.QueryString["lsyear"].ToString(); } HyoaClass.DAO db = new HyoaClass.DAO(); //本年已年休天数 string lssql1 = "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_field3='"+lsyear+"'"; //可年休天数 string lssql2 = "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() + "' and hy_field3='" + lsyear + "'"; DataTable dt1 = db.GetDataTable(lssql1); DataTable dt2 = db.GetDataTable(lssql2); string lsstr1 = "0"; string lsstr2 = "0"; if (dt1.Rows.Count > 0) { lsstr1 = dt1.Rows[0][0].ToString(); } if (dt2.Rows.Count > 0) { lsstr2 = dt2.Rows[0][0].ToString(); } this.Response.Write(lsstr1 + "#" + lsstr2); //return ; }
//部门信息得分 public string GetDF(string deptname) { string ls_temp = deptname; string lsif = ""; HyoaClass.DAO db = new HyoaClass.DAO(); if (this.hy_djsj_start_1.Value != "") { lsif += " and CONVERT(varchar(10), hy_field31, 120)>='" + this.hy_djsj_start_1.Value + "' "; } if (this.hy_djsj_end_1.Value != "") { lsif += " and CONVERT(varchar(10), hy_field31, 120)<='" + this.hy_djsj_end_1.Value + "' "; } string strSelect = "select * from hyt_user d left join hyp_flowmain m on d.hy_username=m.hy_field6 left join hyt_dept n on n.hy_deptid=d.hy_deptid where m.hy_mudelid='xxgl' and m.hy_tableid='f1265875-5494-465f-ac33-6fa43d208c8f' " + lsif + " and n.hy_deptname='" + ls_temp + "' order by d.hy_deptid,d.hy_sort"; double tt = 0; DataTable dt = db.GetDataTable(strSelect); if (dt.Rows.Count != 0) { for (int i = 0; i < dt.Rows.Count; i++) { tt += double.Parse(dt.Rows[i]["hy_field9"].ToString()); } } return tt.ToString(); }
protected void Page_Load(object sender, EventArgs e) { string lsyear = ""; if (this.Request.QueryString["lsyear"] != null) { lsyear = this.Request.QueryString["lsyear"].ToString(); } HyoaClass.DAO db = new HyoaClass.DAO(); //本年已加班天数 string lssql1 = "select sum(convert(float,hy_field16)) from hyp_flowmain where hy_mudelid='jbsq' and "; lssql1 += " hy_tableid='c980c86b-da0c-4758-b3d8-7236240c77da' and hy_curtacheid='**' and "; lssql1 += " hy_djrid='" + this.Session["hyuid"].ToString() + "' and datename(year,hy_field31)='" + lsyear + "'"; //已调休天数 string lssql2 = "select sum(convert(float,hy_field2)) from hyp_flowmain where hy_mudelid='qjsq' and "; lssql2 += " hy_tableid='d4af25f1-c7c0-4df9-a3b4-2c968ec3f2bc' and hy_curtacheid='**' and hy_field1='调休' and "; lssql2 += " hy_djrid='" + this.Session["hyuid"].ToString() + "' and hy_field3='" + lsyear + "'"; DataTable dt1 = db.GetDataTable(lssql1); DataTable dt2 = db.GetDataTable(lssql2); string lsstr1 = "0"; string lsstr2 = "0"; if (dt1.Rows.Count > 0) { lsstr1 = dt1.Rows[0][0].ToString(); } if (dt2.Rows.Count > 0) { lsstr2 = dt2.Rows[0][0].ToString(); } this.Response.Write(lsstr1 + "#" + lsstr2); //return ; }
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 hy_field3 from hyp_flowmain where hy_mudelid='" + ls_mudelid + "' and hy_tableid='" + ls_tableid + "' and hy_field2='" + ls_value + "'"; DataTable dt = db.GetDataTable(lssql); this.Response.Write(dt.Rows[0]["hy_field3"].ToString()); //return ; }
protected void btnscsj_Click_gzjcb(object sender, EventArgs e) { //工作检查表 HyoaClass.DAO db = new HyoaClass.DAO(); string sql = "select * from hyp_flowmain where hy_mudelid='djgz' and hy_tableid='0e5efe98-49a5-4ccd-9532-8cac74ab328d' "; if (this.hy_field9_1.Value != "") sql += " and hy_field9 like '%" + this.hy_field9_1.Value + "%' "; if (this.hy_djsj_start_1.Value != "") sql += " and CONVERT(varchar(10),hy_field31,120) >= '" + this.hy_djsj_start_1.Value + "' "; if (this.hy_djsj_end_1.Value != "") sql += " and CONVERT(varchar(10),hy_field31,120) <= '" + this.hy_djsj_end_1.Value + "' "; sql += " and (hy_field8='委员会' or hy_field8='党员大会' or hy_field8='党课' or hy_field8='其它组织生活') order by hy_field31 asc "; //this.Response.Write(sql); DataTable dt = db.GetDataTable(sql); string lsstr = ""; for (int i = 0; i < dt.Rows.Count; i++) { lsstr += (i + 1).ToString() + "~" + System.DateTime.Parse(dt.Rows[i]["hy_field31"].ToString()).ToShortDateString() + "~" + dt.Rows[i]["hy_field7"].ToString(); lsstr += "~" + dt.Rows[i]["hy_field37"].ToString() + "~" + dt.Rows[i]["hy_field38"].ToString() + "~" + dt.Rows[i]["hy_field8"].ToString() + ":" + dt.Rows[i]["hy_bt"].ToString(); lsstr += "#*"; } this.hy_count.Text = dt.Rows.Count.ToString(); this.hy_scsj.Text = lsstr; this.Response.Write("<script>alert('生成完成,请点击导出按钮!');</script>"); }
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(); } }
private void DataPlay(int PageNo) { //得到当前页号 HyoaClass.DAO db = new HyoaClass.DAO(); string sql = ""; sql = "select * from hyp_flowmain where hy_mudelid='clgl' and hy_tableid='0b5c53fe-114b-4fa3-8b59-4163b3053504' "; if (this.hy_djsj_start_1.Value != "") sql += " and hy_field31>='" + this.hy_djsj_start_1.Value + "' "; if (this.hy_djsj_end_1.Value != "") sql += " and hy_field31<='" + this.hy_djsj_end_1.Value + "' "; if (this.hy_field1_1.SelectedValue != "") sql += " and hy_field1 like '%" + this.hy_field1_1.SelectedValue + "%' "; if (this.hy_field3_1.SelectedValue != "") sql += " and hy_field3 like '%" + this.hy_field3_1.SelectedValue + "%' "; if (this.hy_field2_1.Text != "") sql += " and hy_field2 like '%" + this.hy_field2_1.Text + "%' "; sql += " order by hy_field1 "; DataTable dt = db.GetDataTable(sql); DataTable tempTable = dt.Clone(); //DataView dv = new DataView(); //dv.Table = tempTable; Int32 lisumjf = 0; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } lisumjf += System.Int32.Parse(dt.Rows[i]["hy_field37"].ToString()); tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.rptlist.DataSource = tempTable; //this.Response.Write("<script>alert('" + lisumjf + "')</script>"); if (lisumjf != 0) { this.lbsumjf.Text = "<font color=red>经费总计:" + lisumjf.ToString() + "元</font>"; } else { this.lbsumjf.Text = ""; } this.rptlist.DataBind(); dt.Clear(); }
private void DataPlay(int PageNo) { //得到当前页号 HyoaClass.DAO db = new HyoaClass.DAO(); string sql = ""; sql = "select * from hyp_flowmain where hy_mudelid='clgl' and hy_tableid='a7c3875f-d6c8-4c9d-819b-e5e84a6bd79f' "; sql += " order by hy_field1 "; DataTable dt = db.GetDataTable(sql); DataTable tempTable = dt.Clone(); DataColumn col1 = new DataColumn("lcs", typeof(String)); tempTable.Columns.Add(col1); for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } //根据车牌号去查找这辆车的里程数的记录 string lsdateend; string ls_sqllc = "select sum(hy_field36) from hyp_flowmain where hy_mudelid='clgl' and hy_tableid='8b10b316-98d6-4a50-bc15-52745bb119bb' and hy_field5='" + dt.Rows[i]["hy_field1"].ToString()+"' "; if (this.hy_djsj_start_1.Value!="") { ls_sqllc = ls_sqllc + " and hy_djsj>='" + this.hy_djsj_start_1.Value + "' "; } if (this.hy_djsj_end_1.Value != "") { lsdateend = this.hy_djsj_end_1.Value; DateTime dts = Convert.ToDateTime(lsdateend); DateTime date_effect = dts.AddDays(1);//加一天 ls_sqllc = ls_sqllc + " and hy_djsj<='" + date_effect.ToString("yyyy-MM-dd").ToString() + "' "; } DataTable dt_gettoday = db.GetDataTable(ls_sqllc); if (dt_gettoday.Rows.Count > 0) { dr["lcs"] = dt_gettoday.Rows[0][0]; } tempTable.Rows.Add(dr); } DataView dv = new DataView(); dv.Table = tempTable; int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.rptlist.DataSource = dv; this.rptlist.DataBind(); dt.Clear(); }
//保存 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>"); } }
private void DataPlay(int PageNo) { //得到当前页号 HyoaClass.DAO db = new HyoaClass.DAO(); string sql = ""; sql = "select * from hyp_flowmain where hy_mudelid='jdgl' and hy_tableid='30cecb42-bdec-4ed8-9392-b7c682e16b3f' "; if (this.hy_field31_start_1.Value != "") sql += " and hy_field31>='" + this.hy_field31_start_1.Value + "' "; if (this.hy_field31_end_1.Value != "") sql += " and hy_field31<='" + this.hy_field31_end_1.Value + "' "; if (this.hy_djrbmname_1.Text != "") sql += " and hy_djrbmname like '%" + this.hy_djrbmname_1.Text + "%' "; sql += " order by hy_field31 "; DataTable dt = db.GetDataTable(sql); DataTable tempTable = dt.Clone(); //DataView dv = new DataView(); //dv.Table = tempTable; Double lisumjf = 0; for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = tempTable.NewRow(); for (int j = 0; j < dt.Columns.Count; j++) { dr[dt.Columns[j].ColumnName] = dt.Rows[i][j]; } if (dt.Rows[i]["hy_field26"].ToString() != "") { lisumjf += System.Double.Parse(dt.Rows[i]["hy_field26"].ToString()); } tempTable.Rows.Add(dr); } int TotalRecord = dt.Rows.Count; this.sumts.Text = TotalRecord.ToString(); this.sumts2.Text = TotalRecord.ToString(); this.rptlist.DataSource = tempTable; //this.Response.Write("<script>alert('" + lisumjf + "')</script>"); if (lisumjf != 0) { this.lbsumjf.Text = "<font color=red>经费总计:" + lisumjf.ToString() + "元</font>"; } else { this.lbsumjf.Text = ""; } this.rptlist.DataBind(); dt.Clear(); }
protected void Page_Load(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); String lssql = ""; for (int i = 0; i < 8000000; i++) { lssql = "insert into hyq_tb1_main (docid,hy_maindocid,hy_xm,hy_ytbrgx,hy_ytbrgx_bz) values ('" + i.ToString() + "','" + i.ToString() + "','" + i.ToString() + "','" + i.ToString() + "','" + i.ToString() +"')"; db.Execute(lssql); } this.Response.Write("插入完成!"); }
protected void Page_Load(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() =="") this.Response.Redirect("/login.aspx"); if (!IsPostBack) { if (this.Request.QueryString["mid"] != null) { this.txtmudelid.Value = Request.QueryString["mid"].ToString(); } else { this.Response.Write("<script>alert('模块ID没有传入,请联系管理员!');</script>"); return; } if (this.Request.QueryString["tableid"] != null) { this.txttableid.Value = Request.QueryString["tableid"].ToString(); } else { this.Response.Write("<script>alert('表单ID没有传入,请联系管理员!');</script>"); return; } //加车牌号下拉信息 HyoaClass.DAO clgldb = new HyoaClass.DAO(); string lsclglsql = "select hy_field1 from hyp_flowmain where hy_mudelid='clgl' and hy_tableid='a7c3875f-d6c8-4c9d-819b-e5e84a6bd79f'"; DataTable dtclgl = clgldb.GetDataTable(lsclglsql); if (dtclgl.Rows.Count > 0) { this.hy_field1_1.DataSource = dtclgl; 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, new ListItem("", "")); this.hy_field1_1.SelectedIndex = 0; //this.ddlmudelid.Items.Insert(0, new ListItem(lsmudel, lsmudelid)); } //经费类别下拉信息 this.hy_field3_1.Items.Insert(0, ""); this.hy_field3_1.Items.Insert(1, "保养经费"); this.hy_field3_1.Items.Insert(2, "维护经费"); this.hy_field3_1.Items.Insert(3, "汽油经费"); this.txturl.Text = this.Request.RawUrl; DataPlay(1); } }
protected void Page_Load(object sender, EventArgs e) { string ls_temp = ""; if (this.Request.QueryString["ls_txtdocid"] != null) { ls_temp = this.Request.QueryString["ls_txtdocid"].ToString(); } HyoaClass.DAO db = new HyoaClass.DAO(); string sql = "select * from hyp_flowmain where hy_mudelid='rsgl' and hy_tableid='6047076e-6a95-4fb8-aec8-5551d3900590' and docid='" + ls_temp + "'"; DataTable dt = db.GetDataTable(sql); if (dt.Rows.Count > 0) { this.Response.Write(dt.Rows[0]["hy_field11"].ToString()); } }
protected void btndelinfo_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); String[] v_uids = this.txtuids.Value.Split(','); for (int i = 0; i < v_uids.Length; i++) { if (v_uids[i] != "") { string sqlstr = "delete from hyk_whzx_tpgl_tplb where id='" + v_uids[i] + "'"; db.Execute(sqlstr); } } this.txtuids.Value = ""; //DataPlay(1); DataPlay(System.Int32.Parse(this.curpage.Text)); }
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)); }
private void DataPlay() { HyoaClass.DAO db = new HyoaClass.DAO(); string ls_html = ""; float ls_sum = 0; String[] v_ids = this.txtids.Value.Split(','); for (var i = 0; i < v_ids.Length; i++) { //根据ID得到信息 string ls_sql = "select * from hyp_flowmain where DOCID='" + v_ids[i] + "'"; DataTable dt = db.GetDataTable(ls_sql); if (dt.Rows.Count > 0) { string ls_spyj = dt.Rows[0]["hy_content2"].ToString(); ls_spyj = ls_spyj.Replace("<br>",""); ls_spyj = ls_spyj.Replace(" ", " "); //ls_spyj = ls_spyj.Replace(" ", ""); ls_spyj = ls_spyj.Replace(")", ")<br>"); string ls_spyj2 = dt.Rows[0]["hy_content3"].ToString(); ls_spyj2 = ls_spyj2.Replace("<br>", ""); ls_spyj2 = ls_spyj2.Replace(" ", " "); //ls_spyj = ls_spyj.Replace(" ", ""); ls_spyj2 = ls_spyj2.Replace(")", ")<br>"); ls_html += "<tr onMouseOver=\"this.className='tr-over'\" onmouseout=\"this.className='TrList_ciq'\" class=\"TrList_ciq\">"; ls_html += "<td width=\"5%\" height=\"28\" align=\"center\">" + (i + 1) + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + dt.Rows[0]["hy_djrname"].ToString() + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + dt.Rows[0]["hy_djrbmname"].ToString() + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + DateTime.Parse(dt.Rows[0]["hy_djsj"].ToString()).ToString("yyyy-MM-dd") + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + dt.Rows[0]["hy_field16"].ToString() + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + dt.Rows[0]["hy_bt"].ToString() + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + dt.Rows[0]["hy_field1"].ToString() + "</td>"; ls_html += "<td width=\"8%\" align=\"center\">" + dt.Rows[0]["hy_field99"].ToString() + "</td>"; ls_html += "<td width=\"12%\" align=\"center\">" + dt.Rows[0]["hy_content1"].ToString() + "</td>"; ls_html += "<td width=\"27%\" align=\"left\">" + ls_spyj + ls_spyj2 + "</td>"; ls_html += "</tr>"; ls_sum += float.Parse(dt.Rows[0]["hy_field99"].ToString()); } } this.lblsum.Text = "合计总额:" + ls_sum.ToString("f2"); this.lblhtml.Text = ls_html; }
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 Page_Load(object sender, EventArgs e) { //生成省侨办的用户及密码 HyoaClass.DAO db = new HyoaClass.DAO(); String lssql = "select * from hyt_user where 1=1 order by hy_userid"; DataTable dt = db.GetDataTable(lssql); this.Response.Write("<table border='1'>"); Random Random1 = new Random(); int i1; String lspassword = ""; String lssqlupdate = ""; for (int i = 0; i < dt.Rows.Count; i++) { this.Response.Write("<tr>"); this.Response.Write("<td>"); this.Response.Write("登录名"); this.Response.Write("</td>"); this.Response.Write("<td>"); this.Response.Write(dt.Rows[i]["hy_userid"].ToString()); this.Response.Write("</td>"); this.Response.Write("<td>"); this.Response.Write("中文名"); this.Response.Write("</td>"); this.Response.Write("<td>"); this.Response.Write(dt.Rows[i]["hy_username"].ToString()); this.Response.Write("</td>"); this.Response.Write("<td>"); this.Response.Write("密码"); this.Response.Write("</td>"); this.Response.Write("<td>"); i1 = Random1.Next(100000, 999999); this.Response.Write(i1.ToString()); this.Response.Write("</td>"); this.Response.Write("</tr>"); lspassword = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(i1.ToString(), "MD5"); lssqlupdate = "update hyt_user set hy_pwd='" + lspassword + "' where hy_userid='" + dt.Rows[i]["hy_userid"].ToString() + "'"; db.Execute(lssqlupdate); } this.Response.Write("</table>"); }
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 btn_bh1_Click(object sender, EventArgs e) { //更新投票表 HyoaClass.DAO db = new HyoaClass.DAO(); string ls_sql = "update hyk_whzx_tpgl set hy_bhsj=getdate(),hy_gjzt='驳回投票' where id='" + this.txtdocid.Value + "'"; db.Execute(ls_sql); 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>"); } }
protected void Page_Load(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); string lssql = "select hy_field1 from hyp_flowmain where hy_mudelid='grtxl_fl' and hy_tableid='c1d7829d-ce46-498c-bec9-f0cc84c39c4a' and hy_djrid='" + this.Session["hyuid"].ToString() + "' order by hy_field2 asc"; DataTable dt = db.GetDataTable(lssql); string ls_return = ""; if (dt.Rows.Count > 0) { for(var i=0;i<dt.Rows.Count;i++) { if (ls_return == "") ls_return = dt.Rows[i][0].ToString(); else ls_return += ","+dt.Rows[i][0].ToString(); } } this.Response.Write(ls_return); //return ; }
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 btn_save_Click(object sender, EventArgs e) { if (this.Session["hyuid"].ToString() == "") this.Response.Redirect("../../login.aspx"); string ls_tip = "保存成功!"; HyoaClass.DAO db = new HyoaClass.DAO(); string sql = ""; if (this.hy_field2.Value == "") { this.hy_field2.Value = "1"; } //新文档时 if (this.txtop.Value == "add") { sql += "insert into hyk_whzx_tpgl_tplb (id,hy_tplbmc,hy_sort) values ("; sql += "'" + System.Guid.NewGuid().ToString() + "','" + this.hy_field1.Value + "'," + int.Parse(this.hy_field2.Value) + ")"; db.Execute(sql); } else { sql += "update hyk_whzx_tpgl_tplb set hy_tplbmc='" + this.hy_field1.Value + "',hy_sort=" + int.Parse(this.hy_field2.Value) + " where id='" + this.hy_id.Value + "'"; db.Execute(sql); } //处理完成后的提示及跳转 if (this.txtifpop.Value == "") { Response.Write("<script>alert('" + ls_tip + "');window.location='" + this.txturl.Text + "'</script>"); } else { Response.Write("<script>alert('" + ls_tip + "');self.close();</script>"); } db.Close(); }
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 hy_field37,hy_field38 from hyp_flowmain where hy_mudelid='" + ls_mudelid + "' and hy_tableid='" + ls_tableid + "' and hy_field1='" + ls_value + "'"; DataTable dt = db.GetDataTable(lssql); //是否包含小数点,包含的话,取小数点后两位 string lsgetputfiled; //价格(单价 if (dt.Rows[0][0].ToString().Contains(".") == true) { lsgetputfiled = float.Parse(dt.Rows[0][0].ToString()).ToString("F2"); } else { lsgetputfiled = float.Parse(dt.Rows[0][0].ToString()).ToString(); } this.Response.Write(lsgetputfiled + "," + dt.Rows[0][1].ToString()); //return ; }
//添加候选项 protected void btn_add1_Click(object sender, EventArgs e) { HyoaClass.DAO db = new HyoaClass.DAO(); string ls_sql = ""; int ls_sort = 1; //通过问卷题目ID得到最大排序号 ls_sql = "select max(hy_sort) as hy_sort,count(*) as num from hyk_whzx_tpgl_tpxx where hy_tpztid='" + this.txtdocid.Value + "' order by hy_sort desc "; DataTable dt = db.GetDataTable(ls_sql); if (dt.Rows[0]["num"].ToString() != "0") { ls_sort = System.Int32.Parse(dt.Rows[0]["hy_sort"].ToString()) + 1; } dt.Clear(); ls_sql = "insert into hyk_whzx_tpgl_tpxx (id,hy_tpztid,hy_tpxxmc,hy_sort) values ("; ls_sql += "'" + System.Guid.NewGuid().ToString() + "','" + this.txtdocid.Value + "','" + this.hy_hxx.Value + "'," + ls_sort + ""; ls_sql += ")"; db.Execute(ls_sql); savetj("准备投票"); //处理完成后的提示及跳转(增加刷新候选项功能) Response.Write("<script>window.location='main_tpgl.aspx?op=modify&id=" + this.txtdocid.Value + "&url=" + this.txturl.Value + "'</script>"); }
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; } }
//判断是否已经投票过 public string pdsftpg(string pis_id) { string rValue = "<font color='red'>我要投票</font>"; HyoaClass.DAO db = new HyoaClass.DAO(); string sql1 = "select * from hyk_whzx_tpgl_tpmx where hy_tpztid='" + pis_id + "' and hy_tprid='" + this.Session["hyuid"].ToString() + "' "; DataTable dt = db.GetDataTable(sql1); if (dt.Rows.Count > 0) { rValue = "已投票"; } string sql2 = "select * from hyk_whzx_tpgl where id='" + pis_id + "'"; DataTable dt2 = db.GetDataTable(sql2); if (dt2.Rows.Count > 0) { if (dt2.Rows[0]["hy_gjzt"].ToString() == "结束投票") { rValue = "<font color='bule'>结束投票</font>"; } } dt.Clear(); dt2.Clear(); db.Close(); return rValue; }