Ejemplo n.º 1
0
        /// <summary>
        /// Checks for at least one filter in the GetItem request.
        /// See GetItem Post https://developers.neto.com.au/documentation/engineers/api-documentation/products/getitem
        /// </summary>
        /// <returns>bool</returns>
        internal override bool isValid()
        {
            if (!string.IsNullOrWhiteSpace(ParentSKU))
            {
                return(true);
            }

            if (DateAddedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateAddedTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DateUpdatedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateUpdatedTo != DateTime.MinValue)
            {
                return(true);
            }

            int requiredFilterCount = SKU.NullSafeLength() +
                                      AccountingCode.NullSafeLength() +
                                      InventoryID.NullSafeLength() +
                                      Brand.NullSafeLength() +
                                      Model.NullSafeLength() +
                                      Name.NullSafeLength() +
                                      PrimarySupplier.NullSafeLength() +
                                      Approved.NullSafeLength() +
                                      ApprovedForPOS.NullSafeLength() +
                                      ApprovedForMobileStore.NullSafeLength() +
                                      SalesChannels.NullSafeLength() +
                                      Visible.NullSafeLength() +
                                      IsActive.NullSafeLength() +
                                      CategoryID.NullSafeLength();


            if (requiredFilterCount != 0)
            {
                return(true);
            }

            throw new NetoRequestException("At least one filter is required in the GetItem request");
        }
Ejemplo n.º 2
0
        internal override bool isValid()
        {
            if (DatePaidFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DatePaidTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DateRequiredFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateRequiredTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DateInvoicedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateInvoicedTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DatePlacedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DatePlacedTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DateUpdatedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateUpdatedTo != DateTime.MinValue)
            {
                return(true);
            }

            if (DateCompletedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (DateCompletedTo != DateTime.MinValue)
            {
                return(true);
            }

            if (WarehouseQuantityUpdatedFrom != DateTime.MinValue)
            {
                return(true);
            }

            if (WarehouseQuantityUpdatedTo != DateTime.MinValue)
            {
                return(true);
            }

            int requiredFilterCount = OrderID.NullSafeLength() +
                                      Username.NullSafeLength() +
                                      SKU.NullSafeLength() +
                                      Supplier.NullSafeLength() +
                                      WarehouseID.NullSafeLength() +
                                      ShippingMethod.NullSafeLength() +
                                      SalesChannel.NullSafeLength();


            if (requiredFilterCount != 0)
            {
                return(true);
            }

            throw new NetoRequestException("At least one filter is required in the GetOrder request");
        }