i got an assignment asking me to fill in the blanks for c# coding. basically the assignment is all about message queueing. here i paste the code that need to be filled up through the code as follows:

// TODO : Step N.

there are 5 blanks to fill up...please help me...


// this is BOClientOrders.cs file

using System;
using System.Messaging;

using ITEE.OrderMQ.Messages;

namespace ITEE.OrderMQ.Client.BusinessObjects
{
 ///

Client Business object to process orders
 public class BOClient_Orders
 {
  /// Message queue path name
  string   _mqPath;

  public BOClient_Orders()
  {
   _mqPath = Config.QueuePath;
  }

  ///

Send a MSMQ message to the Order server.
  ///
  protected void SendMessage(Message msg)
  {
   // TODO: Step 1.  Send msg message to message queue path _mqPath.

   System.Messaging.MessageQueue mq =
    new System.Messaging.MessageQueue (@_mqPath);
   
   // Sends a message to queue path _mqPath.
   mq.Send(msg);
  }

  ///


  /// Place a new Order
  ///

  ///
  ///
  ///
  ///
  ///
  ///
  ///
  public void PlaceAnOrder
   (
   int  orderNo,
   string customerName,
   string  stockDescription,
   decimal totalPrice
   )
  {
   Message msg = new Message();
   msg.AppSpecific = (int)MessageTypes.PlaceAnOrder;
   // Message Label that appears in MQ admin tools
   msg.Label = "PlaceOrder: " + orderNo;
   msg.Body = new Order(orderNo, customerName, stockDescription, totalPrice);

   SendMessage(msg);
  }

  ///


  /// Update an existing order
  ///

  ///
  ///
  ///
  ///
  ///
  ///
  ///
  public void UpdateAnOrder
  (
   int  orderNo,
   string customerName,
   string  stockDescription,
   decimal totalPrice
  )
  {
   Message msg = new Message();
   msg.AppSpecific = (int)MessageTypes.UpdateAnOrder;
   // Message Label that appears in MQ admin tools
   msg.Label = "UpdateOrder: " + orderNo;
   msg.Body = new Order(orderNo, customerName, stockDescription, totalPrice);

   SendMessage(msg);
  }

  ///

Cancel an existing order.
  ///
  public void CancelAnOrder(int orderNo)
  {
   Message msg = new Message();
   msg.AppSpecific = (int)MessageTypes.CancelAnOrder;
   msg.Label = "CancelOrder: " + orderNo;
   msg.Body = orderNo;

   SendMessage(msg);
  }
 }
}


// this is OrderMQServer.cs file

using System;
using System.Messaging;

using ITEE.OrderMQ.Messages;

namespace ITEE.OrderMQ.Server
{
 ///

Message Queue Server for Customer Orders.
 public class OrderMQServer : IDisposable
 {
  /// Message queue path name
  string   _mqPath;

  ///

Message queue used to register for callbacks.
  MessageQueue _mq;

  ///

The main entry point for the application.
  [STAThread]
  static void Main(string[] args)
  {
   OrderMQServer service = new OrderMQServer(Config.QueuePath);

   // Service opens message queue connection and starts listening for messages.
   service.Start();

   Console.WriteLine("** Press ENTER to stop the MQ Order Service **");
   Console.ReadLine();

   // Service stops listening for messages and closes message queue connection.
   service.Stop();
  }

  ///

Create a Message Queue Server for Customer Orders
  /// Message Queue Path
  public OrderMQServer(string mqPath)
  {
   if (mqPath == null)
   {
    throw new ArgumentNullException("mqPath");
   }

   _mqPath = mqPath;
  }

  ///

Sart the service.
  /// Opens the message queue and register callback listener.
  public void Start()
  {
   // TODO: Step 2.  Create message queue if it does not exist
   //                The path to the message queue is in: _mqPath

   if (!MessageQueue.Exists(@_mqPath))
   {
    MessageQueue.Create(@_mqPath);   // Path created.Path to message queue is mqPath.
   }

   // TODO: Step 3a.  Open and configure the message queue and assign it to: _mq

   _mq = new System.Messaging.MessageQueue(@_mqPath);  // Assigning the message queue to the mqPath

   // TODO: Step 3b.  Register a callback method to be invoked
   //                 when new messages arrives.

   _mq.PeekCompleted += new PeekCompletedEventHandler(OnPeekCompleted); // Register receive Event Callback for when message arrives
   _mq.BeginReceive();          // Begin async Receive()
  }

  ///

IDispose interface.
  public void Dispose()
  {
   Stop();
  }

  ///

Stop Server
  public void Stop()
  {
   if (_mq != null)
   {
    // No need to deregister the callback event in this case.
    // Just Close or Dispose the message queue to stop listening for messages.
    _mq.Dispose();
    _mq = null;
   }
  }

  ///

Called when a new message arrives on the queue.
  ///
  ///
  private void OnPeekCompleted (Object source, PeekCompletedEventArgs asyncReceive)
  {
   // TODO: Step 4a.  Receive messages from the message queue

   Message msg = _mq.EndPeek(asyncReceive.AsyncResult);

   // TODO: Step 4b.  Call ProcessReceivedMessage() to process each message.

   try
   {
    ProcessReceivedMessage(msg);  // Process each received message
   }
   catch(Exception)
   {
    Console.WriteLine();
   }

    // TODO: Step 4c.  Prepare to receieve the next message.

   finally
   {
    _mq.BeginPeek();
   }

  }

  ///

Process a received message.
  ///
  private void ProcessReceivedMessage(Message msg)
  {
   // Get the message type from the "AppSpecific" message property.
   MessageTypes msgType = (MessageTypes) msg.AppSpecific;
   

   // TODO: Step 5.  Based on the message type in msgType call one of  ...
   //
   //   a. BusinessObjects.BOServer_Orders.PlaceAnOrder()
   
   if (msgType.Equals(MessageTypes.PlaceAnOrder))
   {
    msg.Formatter = new XmlMessageFormatter(new Type[] {typeof(Order)});
    Order order = (Order)msg.Body;
    BusinessObjects.BOServer_Orders.PlaceAnOrder(order.OrderNo, order);
   }; 

 


   // OR
   //   b. BusinessObjects.BOServer_Orders.UpdateAnOrder()

   if (msgType.Equals(MessageTypes.UpdateAnOrder))
   {
    msg.Formatter = new XmlMessageFormatter(new Type[] {typeof(Order)});
    Order order = (Order)msg.Body;
    BusinessObjects.BOServer_Orders.UpdateAnOrder(order.OrderNo, order);
   };

 

   // OR
   //   c. BusinessObjects.BOServer_Orders.CancelAnOrder()

   if (msgType.Equals(MessageTypes.CancelAnOrder))
   {
    msg.Formatter = new XmlMessageFormatter(new Type[] {typeof(int)});
    BusinessObjects.BOServer_Orders.CancelAnOrder((int)msg.Body);
   };

 

  }
 }
}