Inheritance: KnowYourTurf.Core.ViewModel
Exemplo n.º 1
0
 public ActionResult Save(ChemicalViewModel input)
 {
     Chemical chemical = input.Chemical.EntityId>0 ? _repository.Find<Chemical>(input.Chemical.EntityId) : new Chemical();
     mapItem(chemical, input);
     var crudManager = _saveEntityService.ProcessSave(chemical);
     var notification = crudManager.Finish();
     return Json(notification, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 2
0
 public ActionResult AddEdit(ViewModel input)
 {
     var chemical = input.EntityId > 0 ? _repository.Find<Chemical>(input.EntityId) : new Chemical();
     var model = new ChemicalViewModel
     {
         Chemical = chemical
     };
     return PartialView("ChemicalAddUpdate", model);
 }
Exemplo n.º 3
0
 public ActionResult Display(ViewModel input)
 {
     var chemical = _repository.Find<Chemical>(input.EntityId);
     var model = new ChemicalViewModel
     {
         Chemical = chemical,
         AddEditUrl = UrlContext.GetUrlForAction<ChemicalController>(x => x.AddEdit(null)) + "/" + chemical.EntityId
     };
     return PartialView("ChemicalView", model);
 }
Exemplo n.º 4
0
 private void mapItem(Chemical chemical, ChemicalViewModel input)
 {
     chemical.ActiveIngredient = input.Chemical.ActiveIngredient;
     chemical.ActiveIngredientPercent = input.Chemical.ActiveIngredientPercent;
     chemical.Description = input.Chemical.Description;
     chemical.EPAEstNumber = input.Chemical.EPAEstNumber;
     chemical.EPARegNumber = input.Chemical.EPARegNumber;
     chemical.Manufacturer = input.Chemical.Manufacturer;
     chemical.Name = input.Chemical.Name;
     chemical.Notes = input.Chemical.Notes;
 }