Beispiel #1
0
        public JsonResult IsDuplicateTechnologyName(string technologyName, int technologyId)
        {
            bool isAvailable = true;

            if (!string.IsNullOrWhiteSpace(technologyName) && ModelState.IsValid)
            {
                var technology = _technologyService.GetTechnologyByName(technologyName);
                if (technology != null && technology.TechnologyId != technologyId)
                {
                    isAvailable = false;
                }
            }
            return(Json(isAvailable, JsonRequestBehavior.AllowGet));
        }