コード例 #1
0
ファイル: Country.cs プロジェクト: KommuSoft/CplKul2012
        protected override bool isValid(out string exceptionMessage)
        {
            if (name.Length == 0) {
                return makeExceptionMessage (out exceptionMessage, "The name of the country is invalid");
            }

            CountryRequest cr = new CountryRequest ();
            if (cr.fetchCountryFromName (name).Count != 0) {
                return makeExceptionMessage (out exceptionMessage, "The name of the country is invalid because it already exists.");
            }

            return makeExceptionMessage(out exceptionMessage);
        }