Exemplo n.º 1
0
        internal virtual StringBuilder GetAutoPropertyFilterString()
        {
            var res = new StringBuilder();


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


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

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

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


            return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res:  res.Insert(0, " && "));
        }
Exemplo n.º 2
0
        internal virtual StringBuilder GetAutoPropertyFilterString()
        {
            var res = new StringBuilder();


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


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


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



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

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

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

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

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


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


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

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

            if (TotalLinesFilter.HasValue)
            {
                res.Append(" && " + string.Format("TotalLines == {0}", TotalLinesFilter.ToString()));
            }
            return(res.ToString().StartsWith(" &&") || res.Length == 0 ? res:  res.Insert(0, " && "));
        }
Exemplo n.º 3
0
        internal virtual StringBuilder GetAutoPropertyFilterString()
        {
            var res = new StringBuilder();


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



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

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

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

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

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


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


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

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


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

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