Beispiel #1
0
        protected override IEnumerable GetRows()
        {
            var where = "BillDate BETWEEN '" + dtpBillDate1.Value.Date.ToString() + "' AND dateadd(day, 1, '" + dtpBillDate2.Value.Date.ToString() + "')";
            var s = txtSupplierName.Text.Trim();

            if (s != "")
            {
                where += " AND SupplierName LIKE '%" + s + "%'";
            }

            var orderby = "BillDate ASC";

            var bl   = new PurchaseBillBL();
            var list = bl.GetList(where, orderby);

            return(list);
        }
        protected override IEnumerable GetList()
        {
            var filters = "BillDate >= '" + dtpBillDate1.Value.Date.ToString() + "' AND BillDate < dateadd(day, 1, '" + dtpBillDate2.Value.Date.ToString() + "')";

            var s = txtSupplierName.Text.Trim();

            if (s != string.Empty)
            {
                if (filters != string.Empty)
                {
                    filters += "  AND ";
                }

                filters += "SupplierName LIKE '%" + s + "%'";
            }

            var sorts = "BillDate DESC, BillCode, SupplierName";

            var bl   = new PurchaseBillBL();
            var list = bl.GetList(filters, sorts);

            return(list);
        }