| | |
| | | { |
| | | if (ICMOBill != "") |
| | | { |
| | | sWhere = "where 1=1 and 生产订单号 like '%" + ICMOBill + "%' and HSTOCKINORGID=" + OrganizationID; |
| | | sWhere = " where 1=1 and 单据号 like '%" + ICMOBill + "%' "; |
| | | } |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_S_Sc_ICMOBillList where HSTOCKINORGID=" + OrganizationID, "h_v_S_Sc_ICMOBillList"); |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1=1 and isnull(审核人,'')<>'' and isnull(关闭人,'')='' and isnull(行关闭人,'')='' order by 单据号 desc,hsubid ", "h_v_IF_ICMOBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_S_Sc_ICMOBillList "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_S_Sc_ICMOBillList"); |
| | | string sql = "select * from h_v_IF_ICMOBillList "+ sWhere+ " and isnull(审核人,'')<>'' and isnull(关闭人,'')='' and isnull(行关闭人,'')='' order by 单据号 desc,hsubid "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOBillList"); |
| | | } |
| | | if (ds == null || ds.Tables[0].Rows.Count <= 0) |
| | | { |