Ejemplo n.º 1
0
 public Station(BillingSystem obj)
 {
     if (this.UpdateBillingSystem == null)
        {
        this.UpdateBillingSystem += obj.UpdateBillingSystemHandler;
        }
        this.mapping = new List<KeyValuePair<ITerminal, IPort>>();
        this.connectionCollection = new List<CallInfo>();
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            BillingSystem bilSys = new BillingSystem();

            Station station = new Station(bilSys);
            station.SetNewTerminalAndPort(new PhoneNumber("11-11-11"), "Петя",TariffPlans.ConstMedium);
            station.SetNewTerminalAndPort(new PhoneNumber("22-22-22"), "Витя",TariffPlans.FirstPartExpensiveAfterFree);
            station.SetNewTerminalAndPort(new PhoneNumber("33-33-33"), "Жека",TariffPlans.FirstPartExpensiveAfterFree);

            station[0].Plug();
            station[1].Plug();
            station[2].Plug();

            station[1].Call(new PhoneNumber("11-11-11"));
               // station[2].Call(new PhoneNumber("11-11-11"));

            Thread.Sleep(7000);
            station[0].Drop();

            station[1].PayBill(bilSys);
            station[1].ChangeTariff(TariffPlans.ConstMedium);
            Console.WriteLine();
            Console.ReadKey();

            station[1].Call(new PhoneNumber("33-33-33"));
            Thread.Sleep(1500);
            station[2].Drop();
            Console.ReadKey();

               // station[1].Call(new PhoneNumber("22-22-22"));

            Console.WriteLine();
            Console.WriteLine();

            station[1].GetCallHistoryBy(HistoryFilter.AbonentName,bilSys);

            Console.ReadKey();
        }
Ejemplo n.º 3
0
 public bool PayBill(BillingSystem BS)
 {
     this.AllowChangeTariff = true;
        return BS.PayBill(this);
 }
Ejemplo n.º 4
0
 public void GetCallHistoryBy(HistoryFilter filter,BillingSystem BS)
 {
     BS.RequestHistoryBy(this,filter);
 }