示例#1
0
        static void Main(string[] args)
        {
            StockManager stockManager = new StockManager();
            BuyStock     buyStock     = new BuyStock(stockManager);
            SellStock    sellStock    = new SellStock(stockManager);

            StockController stockController = new StockController();

            stockController.TakeOrder(buyStock);
            stockController.TakeOrder(sellStock);

            stockController.PlaceOrders();
        }
示例#2
0
        static void Main(string[] args)
        {
            StockManager stockManager = new StockManager();
            BuyStock     buyStock     = new BuyStock(stockManager);
            SellStock    sellStock    = new SellStock(stockManager);

            StockOrdersController stockOrdersController = new StockOrdersController();

            stockOrdersController.AddOrder(buyStock);
            stockOrdersController.AddOrder(sellStock);
            stockOrdersController.AddOrder(buyStock);
            stockOrdersController.ExecuteOrders();

            Console.ReadLine();
        }
示例#3
0
        static void Main(string[] args)
        {
            // yapılan işlemleri hafızaya alma ve toplu şekilde db ye aktarma
            StockManager    stockManager    = new StockManager();
            BuyStock        buyStock        = new BuyStock(stockManager);
            SellStock       sellStock       = new SellStock(stockManager);
            StockController stockController = new StockController();

            stockController.TakeOrder(buyStock);
            stockController.TakeOrder(buyStock);
            stockController.TakeOrder(buyStock);
            stockController.TakeOrder(sellStock);
            stockController.TakeOrder(sellStock);
            stockController.PlaceOrders();
            Console.ReadLine();
        }
示例#4
0
        //ctrl + Z komutların geri alınmasını gösterir

        //bu desen için sipariş takip sisteminden örnek oluşturacağız
        static void Main(string[] args)
        {
            //ana kısımda

            StockManager stockManager = new StockManager();         //stok işlemlerini tanımladık
            BuyStock     buy          = new BuyStock(stockManager); //burada parametre gerekiyor
            SellStock    sell         = new SellStock(stockManager);

            StockController stockController = new StockController(); //kontrolerı çağırdık

            stockController.TakeOrder(buy);                          //siparişleri verdik
            stockController.TakeOrder(sell);
            stockController.TakeOrder(buy);

            stockController.PlaceOrders();

            Console.ReadLine();
        }
示例#5
0
        static void Main(string[] args)
        {
            //komut deseni
            //bazı komutlarla veri tabanının işlenmesi örnek verilebilir.

            StockManager stockManager = new StockManager();
            BuyStock     buyStock     = new BuyStock(stockManager);
            SellStock    sellStock    = new SellStock(stockManager);

            StockController stockController = new StockController();

            stockController.TakeOrder(buyStock);
            stockController.TakeOrder(sellStock);
            stockController.TakeOrder(buyStock);

            stockController.PlaceOrders();

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            StockManager stockManager = new StockManager("iPhone", 200);

            BuyStock  buyStock  = new BuyStock(stockManager);
            SellStock sellStock = new SellStock(stockManager);

            StockController stockController = new StockController();

            stockController.TakeOrder(buyStock);
            stockController.TakeOrder(sellStock);
            stockController.TakeOrder(sellStock);


            stockController.PlaceOrders();
            // output:
            //  Stock: iPhone, 200 bought!
            //  Stock: iPhone, 200 sold!
            //  Stock: iPhone, 200 sold!
        }
 public SellStock(StockManager stockManager)
 {
     _stockManager = stockManager;
 }
 public BuyStock(StockManager stockManager)
 {
     _stockManager = stockManager;
 }
示例#9
0
 public SellStock(StockManager stockManager)
 {
     this._stockManager = stockManager;
 }
示例#10
0
 public BuyStock(StockManager stockManager)
 {
     this._stockManager = stockManager;
 }
示例#11
0
 public SellStock(StockManager _stockManager)
 {
     stockManager = _stockManager;
 }
示例#12
0
 public BuyStock(StockManager _stockManager)
 {
     stockManager = _stockManager;
 }