public ActionResult Edit(int id) { var model = new EditMessageTemplateViewModel(); PrepareViewModel(model, EvolutionResources.bnrAddEditMessageTemplate); model.MessageTemplate = LookupService.FindMessageTemplateModel(id); model.MessageTemplate.CompanyId = model.CurrentCompany.Id; model.LGS = LookupService.LockMessageTemplate(model.MessageTemplate); return(View(model)); }
public ActionResult Save(EditMessageTemplateViewModel model, string command) { if (command.ToLower() == "save") { var modelError = LookupService.InsertOrUpdateMessageTemplate(model.MessageTemplate, CurrentUser, model.LGS); if (modelError.IsError) { PrepareViewModel(model, EvolutionResources.bnrAddEditMessageTemplate); model.SetErrorOnField(ErrorIcon.Error, modelError.Message, "MessageTemplate_" + modelError.FieldName); return(View("Edit", model)); } else { return(RedirectToAction("MessageTemplates")); } } else { return(RedirectToAction("MessageTemplates")); } }