Example #1
0
 public GSM(string model, string manufacturer, Battery battery)
     : this(model, manufacturer, 0.0, null, battery, null)
 {
     this.model = model;
     this.manufacturer = manufacturer;
     this.battery = battery;
 }
Example #2
0
 public GSM(string model, string manifacturer, string owner, int? price, Battery battery, Display display)
 {
     this.model = model;
     this.manifacturer = manifacturer;
     this.owner = owner;
     this.price = price;
     this.battery = battery;
     this.display = display;
 }
Example #3
0
 public GSM(string model, string manufacturer, int 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;
 }
Example #4
0
 public GSM(string model, string manufacturer, decimal price, string owner, Display display, Battery battery)
 {
     this.model = model;
     this.manufacturer = manufacturer;
     this.price = price;
     this.owner = owner;
     this.display = display;
     this.battery = battery;
     CallHistory = new List<Call>();
 }
Example #5
0
        static void Main()
        {
            GSM phone1 = new GSM();
            phone1.Price = 10;
            phone1.Owner = "az";

            GSM phone2 = new GSM();
            phone2.Price = 12;
            phone2.Manifacturer = "made in china";
            phone2.Model = "samsung 2";

            GSM phone3 = new GSM();
            phone3.Model = "nokia q";
            phone3.Owner = "pesho";
            phone3.Manifacturer = " made in china";

            GSM[] phones = new GSM[] { phone1, phone2, phone3 };
            foreach (GSM phone in phones)
            {
                phone.DisplayGsm();
                Console.WriteLine();
            }

            GSM.Iphone.DisplayGsm();

            Battery battery = new Battery(BatteryType.NiCd);
            Console.WriteLine(battery.Type);

            Call firstCall = new Call(DateTime.Now, 0987654321, 324);
            Call secondCall = new Call();
            secondCall.Number = 0999999;
            secondCall.Seconds = 433;
            GSM calls = new GSM("samsung", "china");

            //--------------
            //test call history
            //---------------
            calls.AddCall(DateTime.Now, 0987654321, 234);
            calls.AddCall(DateTime.Now, 1234567890, 342);
            calls.DeleteCall(DateTime.Now, 1234567890, 342);
            foreach (var call in calls.Callhistory)
            {
                Console.WriteLine("{0} {1} {2}", call.DateTime, call.Number, call.Seconds);
            }

            Console.WriteLine( calls.CallPrice(0.34) );
            calls.RemoveAllCalls();
            foreach (var call in calls.Callhistory)
            {
                Console.WriteLine("{0} {1} {2}", call.DateTime, call.Number, call.Seconds);
            }
        }
Example #6
0
 public GSM(string model, string manifacturer, int? price, Battery battery)
     : this(model, manifacturer,null, price, battery,null)
 {
 }
Example #7
0
 public GSM(string phoneModel, string phoneManufacturer, decimal?phonePrice, string phoneOwner, Battery phoneBattery, Display phoneDisplay)
     : this(phoneModel, phoneManufacturer)
 {
     this.Price   = phonePrice;
     this.Owner   = phoneOwner;
     this.Battery = phoneBattery;
     this.Display = phoneDisplay;
 }
Example #8
0
 public GSM(string model, string manufacturer, decimal price, string owner, Battery battery, Display display)
     : this(model, manufacturer, price, owner)
 {
     this.Battery = battery;
     this.Display = display;
 }