コード例 #1
0
        public RuleBaseService()
            : base()
        {
            if (_banks.Count == 0)
            {
                Bank bank0, bank1, bank2, bank3;

                bank0 = new Bank()
                {
                    Id = 0,
                    Name = "RabbitMQ JSON Bank",
                    RoutingKey = LoanBroker.Utility.BankingUtility.ROUTING_KEY_RabbitMQJSONBank
                };

                bank1 = new Bank()
                {
                    Id = 1,
                    Name = "RabbitMQ OUR Bank",
                    //MinAmount = 123,
                    RoutingKey = LoanBroker.Utility.BankingUtility.ROUTING_KEY_RabbitMQOURBank
                };

                bank2 = new Bank()
                {
                    Id = 2,
                    Name = "RabbitMQ XML Bank",
                    //MinCreditScore = 678,
                    RoutingKey = LoanBroker.Utility.BankingUtility.ROUTING_KEY_RabbitMQXMLBank
                };

                bank3 = new Bank()
                {
                    Id = 3,
                    Name = "Web Service Bank",
                    //MinAmount = 100,
                    //MinDuration = 12,
                    //MinCreditScore = 234,
                    RoutingKey = LoanBroker.Utility.BankingUtility.ROUTING_KEY_WebServiceBank
                };

                AddABank(JsonConvert.SerializeObject(bank0));
                AddABank(JsonConvert.SerializeObject(bank1));
                AddABank(JsonConvert.SerializeObject(bank2));
                AddABank(JsonConvert.SerializeObject(bank3));
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: tdkryger/SystemIntegration
        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 4; i++)
            {
                Bank bank;
                bank = new Bank();

                bank.Id = i;
                bank.Name = string.Format("Bank number {0}", i);

                rbsc.AddABank(JsonConvert.SerializeObject(bank));

                //rbsc.AddABank(
                //new RuleBaseInterface.Bank()
                //{
                //    Id = i,
                //    Name = string.Format("Bank number {0}", i),
                //    MinCreditScore = (i + 1) * 32,
                //    MinAmount = (i + 1) * 230,
                //    MinDuration = (i + 1) * 2
                //}
                //);
            }
        }