Пример #1
0
        private bool Validate(CategoryDTO category)
        {
            ValidationService ValService = new ValidationService();

            if (string.IsNullOrWhiteSpace(category.Name) || string.IsNullOrWhiteSpace(category.Name_en))
            {
                Success      = false;
                ErrorMessage = "Nazev kategorie nemuze byt prazdny.";
                return(false);
            }
            else if (ValService.CategoryExists(category))
            {
                ErrorMessage = "Kategorie s temito nazvy j*z existuje.";
                Success      = false;
                return(false);
            }
            else
            {
                Success      = true;
                ErrorMessage = null;
                return(true);
            }
        }