예제 #1
0
        public string GetAllDetailsOfVehicle(string i_LicenseNum)
        {
            string details = null;
            Dictionary <string, Vehicle> collectionWhereVehicleStored = DetectCollectionInWhichTheVehicleStored(i_LicenseNum);

            if (collectionWhereVehicleStored == null)
            {
                throw new ArgumentException();
            }
            else
            {
                Vehicle theVehicle = collectionWhereVehicleStored[i_LicenseNum];
                details  = theVehicle.GetSpecificDetails();
                details += theVehicle.GetDetailsOfCommonThings();

                /* details += Environment.NewLine + m_VehiclesOwnersDetails[i_LicenseNum].OwnerName + Environment.NewLine + m_VehiclesOwnersDetails[i_LicenseNum].OwnerPhoneNum + Environment.NewLine;
                 *
                 */
                details = string.Format(
                    @"There are the details of current vehicle:
==========================================
{0}
{1}
{2}
Owner name: {3}
Owner phone: {4}",
                    theVehicle.GetSpecificDetails(),
                    theVehicle.GetDetailsOfCommonThings(),
                    getStatusAccordingToCollection(collectionWhereVehicleStored),
                    m_VehiclesOwnersDetails[i_LicenseNum].OwnerName,
                    m_VehiclesOwnersDetails[i_LicenseNum].OwnerPhoneNum);
            }

            return(details);
        }