合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
##后台处理获取打印数据 ``` using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using NetWing.Common.Data.SqlServer; using System.Data; using System.Data.Sql; using System.Data.SqlClient; namespace NetWing.BPM.Admin { public partial class print : System.Web.UI.Page { public DataRow homemasterdr = null;//户主信息 public DataTable huzhuxxdt = null;//户主信息 public DataTable peoples = null;//除户主外家庭成员信息 public DataTable jydt = null;//教育情况DataTable public DataTable yldt = null;//养老保险DataTable public DataTable dbdt = null;//低保情况 public DataTable cldt = null;//其它情况(车辆信息) public DataTable hbdt = null;//其它情况(患病情况) public DataTable yzdt = null;//养殖收入 public DataTable zzdt = null;//种植收入 public DataTable gzdt = null;//工资收入 public DataTable qtdt = null;//其它收入 public DataTable zcdt = null;//其它支出 public DataTable jtdt = null;//家庭属性 public DataTable jcdt = null;//车辆图片 public DataRow fwdr = null;//房屋图片 public DataRow dbdr = null; public string nf = ""; public string sqlwhere = ""; public string[] strArr = { }; protected void Page_Load(object sender, EventArgs e) { nf = Request["nf"]; if (!string.IsNullOrEmpty(nf))//不为空 { sqlwhere = " and years='"+ nf + "'"; } else//空 { } if (!IsPostBack) { string homemasteridcard = Request["homemasteridcard"];//户主身份证号 homemasterdr = SqlEasy.ExecuteDataRow("select top 1 * from No1_people where idcard='" + homemasteridcard + "'");//得到户主信息 //户主信息 huzhuxxdt = SqlEasy.ExecuteDataTable("select top 1 * from No1_people where idcard='" + homemasteridcard + "'"); //得到家庭成员户主除外 peoples = SqlEasy.ExecuteDataTable("select * from No1_people where idcard<>'" + homemasteridcard + "' and homemasteridcard='" + homemasteridcard + "'"); //教育情况处理思路 //1.把户主,家庭成员身份证信息取出来列成 'a','b', //2.算出有几个人参加过教育培训 //3.把教育培训的人返回datatable //例子:SQL codeselect * from student where name in ('张三','李四')- string peoplesidcards = "'" + homemasteridcard + "'"; foreach (DataRow psdr in peoples.Rows) { peoplesidcards = peoplesidcards + ",'" + psdr["idcard"].ToString() + "'"; } //家庭属性 jtdt = SqlEasy.ExecuteDataTable("select * from No1_people where idcard in (" + peoplesidcards + ")"); //教育情况 jydt = SqlEasy.ExecuteDataTable("select * from No1_jiaoyu where idcard in (" + peoplesidcards + ")"); //养老保险 yldt = SqlEasy.ExecuteDataTable("select * from No1_yanglaobx where idcard in (" + peoplesidcards + ")" + sqlwhere); //低保情况 //string sqlff = "select * from No1_dibao where idcard in (" + peoplesidcards + ")"; dbdt = SqlEasy.ExecuteDataTable("select * from No1_dibao where idcard in (" + peoplesidcards + ")" + sqlwhere); //其它情况 cldt = SqlEasy.ExecuteDataTable("select * from No1_cheliangxinxi where idcard in (" + peoplesidcards + ")");//车辆信息 hbdt = SqlEasy.ExecuteDataTable("select * from No1_huanbingqk where idcard in (" + peoplesidcards + ")");//患病情况 //养殖收入 yzdt = SqlEasy.ExecuteDataTable("select * from No1_yangzhishr where idcard in (" + peoplesidcards + ") " + sqlwhere); //种植收入 zzdt = SqlEasy.ExecuteDataTable("select * from No1_zhongzhishr where idcard in (" + peoplesidcards + ")" + sqlwhere); //工资收入 gzdt = SqlEasy.ExecuteDataTable("select * from No1_gongzishr where idcard in (" + peoplesidcards + ")" + sqlwhere); //其它收入 qtdt=SqlEasy.ExecuteDataTable("select * from No1_zhuanyishr where idcard in (" + peoplesidcards + ")" + sqlwhere); //其他支出 zcdt = SqlEasy.ExecuteDataTable("select * from No1_zhichuqk where idcard in (" + peoplesidcards + ")" + sqlwhere); //车辆图片 jcdt = SqlEasy.ExecuteDataTable("select top 2 * from No1_cheliangxinxi where idcard in (" + peoplesidcards + ")"); //房屋照片 string sqlcha = "select photos from No1_people where idcard='" + homemasteridcard + "'"; DataRow fwdt = SqlEasy.ExecuteDataRow(sqlcha); strArr = fwdt["photos"].ToString().Split(';'); } } /// <summary> /// 判断是否有残疾证 /// </summary> /// <param name="idcard">身份证号</param> /// <returns></returns> public static string IsCanji(string idcard) { //判断库里是否有这条数据,有一条返回1有N条返回N没有返回0 int k= (int)SqlEasy.ExecuteScalar("select count(keyid) from No1_canji where cardno='" + idcard + "'" ); if (k==0) { return "否"; } else { return "是"; } } /// <summary> /// 判断是否是低保 /// </summary> /// <param name="idcard">身份证号</param> /// <returns></returns> public static string IsDibao(string idcard) { //判断库里是否有这条数据,有一条返回1有N条返回N没有返回0 int d = (int)SqlEasy.ExecuteScalar("select count(keyid) from No1_dibao where idcard='" + idcard + "'"); if (d == 0) { return "否"; } else { return "是"; } } /// <summary> /// 判断是否参保养老保险 /// </summary> /// <param name="idcard">身份证号</param> /// <returns></returns> public static string IsYlbx(string idcard) { //判断库里是否有这条数据,有一条返回1有N条返回N没有返回0 int d = (int)SqlEasy.ExecuteScalar("select count(keyid) from No1_yanglaobx where idcard='" + idcard + "'"); if (d == 0) { return "否"; } else { return "是"; } } /// <summary> /// 判断是否参保养老保险 /// </summary> /// <param name="idcard">身份证号</param> /// <returns></returns> public static string Isylbx(string idcard) { //判断库里是否有这条数据,有一条返回1有N条返回N没有返回0 int d = (int)SqlEasy.ExecuteScalar("select count(keyid) from No1_yiliaobx where idcard='" + idcard + "'"); if (d == 0) { return "否"; } else { return "是"; } } protected void Button1_Click(object sender, EventArgs e) { } } } ``` ##js打印方法 ``` ```