public static void Main2()
        {
            //create a GSM instance
            Battery battery = new Battery("helolModel", 1500, 1000, BatteryType.LiIon);
            Display display = new Display("100x85", 256);
            GSM tel = new GSM("s400", "Samsung", 500, "Rosen", battery, display);

            //adding calls
            tel.AddCall(DateTime.Now, "0884 667 697", 346);
            tel.AddCall(DateTime.Now.AddHours(6), "0884 789 567", 200);
            tel.AddCall(DateTime.Now.AddDays(1), "0884 667 697", 100);
            tel.AddCall(DateTime.Now.AddHours(10), "0884 789 567", 500);
            tel.AddCall(DateTime.Now.AddMonths(1).AddHours(10), "0884 667 697", 700);

            //printing
            Console.ForegroundColor = ConsoleColor.Gray;
            tel.Print();
            Console.WriteLine("Total price of the calls : {0}eu : 0.37eu for minute\n", tel.CalculateCalls(0.37));
            tel.DeletingCall("0884 667 697", 700);
            tel.Print();
            Console.WriteLine("Total price of the calls : {0}eu : 0.37eu for minute\n", tel.CalculateCalls(0.37));
            tel.ClearHistory();
            Console.WriteLine("Cleared history: ");
            tel.Print();
        }
Example #2
0
 public GSM(string model, string manufacturer, int price, string owner, Battery battery, Display display)
 {
     this.Price = price;
     this.Owner = owner;
     this.Model = model;
     this.Manufacturer = manufacturer;
     this.Battery = battery;
     this.Display = display;
 }
Example #3
0
        public GSM(string model, string manufacturer, decimal? price, string owner, Battery battery, Display display)
        {
            this.Model = model;
            this.Manufacturer = manufacturer;
            this.Price = price;
            this.Owner = owner;
            this.Battery = battery;
            this.Display = display;

            this.CallHistory = new List<Call>();
        }