Exemple #1
0
    DeliveryRoom()
    {
        Text = "Delivery Room";
        try
        {
            RemotingConfiguration.Configure("DeliveryRoom.exe.config", false);
            inter = new EventIntermediate();
            inter.ReadyOrder += OnReadyOrder;
            inter.DeliveringOrder += OnDeliveringOrder;
            inter.FinalizingOrder += OnFinalizingOrder;
            ordersList = (IOrders)Activator.GetObject(typeof(IOrders), "tcp://localhost:9000/Server/OrdersServer");
            ordersList.ReadyOrder += inter.FireReadyOrder;
            ordersList.DeliveringOrder += inter.FireDeliveringOrder;
            ordersList.FinalizingOrder += inter.FireFinalizingOrder;
            TeamID = (ordersList.GetDeliveryTeams().Count + 1).ToString();
            ordersList.AddDeliveryTeam(TeamID);
            InitializeComponent();
            checkIfExistsSavedOrders();

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
            Close();
        }
    }