public static ProductInfo GetSampleDataForOrder(PaymentFor options)
        {
            ProductInfo data = null;

            switch (options)
            {
            case PaymentFor.PHYSICALPRODUCT:
                data = GetProducts().Where(x => x.ProductType == ProductFor.PHYSICALPRODUCT).FirstOrDefault();
                break;

            case PaymentFor.BOOK:
                data = GetProducts().Where(x => x.ProductType == ProductFor.BOOK).FirstOrDefault();
                break;

            case PaymentFor.BOOKORPHYSICAL:
                data = GetProducts().Where(x => x.ProductType == ProductFor.BOOKORPHYSICAL).FirstOrDefault();
                break;

            case PaymentFor.VIDEO:
                data = GetProducts().Where(x => x.ProductType == ProductFor.VIDEO).FirstOrDefault();
                break;

            default:
                data = null;
                break;
            }
            return(data);
        }
        public static IProcessOrder GetPaymentMethod(PaymentFor type)
        {
            IProcessOrder _processOrder = null;

            switch (type)
            {
            case PaymentFor.PHYSICALPRODUCT:
                _processOrder = new PhysicalProductPayment();
                break;

            case PaymentFor.BOOK:
                _processOrder = new BookPayment();
                break;

            case PaymentFor.BOOKORPHYSICAL:
                _processOrder = new PhysicalorBookPayment();
                break;

            case PaymentFor.VIDEO:
                _processOrder = new VideoPayment();
                break;

            default:
                break;
            }
            return(_processOrder);
        }
예제 #3
0
 public virtual string OrderProcess(PaymentFor paymentFor)
 {
     if (this.nexChainOrder != null)
     {
         return(this.nexChainOrder.OrderProcess(paymentFor));
     }
     else
     {
         return("None");
     }
 }
예제 #4
0
        public override string  OrderProcess(PaymentFor paymentFor)
        {
            string result = string.Empty;

            if (paymentFor != PaymentFor.None)
            {
                result  = "Create a duplicate slip for royalty department \n";
                result += GenerateCommissionPayment();
            }
            else
            {
                result = base.OrderProcess(paymentFor);
            }
            return(result);
        }
        public override string OrderProcess(PaymentFor paymentFor)
        {
            string result = string.Empty;

            if (paymentFor != PaymentFor.None)
            {
                result  = "Generated purchase slip for Learning to Ski video \n";
                result += "Added a free video on First Aid as per 1997 court order";
            }
            else
            {
                result = base.OrderProcess(paymentFor);
            }
            return(result);
        }
        public override string OrderProcess(PaymentFor paymentFor)
        {
            string result = string.Empty;

            if (paymentFor != PaymentFor.None)
            {
                result  = "Membership is upgraded...\n";
                result += SendEmail();
            }
            else
            {
                result = base.OrderProcess(paymentFor);
            }
            return(result);
        }
예제 #7
0
        public override string OrderProcess(PaymentFor paymentFor)
        {
            string result = string.Empty;

            if (paymentFor != PaymentFor.None)
            {
                result  = "Generate a packing slip for shipping \n";
                result += GenerateCommissionPayment();
            }
            else
            {
                result = base.OrderProcess(paymentFor);
            }
            return(result);
        }
        public void OrderPlacing_Test(int quantity, PaymentFor paymentCategory, string Name, decimal price, bool IsActive)
        {
            var objModal = new OrderProcessingModal
            {
                IsShipped       = false,
                IsActive        = true,
                Name            = Name,
                OrderDate       = new DateTime(),
                PaymentCategory = paymentCategory,
                Quantity        = quantity,
                Price           = price,
            };

            var objValidator = ObjectModalValidator.Validate(objModal);

            Assert.AreEqual(0, objValidator.Count);
            var result = _orderService.OrderPlacing(objModal);

            Assert.IsNotNull(result);
        }