Esempio n. 1
0
        // observer pattern
        // update status by observer
        public void ReceiveAndNotify(object obj)
        {
            StockBLL sbp = obj as StockBLL;

            if (sbp != null)
            {
                disableOrderStatus(sbp.StockID);
            }
        }
Esempio n. 2
0
        // invoke event
        private void fireObserverEvent(int stockID)
        {
            StockBLL stockBll = new StockBLL(stockID);

            InventoryForm invform  = new InventoryForm();
            OrderBLL      orderBLL = new OrderBLL();

            stockBll.AddObserver(new NotifyEventDelegate(invform.ReceiveAndNotify));
            stockBll.AddObserver(new NotifyEventDelegate(orderBLL.ReceiveAndNotify));
            stockBll.Update();
        }