Пример #1
0
        public ActionResult Email(AdminEmailSettingViewModel setting)
        {
            if (ModelState.IsValid)
            {
                using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork())
                {
                    try
                    {
                        SettingsService.SetSetting(AppConstants.STInEmail, setting.InEmail);


                        unitOfWork.Commit();
                        TempData[AppConstants.MessageViewBagName] = new GenericMessageViewModel
                        {
                            Message     = LocalizationService.GetResourceString("Cập nhật thành công!"),
                            MessageType = GenericMessages.success
                        };
                    }
                    catch (Exception ex)
                    {
                        unitOfWork.Rollback();
                        LoggingService.Error(ex);
                    }
                }
            }

            return(View(setting));
        }
Пример #2
0
        //public ActionResult index()
        //{
        //    return General();
        //}

        #region Email Setting
        public ActionResult Email()
        {
            var viewModel = new AdminEmailSettingViewModel
            {
                InEmail = SettingsService.GetSetting(AppConstants.STInEmail),
            };

            return(View(viewModel));
        }