public DataSet QueryByID(string id) { string sql = string.Format("SELECT {1} FROM {2} where ID='{0}' ", id.ToString(), strQueryFields, strTableView); using (PersistentManager persistentManager = new PersistentManager()) { DeliveryBillDetailDao dao = new DeliveryBillDetailDao(); return(dao.GetData(sql)); } }
/// <summary> /// 根据主表单号查询明细 /// </summary> /// <param name="BillNo">单据编号,可以多个用逗号隔开</param> /// <returns></returns> public DataSet QueryByBillNo(string BillNo) { string[] aryBillNo = BillNo.Split(','); string BillNoList = "''"; for (int i = 0; i < aryBillNo.Length; i++) { BillNoList += ",'" + aryBillNo[i] + "'"; } string sql = string.Format("select {0} from {1} where BILLNO in ({2}) ORDER BY BILLNO DESC", strQueryFields, strTableView, BillNoList); using (PersistentManager persistentManager = new PersistentManager()) { DeliveryBillDetailDao dao = new DeliveryBillDetailDao(); return(dao.GetData(sql)); } }