Пример #1
0
        /// <summary>
        /// 查询发票
        /// </summary>
        /// <param name="option"></param>
        /// <returns></returns>
        public DataSet ReadInvoice(InvoiceOption option)
        {
            string sql = " select * from view_Invoice where 1=1 ";

            if (option.BranchId > 0)
            {
                sql += string.Format(" and BranchId={0} ", option.BranchId);
            }
            if (option.InvoiceContent != "")
            {
                sql += string.Format(" and InvoiceContent = '{0}' ", option.InvoiceContent);
            }
            if (option.InvoiceDateS != new DateTime(1900, 1, 1))
            {
                sql += string.Format(" and InvoiceDate >= '{0}' ", option.InvoiceDateS.ToShortDateString());
            }
            if (option.InvoiceDateE != new DateTime(1900, 1, 1))
            {
                sql += string.Format(" and InvoiceDate < '{0}' ", option.InvoiceDateE.AddDays(1).ToShortDateString());
            }
            if (option.InvoiceMemo != "")
            {
                sql += string.Format(" and InvoiceMemo like '%{0}%' ", option.InvoiceMemo);
            }
            if (option.InvoiceMoneyS > 0)
            {
                sql += string.Format(" and InvoiceMoney >={0} ", option.InvoiceMoneyS);
            }
            if (option.InvoiceMoneyE > 0)
            {
                sql += string.Format(" and InvoiceMoney <={0} ", option.InvoiceMoneyE);
            }
            if (option.InvoiceName != "")
            {
                sql += string.Format(" and InvoiceName like '%{0}%' ", option.InvoiceName);
            }
            if (option.InvoiceNo != "")
            {
                sql += string.Format(" and InvoiceNo like '%{0}%' ", option.InvoiceNo);
            }
            if (option.InvoiceRequireId > 0)
            {
                sql += string.Format(" and InvoiceRequierId = {0} ", option.InvoiceRequireId);
            }
            if (option.InvoiceType != "")
            {
                sql += string.Format(" and InvoiceType = '{0}' ", option.InvoiceType);
            }
            if (option.OrderStatementId > 0)
            {
                sql += string.Format(" and OrderStatementId = {0} ", option.OrderStatementId);
            }
            if (option.Company != "")
            {
                sql += string.Format(" and Company like '%{0}%' ", option.Company);
            }
            sql += " order by UpdateTime desc ";
            return(m_dbo.GetDataSet(sql));
        }
Пример #2
0
 public InvoiceManager()
 {
     m_Option = new InvoiceOption();
     m_dbo    = new DBOperate();
 }