示例#1
0
        } // end ToString() method

        /// <summary>
        /// Return a list of each Vehicle attribute
        /// </summary>
        ///
        /// <returns> List of string of attributes for the current instance of vehicles </returns>

        public List <string> GetAttributeList()
        {
            List <string> attributeList = new List <string>();

            // Add each of the Vehicle attributes to the list 'attributeList'
            attributeList.Add(VehicleRego);
            attributeList.Add(Make);
            attributeList.Add(Model);
            attributeList.Add(Year.ToString());
            attributeList.Add(Vehicle_Class.ToString());
            attributeList.Add(Transmission_Type.ToString());
            attributeList.Add(string.Format("{0}-Seater", NumSeats.ToString()));
            attributeList.Add(Colour);
            attributeList.Add(DailyRate.ToString());
            attributeList.Add(Fuel_Type.ToString());
            if (GPS)
            {
                attributeList.Add("GPS");
            } // end if
            if (SunRoof)
            {
                attributeList.Add("sunroof");
            } // end if

            return(attributeList);
        } // end GetAttributeList() method
示例#2
0
 public Car() //дописать, !!дописано наверно!!
 {
     this.numberPlate      = "";
     this.colour           = "";
     this.mileage          = "";
     this.accidentHistory  = "";
     this.price            = "";
     this.size             = Size.large;
     this.numDoors         = NumDoors.two;
     this.numSeats         = NumSeats.two;
     this.bodyType         = BodyTypes.Saloon;
     this.accessability    = Accessability.sold;
     this.transmissionType = Transmissiontype.manual;
     this.dateArrival      = DateTime.Today;
     this.dateSell         = new DateTime(); //вернет 01 01 01
 }
示例#3
0
        public string ToCSVString()
        {
            string csvString = "";

            csvString = csvString + Registration + "," + Grade + "," + Make + "," + Model + "," + Year.ToString() + "," + NumSeats.ToString() + "," + Transmission + "," + Fuel + "," + GPS.ToString() + "," + SunRoof.ToString() + "," + DailyRate.ToString() + "," + Colour + "";
            return(csvString);
        }