Пример #1
0
        public CustomerObjectCollection GetFilter(string name, string vat)
        {
            CustomerObjectCollection customers = new CustomerObjectCollection();
            QueryBuilder             builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                if (name != "")
                {
                    builder.AppendWhereString(CustomerObject.NAME, name, QueryBuilder.ComparisonOperators.Like, QueryBuilder.ParameterLocation.FIRST);
                }
                if (vat != "")
                {
                    builder.AppendWhereString(CustomerObject.VAT, vat, QueryBuilder.ComparisonOperators.Like, QueryBuilder.ParameterLocation.LAST);
                }
                builder.AppendOrderBy(CustomerObject.NAME, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
                customers = CustomerConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(customers);
        }
Пример #2
0
        public CustomerObjectCollection GetAll()
        {
            CustomerObjectCollection parameters = new CustomerObjectCollection();
            QueryBuilder             builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                parameters = CustomerConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(parameters);
        }