Пример #1
0
        public ActionResult Update(SpeciesEditFormViewModel vm)
        {
            // TryUpdateModel(vm);
            var updateResult = this.speciesRepository.Update(vm.Id, vm.Name, vm.Genus, vm.Described, vm.Description, vm.Size[0], vm.Size[1], vm.Temperament, this.User.Identity.Name);

            return updateResult == UpdateResult.Success ? new JsonResult { Data = true } : new JsonResult { Data = false };
        }
Пример #2
0
        public ActionResult Create(SpeciesEditFormViewModel vm)
        {
            var addResult = this.speciesRepository.Add(vm.Name, vm.Genus, vm.Described, vm.Description, vm.Size[0], vm.Size[1], vm.Temperament, this.User.Identity.Name);

            return addResult != null ? new JsonResult { Data = true } : new JsonResult { Data = false };
        }