Inheritance: KnowYourTurf.Core.ViewModel
 private EmailTemplate mapToDomain(EmailTemplateViewModel input, EmailTemplate emailTemplate)
 {
     var emailTemplateModel = input.EmailTemplate;
     emailTemplate.Name= emailTemplateModel.Name;
     emailTemplate.Description= emailTemplateModel.Description;
     emailTemplate.Template= emailTemplateModel.Template;
     return emailTemplate;
 }
 public ActionResult AddEdit(ViewModel input)
 {
     var emailTemplate = input.EntityId > 0 ? _repository.Find<EmailTemplate>(input.EntityId) : new EmailTemplate();
     var model = new EmailTemplateViewModel
     {
         EmailTemplate = emailTemplate,
     };
     return PartialView("EmailTemplateAddUpdate", model);
 }
        public ActionResult Save(EmailTemplateViewModel input)
        {
            var emailTemplate = input.EmailTemplate.EntityId > 0 ? _repository.Find<EmailTemplate>(input.EmailTemplate.EntityId) : new EmailTemplate();
            var newTask = mapToDomain(input, emailTemplate);

            var crudManager = _saveEntityService.ProcessSave(newTask);
            var notification = crudManager.Finish();
            return Json(notification, JsonRequestBehavior.AllowGet);
        }
        private EmailTemplate mapToDomain(EmailTemplateViewModel input, EmailTemplate emailTemplate)
        {
            var emailTemplateModel = input.EmailTemplate;

            emailTemplate.Name        = emailTemplateModel.Name;
            emailTemplate.Description = emailTemplateModel.Description;
            emailTemplate.Template    = emailTemplateModel.Template;
            return(emailTemplate);
        }
 public ActionResult Display(ViewModel input)
 {
     var emailTemplate = _repository.Find<EmailTemplate>(input.EntityId);
     var model = new EmailTemplateViewModel
                     {
                         EmailTemplate = emailTemplate,
                         AddEditUrl = UrlContext.GetUrlForAction<EmailTemplateController>(x => x.AddEdit(null)) + "/" + emailTemplate.EntityId
                     };
     return PartialView("EmailTemplateView", model);
 }
        public ActionResult Save(EmailTemplateViewModel input)
        {
            var emailTemplate = input.EmailTemplate.EntityId > 0 ? _repository.Find <EmailTemplate>(input.EmailTemplate.EntityId) : new EmailTemplate();
            var newTask       = mapToDomain(input, emailTemplate);

            var crudManager  = _saveEntityService.ProcessSave(newTask);
            var notification = crudManager.Finish();

            return(Json(notification, JsonRequestBehavior.AllowGet));
        }
        public ActionResult AddEdit(ViewModel input)
        {
            var emailTemplate = input.EntityId > 0 ? _repository.Find <EmailTemplate>(input.EntityId) : new EmailTemplate();
            var model         = new EmailTemplateViewModel
            {
                EmailTemplate = emailTemplate,
            };

            return(PartialView("EmailTemplateAddUpdate", model));
        }
        public ActionResult Display(ViewModel input)
        {
            var emailTemplate = _repository.Find <EmailTemplate>(input.EntityId);
            var model         = new EmailTemplateViewModel
            {
                EmailTemplate = emailTemplate,
                AddEditUrl    = UrlContext.GetUrlForAction <EmailTemplateController>(x => x.AddEdit(null)) + "/" + emailTemplate.EntityId
            };

            return(PartialView("EmailTemplateView", model));
        }