Пример #1
0
 private void PrepareShipper3Request(object sender, SendActivityEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.Blue;
     Console.WriteLine("RequestShippingQuote from Shipper3");
     Console.ResetColor();
     this.contextShipper3 = this.ReceiveQuoteFromShipper3.Context;
 }
Пример #2
0
 private void PrepareOrderConfirmation(object sender, SendActivityEventArgs e)
 {
     Console.WriteLine("Send OrderConfirmation to Customer");
     confirmedQuote = quoteShipper2;
     if (confirmedQuote.ShippingCost > quoteShipper1.ShippingCost)
         confirmedQuote = quoteShipper1;
     if (confirmedQuote.ShippingCost > quoteShipper3.ShippingCost)
         confirmedQuote = quoteShipper3;
 }
Пример #3
0
 private void PrepareQuote(object sender, SendActivityEventArgs e)
 {
     Random rand = new Random();
     quote.ShippingCost = rand.Next(45, 90);
     quote.EstimatedShippingDate = DateTime.Now.AddDays(rand.Next(2,5));
     Console.ForegroundColor = ConsoleColor.White;
     Console.WriteLine("Sending ShippingQuote ");
     Console.WriteLine("Cost: $" + quote.ShippingCost);
     Console.WriteLine("ShipDate: " + quote.EstimatedShippingDate);
     Console.ForegroundColor = ConsoleColor.Gray;
     foreach (KeyValuePair<string, string> item in supplierContext)
         Console.WriteLine(item.Key + ": " + item.Value.Substring(0,13));
     Console.ResetColor();
 }
Пример #4
0
 private void PrepareOrder(object sender, SendActivityEventArgs e)
 {
     this.order.Amount = 1000;
     this.order.OrderId = 1234;
     this.contextToSend = this.ReceiveOrderDetails.Context;
 }
 private void OnAfterResponse(object sender, SendActivityEventArgs e)
 {
     Console.WriteLine("[" + returnValue.ToString() + "]");
 }
 private void OnBeforeSend(object sender, SendActivityEventArgs e)
 {
     outputValue = random.Next(1, 100);
     Console.WriteLine(e.SendActivity.Name + "(" + outputValue.ToString() + ")");
 }