Exemplo n.º 1
0
        // Validation: Is town already in evidention
        public bool IsTownNameValid(string townName)
        {
            if (townName == null)
            {
                TempData["message"] = String.Format("Unos naziva grada je obavezan!", townName);
                return(false);
            }

            if (!townRepository.IsTownNameValid(townName))
            {
                TempData["message"] = String.Format("Grad {0} se vec nalazi u evidenciji", townName);
                return(false);
            }

            return(true);
        }