Beispiel #1
0
        string IDataErrorInfo.this[string columnName]
        {
            get
            {
                string SerwerProp = BindableBase.GetPropertyName(() => Serwer);

                if (columnName == SerwerProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(SerwerProp, Serwer));
                }
                else
                {
                    return(null);
                }
            }
        }
        string IDataErrorInfo.this[string columnName]
        {
            get
            {
                string NazwaPelnaProp  = BindableBase.GetPropertyName(() => NazwaPelna);
                string NazwaProp       = BindableBase.GetPropertyName(() => Nazwa);
                string NipProp         = BindableBase.GetPropertyName(() => Nip);
                string RegonProp       = BindableBase.GetPropertyName(() => Regon);
                string MiejscowoscProp = BindableBase.GetPropertyName(() => Miejscowosc);
                string KodPocztaProp   = BindableBase.GetPropertyName(() => KodPoczta);
                string PocztaProp      = BindableBase.GetPropertyName(() => Poczta);

                string UlicaProp    = BindableBase.GetPropertyName(() => Ulica);
                string NrDomuProp   = BindableBase.GetPropertyName(() => NrDomu);
                string NrLokaluProp = BindableBase.GetPropertyName(() => NrLokalu);
                string TelkomProp   = BindableBase.GetPropertyName(() => Telkom);
                string TelefonProp  = BindableBase.GetPropertyName(() => Telefon);
                string UwagiProp    = BindableBase.GetPropertyName(() => Uwagi);
                string EmailProp    = BindableBase.GetPropertyName(() => Email);
                if (columnName == NazwaPelnaProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(NazwaPelnaProp, NazwaPelna));
                }
                else if (columnName == NazwaProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(NazwaProp, Nazwa));
                }
                else if (columnName == NipProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(NipProp, Nip));
                }
                else if (columnName == RegonProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(RegonProp, Regon));
                }
                //else if (columnName == confirmPasswordProp)
                //{
                //    if (!string.IsNullOrEmpty(Password) && Password != ConfirmPassword)
                //        return "These passwords do not match. Please try again.";
                //}
                else if (columnName == MiejscowoscProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(MiejscowoscProp, Miejscowosc));
                }
                else if (columnName == KodPocztaProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(KodPocztaProp, KodPoczta));
                }
                else if (columnName == PocztaProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(PocztaProp, Poczta));
                }
                else if (columnName == UlicaProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(UlicaProp, Ulica));
                }
                else if (columnName == NrDomuProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(NrDomuProp, NrDomu));
                }
                else if (columnName == NrLokaluProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(NrLokaluProp, NrLokalu));
                }
                else if (columnName == EmailProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(EmailProp, Email));
                }
                else if (columnName == TelkomProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(TelkomProp, Telkom));
                }
                else if (columnName == TelefonProp)
                {
                    return(RequiredValidationRule.GetErrorMessage(TelefonProp, Telefon));
                }
                //     else if (columnName == UwagiProp)
                //       return RequiredValidationRule.GetErrorMessage(UwagiProp, Kontrah.WWW);

                return(null);
            }
        }