예제 #1
0
        public override string ToString()
        {
            string lcString = Bike.Serial.ToString() + "\t" + DateOfOrder.ToString() + "\t";

            lcString = lcString + "\t" + Bike.Brand + "\t";
            lcString = lcString + Bike.ModelName.PadRight(40 - Bike.ModelName.Length) + "\t";
            lcString = lcString + PriceAtOrder.ToString();

            return(lcString);
        }
예제 #2
0
        public override string ToString()
        {
            string lcString = Bike.Serial.ToString() + "    " + DateOfOrder.ToShortDateString() + "\t";

            if (Bike.Brand.Length > 20)
            {
                lcString = lcString + Bike.Brand.Substring(0, 20) + "\t";
            }
            else
            {
                lcString = lcString + Bike.Brand.PadRight(20) + "\t";
            }
            if (Bike.ModelName.Length > 20)
            {
                lcString = lcString + Bike.ModelName.Substring(0, 20) + "\t";
            }
            else
            {
                lcString = lcString + Bike.ModelName.PadRight(20) + "\t";
            }
            lcString = lcString + PriceAtOrder.ToString();

            return(lcString);
        }