public ActionResult AddSpecie(string name)
        {
            if (String.IsNullOrEmpty(name))
            {
                return(Json(new { Result = "Fail, specie name is required" }));
            }
            Specie type = _SpecieRepo.GetByName(name);

            if (type != null)
            {
                return(Json(new { Result = "Fail, this specie is already exits in the system" }));
            }


            Specie newtype = new Specie();

            newtype.name = name;
            _SpecieRepo.Add(newtype);
            return(Json(new { Result = "Success" }));
        }
Exemple #2
0
 public Specie GetByName(string name)
 {
     return(_specieRepository.GetByName(name));
 }