Inheritance: KnowYourTurf.Core.ViewModel
示例#1
0
 public ActionResult Save(SeedViewModel input)
 {
     Seed seed = input.Seed.EntityId > 0 ? _repository.Find<Seed>(input.Seed.EntityId) : new Seed();
     mapItem(seed, input);
     var crudManager = _saveEntityService.ProcessSave(seed);
     var notification = crudManager.Finish();
     return Json(notification, JsonRequestBehavior.AllowGet);
 }
示例#2
0
 public ActionResult AddEdit(ViewModel input)
 {
     var seed = input.EntityId > 0 ? _repository.Find<Seed>(input.EntityId) : new Seed();
     var model = new SeedViewModel
     {
         Seed = seed
     };
     return PartialView("SeedAddUpdate", model);
 }
示例#3
0
 public ActionResult Display(ViewModel input)
 {
     var seed = _repository.Find<Seed>(input.EntityId);
     var model = new SeedViewModel
     {
         Seed = seed,
         AddEditUrl = UrlContext.GetUrlForAction<SeedController>(x => x.AddEdit(null)) + "/" + seed.EntityId
     };
     return PartialView("SeedView", model);
 }
示例#4
0
 private void mapItem(Seed seed, SeedViewModel input)
 {
     seed.Description = input.Seed.Description;
     seed.Name = input.Seed.Name;
     seed.Notes = input.Seed.Notes;
 }