internal virtual StringBuilder GetAutoPropertyFilterString()
        {
            var res = new StringBuilder();


            if (string.IsNullOrEmpty(INVNOFilter) == false)
            {
                res.Append(" && " + string.Format("INVNO.Contains(\"{0}\")", INVNOFilter));
            }


            if (SEQ_NOFilter.HasValue)
            {
                res.Append(" && " + string.Format("SEQ_NO == {0}", SEQ_NOFilter.ToString()));
            }

            if (string.IsNullOrEmpty(ITEM_NOFilter) == false)
            {
                res.Append(" && " + string.Format("ITEM_NO.Contains(\"{0}\")", ITEM_NOFilter));
            }


            if (string.IsNullOrEmpty(ITEM_DESCRFilter) == false)
            {
                res.Append(" && " + string.Format("ITEM_DESCR.Contains(\"{0}\")", ITEM_DESCRFilter));
            }


            if (QUANTITYFilter.HasValue)
            {
                res.Append(" && " + string.Format("QUANTITY == {0}", QUANTITYFilter.ToString()));
            }

            if (COSTFilter.HasValue)
            {
                res.Append(" && " + string.Format("COST == {0}", COSTFilter.ToString()));
            }

            if (string.IsNullOrEmpty(ACCT_NOFilter) == false)
            {
                res.Append(" && " + string.Format("ACCT_NO.Contains(\"{0}\")", ACCT_NOFilter));
            }


            if (string.IsNullOrEmpty(CUSTOMER_NAMEFilter) == false)
            {
                res.Append(" && " + string.Format("CUSTOMER_NAME.Contains(\"{0}\")", CUSTOMER_NAMEFilter));
            }



            if (Convert.ToDateTime(StartDATEFilter).Date != DateTime.MinValue &&
                Convert.ToDateTime(EndDATEFilter).Date != DateTime.MinValue)
            {
                res.Append(" && (");
            }

            if (Convert.ToDateTime(StartDATEFilter).Date != DateTime.MinValue)
            {
                if (StartDATEFilter.HasValue)
                {
                    res.Append(
                        (Convert.ToDateTime(EndDATEFilter).Date != DateTime.MinValue?"":" && ") +
                        string.Format("DATE >= \"{0}\"", Convert.ToDateTime(StartDATEFilter).Date.ToString("MM/dd/yyyy")));
                }
            }

            if (Convert.ToDateTime(EndDATEFilter).Date != DateTime.MinValue)
            {
                if (EndDATEFilter.HasValue)
                {
                    res.Append(" && " + string.Format("DATE <= \"{0}\"", Convert.ToDateTime(EndDATEFilter).Date.AddHours(23).ToString("MM/dd/yyyy HH:mm:ss")));
                }
            }

            if (Convert.ToDateTime(StartDATEFilter).Date != DateTime.MinValue &&
                Convert.ToDateTime(EndDATEFilter).Date != DateTime.MinValue)
            {
                res.Append(" )");
            }

            if (Convert.ToDateTime(_dATEFilter).Date != DateTime.MinValue)
            {
                if (DATEFilter.HasValue)
                {
                    res.Append(" && " + string.Format("DATE == \"{0}\"", Convert.ToDateTime(DATEFilter).Date.ToString("MM/dd/yyyy")));
                }
            }


            if (TAX_AMTFilter.HasValue)
            {
                res.Append(" && " + string.Format("TAX_AMT == {0}", TAX_AMTFilter.ToString()));
            }

            if (UNIT_WEIGHTFilter.HasValue)
            {
                res.Append(" && " + string.Format("UNIT_WEIGHT == {0}", UNIT_WEIGHTFilter.ToString()));
            }

            if (string.IsNullOrEmpty(QTY_UNITFilter) == false)
            {
                res.Append(" && " + string.Format("QTY_UNIT.Contains(\"{0}\")", QTY_UNITFilter));
            }
            return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res:  res.Insert(0, " && "));
        }
        internal virtual StringBuilder GetAutoPropertyFilterString()
        {
            var res = new StringBuilder();


            if (string.IsNullOrEmpty(InvoiceNoFilter) == false)
            {
                res.Append(" && " + string.Format("InvoiceNo.Contains(\"{0}\")", InvoiceNoFilter));
            }



            if (Convert.ToDateTime(StartDateFilter).Date != DateTime.MinValue &&
                Convert.ToDateTime(EndDateFilter).Date != DateTime.MinValue)
            {
                res.Append(" && (");
            }

            if (Convert.ToDateTime(StartDateFilter).Date != DateTime.MinValue)
            {
                if (StartDateFilter.HasValue)
                {
                    res.Append(
                        (Convert.ToDateTime(EndDateFilter).Date != DateTime.MinValue?"":" && ") +
                        string.Format("Date >= \"{0}\"", Convert.ToDateTime(StartDateFilter).Date.ToString("MM/dd/yyyy")));
                }
            }

            if (Convert.ToDateTime(EndDateFilter).Date != DateTime.MinValue)
            {
                if (EndDateFilter.HasValue)
                {
                    res.Append(" && " + string.Format("Date <= \"{0}\"", Convert.ToDateTime(EndDateFilter).Date.AddHours(23).ToString("MM/dd/yyyy HH:mm:ss")));
                }
            }

            if (Convert.ToDateTime(StartDateFilter).Date != DateTime.MinValue &&
                Convert.ToDateTime(EndDateFilter).Date != DateTime.MinValue)
            {
                res.Append(" )");
            }

            if (Convert.ToDateTime(_dateFilter).Date != DateTime.MinValue)
            {
                if (DateFilter.HasValue)
                {
                    res.Append(" && " + string.Format("Date == \"{0}\"", Convert.ToDateTime(DateFilter).Date.ToString("MM/dd/yyyy")));
                }
            }


            if (TAX_AMTFilter.HasValue)
            {
                res.Append(" && " + string.Format("TAX_AMT == {0}", TAX_AMTFilter.ToString()));
            }

            if (string.IsNullOrEmpty(CustomerNameFilter) == false)
            {
                res.Append(" && " + string.Format("CustomerName.Contains(\"{0}\")", CustomerNameFilter));
            }


            if (LineNumberFilter.HasValue)
            {
                res.Append(" && " + string.Format("LineNumber == {0}", LineNumberFilter.ToString()));
            }

            if (DownloadedFilter.HasValue)
            {
                res.Append(" && " + string.Format("Downloaded == {0}", DownloadedFilter));
            }
            return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res:  res.Insert(0, " && "));
        }