public ActionResult GetAnimalParticularAddingView() { var model = new AnimalPaticularEditModel { AnimalTypes = _kindOfAnimalService.GetAnimalKinds().Select(_ => new SelectListItem() { Text = _.Name, Value = _.Id.ToString() }).ToList() }; return(View("AddingNewParticularAnimal", model)); }
public ActionResult AddNewAnimalParticular(AnimalParticularModel model) { if (ModelState.IsValid) { _animalParticularService.AddAnimalParticular(model); //return View("DifferentAnimalsFromKindList"); return(RedirectToAction("GetByAnimalType", new { id = model.AnimalTypeId })); } else { var m1 = new AnimalPaticularEditModel { AnimalTypes = _kindOfAnimalService.GetAnimalKinds().Select(_ => new SelectListItem() { Text = _.Name, Value = _.Id.ToString() }).ToList() }; return(View("AddingNewParticularAnimal", m1)); } }