Ejemplo n.º 1
0
        /// <summary>
        /// This class contains all the mediator methods / business logic for controlling
        /// the car dealer app. 
        /// </summary>
        /// <param name="state">
        /// Do note, as of now the state HAS to be either Commission, Leased or Sold
        /// with uppercase first letters, for the enum to take effect, otherwise
        /// the state will default to Sold! - This should be fixed in a later version
        /// by limiting the possible states in a list in the GUI.
        /// </param>
        public void CreateCar(string model, string colour, double price, string state)
        {
            Car Car = new Car();
            Car.Model = model;
            Car.Colour = colour;
            Car.Price = price;

            if (state == "Commission")
                Car.State = VehicleState.Commission;
            else if (state == "Leased")
                Car.State = VehicleState.Leased;
            else if (state == "Sold")
                Car.State = VehicleState.Sold;
            else Car.State = VehicleState.Sold;
            carlist.Add(Car);
               // database.AddToCarList(Car);
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     Truck truck1 = new Truck();
     truck1.Model = "Scania Hallower";
     truck1.Colour = "Dark Blue";
     truck1.Price = 800;
     truck1.State = VehicleState.Leased;
     trucklist.Add(truck1);
     Car car1 = new Car();
     car1.Model = "Tesla Shadowrider";
     car1.Colour = "Black";
     car1.Price = 80000;
     car1.State = VehicleState.Commission;
     carlist.Add(car1);
 }
Ejemplo n.º 3
0
 public void MakeContractSale(Car v, CustomerPrivate c, DateTime d)
 {
     ContractSale Contract = new ContractSale();
     Contract.Car = v;
     Contract.Customer = c;
     Contract.DateSold = d;
     //Implement foundation.saveContractSale with Contract lloloooloololollolololololololol
 }