예제 #1
0
        public bool ValidateQuantity()
        {
            var handler = OnValidateQuantity;

            if (handler != null)
            {
                OperationDetailArgs args = new OperationDetailArgs();
                handler(this, args);
                if (args.Result != null)
                {
                    return(args.Result.Value);
                }
            }

            return(ValidateQuantityValue());
        }
예제 #2
0
        public bool CanAutoProduceItem()
        {
            var handler = OnAutoProduceRequest;

            if (handler != null)
            {
                OperationDetailArgs args = new OperationDetailArgs();
                handler(this, args);
                if (args.Cancelled)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #3
0
        public bool CanChangePriceFromQuickSale()
        {
            var handler = OnQuickSaleChangePriceRequest;

            if (handler != null)
            {
                OperationDetailArgs args = new OperationDetailArgs();
                handler(this, args);
                if (args.Cancelled)
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #4
0
        public bool CheckPurchaseSalePrices(double purchasePrice, double salePrice)
        {
            var handler = OnCheckPricesRequest;

            if (handler != null)
            {
                OperationDetailArgs args = new OperationDetailArgs();
                handler(this, args);
                if (args.Result != null)
                {
                    return(args.Result.Value);
                }
            }

            if (!BusinessDomain.AppConfiguration.WarnPricesSaleLowerThanPurchase || purchasePrice <= salePrice)
            {
                return(true);
            }

            return(false);
        }