public void Save(CoolerTypeViewModel coolerTypeViewModel) { AssetType coolerType = new AssetType(coolerTypeViewModel.Id) { Name=coolerTypeViewModel.Name, Description=coolerTypeViewModel.Code }; _coolerTypeRepository.Save(coolerType); }
public ActionResult EditCoolerType(CoolerTypeViewModel ctpvm) { try { _coolerTypeViewModelBuilder.Save(ctpvm); _auditLogViewModelBuilder.AddAuditLog(this.User.Identity.Name, "Edit", "Cooler Type", DateTime.Now); return RedirectToAction("ListCoolerTypes"); } catch (DomainValidationException dve) { ValidationSummary.DomainValidationErrors(dve,ModelState); return View(); } catch (Exception ex) { _log.Debug("Failed to edit cooler type" + ex.Message); _log.Error("Failed to edit cooler type" + ex.ToString()); return View(); } }