/// <summary> /// 查询票据识别表 /// </summary> /// <param PJSBLOG="PJSBLOG">票据识别实体类</param> /// <returns>PJSBLOG 集合</returns> public IList <PJSBLOG> PJSBLOGInfo(PJSBLOG PJSBLOGInfo) { IList <PJSBLOG> result = null; string hql = "from PJSBLOG where 1=1 "; if (PJSBLOGInfo.ZHDM != 0) { hql += " and ZHDM = :ZHDM"; } if (!string.IsNullOrEmpty(PJSBLOGInfo.ACCNO)) { hql += " and ACCNO like :ACCNO"; } using (_session = _sessionfactory.Session) { IQuery query = _session.CreateQuery(hql); if (PJSBLOGInfo.ZHDM != 0) { query.SetInt32("ZHDM", PJSBLOGInfo.ZHDM); } if (!string.IsNullOrEmpty(PJSBLOGInfo.ACCNO)) { query.SetString("ACCNO", "%" + PJSBLOGInfo.ACCNO + "%"); } result = query.List <PJSBLOG>(); } return(result); }
public PJSBLOG[] PJSBLOGInfo(PJSBLOG pjsbLog) { IList <PJSBLOG> list = null; PJSBLOGDal PJSBLOGDal = new PJSBLOGDal(); list = PJSBLOGDal.PJSBLOGInfo(pjsbLog); return(list.ToArray()); }
private void btn_Get_Click(object sender, EventArgs e) { PJSBLOG pjsblog = new PJSBLOG() { ACCNO = this.txt_ACCNO.Text, ZHDM = Convert.ToInt32((this.txt_ZHDM.Text == ""?"0":this.txt_ZHDM.Text)) }; IPJSBLOGBll bll = WcfClient.GetProxy <IPJSBLOGBll>(); IList <PJSBLOG> list = bll.PJSBLOGInfo(pjsblog); this.dataGridView1.AutoGenerateColumns = false; this.dataGridView1.DataSource = list; }