Exemplo n.º 1
0
        public string this[string name]
        {
            get
            {
                string komunikat = null;
                if (name == "Tytuł")
                {
                    komunikat = StringValidator.IsNotEmpty(this.Tytuł) ?? StringValidator.IsStartFromUpper(this.Tytuł);
                }
                else if (name == "IdGatunku")
                {
                    komunikat = ComboboxValidator.IsNotEmpty(this.IdGatunku);
                }
                else if (name == "Rezyser")
                {
                    komunikat = StringValidator.IsNotEmpty(this.Rezyser);
                }
                else if (name == "RokProdukcji")
                {
                    komunikat = IntegerValidation.IsNotEmpty(this.RokProdukcji) ?? IntegerValidation.IsYearInPast(this.RokProdukcji);
                }
                else if (name == "CzasTrwania")
                {
                    komunikat = DecimalValidation.IsNotEmpty(this.CzasTrwania) ?? DecimalValidation.IsPositive(this.CzasTrwania);
                }
                else if (name == "LimitWiekowy")
                {
                    komunikat = IntegerValidation.IsNotEmpty(this.LimitWiekowy) ?? IntegerValidation.IsPositive(this.LimitWiekowy);
                }

                return(komunikat);
            }
        }
Exemplo n.º 2
0
        public string this[string name]
        {
            get
            {
                string komunikat = null;
                if (name == "Nazwa")
                {
                    komunikat = StringValidator.IsNotEmpty(this.Nazwa) ?? StringValidator.IsStartFromUpper(this.Nazwa);
                }
                else if (name == "Numer")
                {
                    komunikat = IntegerValidation.IsNotEmpty(this.Numer) ?? IntegerValidation.IsPositive(this.Numer);
                }
                else if (name == "LiczbaMiejsc")
                {
                    komunikat = IntegerValidation.IsNotEmpty(this.LiczbaMiejsc) ?? IntegerValidation.IsPositive(this.LiczbaMiejsc);
                }

                return(komunikat);
            }
        }