예제 #1
0
        public FuelDeliveryObjectCollection GetFilter(DateTime dateFromDelivery, DateTime dateToDelivery)
        {
            FuelDeliveryObjectCollection fuelDeliveries;
            QueryBuilder builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendWhereString("1", "1", QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
                if (dateFromDelivery != DateTime.MinValue)
                {
                    builder.AppendWhereString(FuelDeliveryObject.DATE_INVOICE, PROF_IT.Common.Convert.DateFunctions.DateToStrDate(dateFromDelivery), QueryBuilder.ComparisonOperators.GreaterAndEqual, QueryBuilder.ParameterLocation.MIDDLE);
                }
                if (dateToDelivery != DateTime.MaxValue)
                {
                    builder.AppendWhereString(FuelDeliveryObject.DATE_INVOICE, PROF_IT.Common.Convert.DateFunctions.DateToStrDate(dateToDelivery), QueryBuilder.ComparisonOperators.SmallerAndEqual, QueryBuilder.ParameterLocation.MIDDLE);
                }

                builder.AppendOrderBy(FuelDeliveryObject.DATE_INVOICE, QueryBuilder.OrderByType.DESC, QueryBuilder.ParameterLocation.FIRST_LAST);
                return(fuelDeliveries = FuelDeliveryConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]));
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(fuelDeliveries);
        }
예제 #2
0
        public FuelDeliveryObjectCollection GetAll()
        {
            FuelDeliveryObjectCollection fuelDeliverys = new FuelDeliveryObjectCollection();
            QueryBuilder builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendOrderBy(FuelDeliveryObject.DATE_DELIVERY, QueryBuilder.OrderByType.ASC, QueryBuilder.ParameterLocation.FIRST_LAST);
                fuelDeliverys = FuelDeliveryConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(fuelDeliverys);
        }