Пример #1
0
 /// <summary>
 /// 根据给定的一些条件来进行票据的模糊查询
 /// </summary>
 /// <param name="fromDate"></param>
 /// <param name="toDate"></param>
 /// <param name="companyCond"></param>
 /// <param name="drugsCond"></param>
 /// <param name="drugsFromCond"></param>
 /// <param name="drugsCategoryCond"></param>
 /// <param name="storeHouseCond"></param>
 /// <param name="billMaker"></param>
 /// <returns></returns>
 public List <Bills> SearchBill(DateTime fromDate, DateTime toDate, string companyCond, string drugsCond, string drugsFromCond, string drugsCategoryCond, string storeHouseCond, User billMaker, string billsID, BillsType billsType)
 {
     using (IDbConnection conn = DAOFactory.Instance.OpenConnection())
     {
         IBillsDAO           dao = DAOFactory.Instance.CreateBillsDAO();
         SearchBillsTemplate sbt = new SearchBillsTemplate();
         sbt.FromDate    = fromDate;
         sbt.ToDate      = toDate;
         sbt.CompanyCond = companyCond;
         sbt.BillMaker   = billMaker.Name;
         List <Bills> billsList = dao.SearchBills(sbt, conn);
         for (int i = billsList.Count - 1; i >= 0; i--)
         {
             Bills bill = billsList[i];
             if (!bill.ID.ToString().Contains(billsID))
             {
                 billsList.Remove(bill);
             }
             if (!billsType.Equals(bill.BillsType))
             {
                 billsList.Remove(bill);
             }
         }
         return(billsList);
     }
 }
Пример #2
0
 /// <summary>
 /// 根据给定的条件来进行票据的模糊查询
 /// </summary>
 /// <param name="sbt"></param>
 /// <returns></returns>
 public List <Bills> SearchBill(SearchBillsTemplate sbt)
 {
     using (IDbConnection conn = DAOFactory.Instance.OpenConnection())
     {
         IBillsDAO dao = DAOFactory.Instance.CreateBillsDAO();
         return(dao.SearchBills(sbt, conn));
     }
 }