예제 #1
0
        private IBusinessRuleExecuter GetRuleEngineObject(int choice)
        {
            IBusinessRuleExecuter ob;

            switch (choice)
            {
            case 1:
                ob = new PhysicalProduct("Generate a Packing slip for shipping.");
                break;

            case 2:
                ob = new Book("create a duplicae packing slip for the royanty department.");
                break;

            case 3:
                ob = new Membership("Activate that membership.");
                break;

            case 4:
                ob = new UpgradeMemership("Apply upgrade.");
                break;

            case 5:
                ob = new Membership_Upgrade("E-mail the owner and inform them of the activation/upgrade.");
                break;

            case 6:
                ob = new VideoLearningSki("Adda free First Aid video.");
                break;

            case 7:
                ob = new PhysicalProductBook("Generate a commission payment to agent");
                break;

            default:
                throw new NotImplementedException();
            }
            return(ob);
        }
예제 #2
0
 public string BusinessRuleEngine(int Type)
 {
     if (Type == 0)
     {
         PhysicalProduct obj = new PhysicalProduct();
         obj.generatePackingSlip();
         return(obj.GenerateCommision());
     }
     else if (Type == 1)
     {
         Book obj = new Book();
         obj.createDuplicateSlip();
         return(obj.GenerateCommision());
     }
     else if (Type == 2)
     {
         Membership obj = new Membership();
         obj.ActivateMembership();
         return(obj.sendEmail());
     }
     else if (Type == 3)
     {
         Upgrade obj = new Upgrade();
         obj.upGradMembership();
         return(obj.sendEmail());
     }
     else if (Type == 4)
     {
         Video obj = new Video();
         return(obj.addVedio());
     }
     else
     {
         return("False");
     }
 }