예제 #1
0
        public EmailTemplateListViewModel getEmailTemplateList()
        {
            EmailTemplateListViewModel model = new EmailTemplateListViewModel();

            model.templateList = _mapper.Map <IList <EmailTemplatesViewModel> >(_mainContext.mailTemplates.ToList());
            return(model);
        }
예제 #2
0
        public async Task <JsonResult> EmailTemplateList(EmailTemplateListViewModel model)
        {
            try
            {
                model._context         = _context;
                model._emailService    = _emailService;
                model._securityOptions = _securityOptions;

                await model.PopulateLists();

                return(Json(new { result = true, data = model }));
            }
            catch (Exception ex)
            {
                HelperFunctions.Log(_context, PublicEnums.LogLevel.LEVEL_EXCEPTION, "Controllers.MasterDataController.EmailTemplateList", ex.Message, User, ex);
                ViewBag.Error = "An error occurred while loading data";
            }

            return(Json(new { result = false, message = "An error occurred. Please try again later." }));
        }
예제 #3
0
        public async Task <IActionResult> EmailTemplateList()
        {
            EmailTemplateListViewModel model = new EmailTemplateListViewModel();

            try
            {
                model._context         = _context;
                model._emailService    = _emailService;
                model._securityOptions = _securityOptions;

                await model.PopulateLists();
            }
            catch (Exception ex)
            {
                HelperFunctions.Log(_context, PublicEnums.LogLevel.LEVEL_EXCEPTION, "Controllers.MasterDataController.EmailTemplateList", ex.Message, User, ex);
                ViewBag.Error = "An error occurred while loading data";
            }

            ViewData.Model = model;

            return(View());
        }