Esempio n. 1
0
        // GET: Admin/Settings
        public ActionResult Index()
        {
            ViewBag.ColSizeLabel = "col-sm-8 col-md-9";
            ViewBag.ColSizeShort = "col-md-4 col-md-3";

            var model = m_settingsWorker.GetManagerSettingsEdit();

            this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.WorkingStock, model.WorkingStock);
            this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.ShowUnstockItem, model.ShowUnstockItem);
            this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.PriceIncludeTax, model.PriceIncludeTax);
            this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.ShowComments, model.ShowComments);
            this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.UseFacebookComments, model.UseFacebookComments);
            return(View(model));
        }
Esempio n. 2
0
 public ActionResult Index(SettingsEditViewModel model)
 {
     if (ModelState.IsValid)
     {
         try
         {
             m_settingsWorker.UpdateManagerSettingsEdit(model);
             Business.Layers.SettingsLayer.RegisterAppSettings();
             return(RedirectToAction("Index", "Manager"));
         }
         catch (Exception ex)
         {
             ModelState.AddModelError("General", ex.Message);
         }
     }
     this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.WorkingStock, model.WorkingStock);
     this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.ShowUnstockItem, model.ShowUnstockItem);
     this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.PriceIncludeTax, model.PriceIncludeTax);
     this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.ShowComments, model.ShowComments);
     this.Pair2List <SettingsEditViewModel, string, string>(SettingValues.GetYesNo(), m => m.UseFacebookComments, model.UseFacebookComments);
     return(View(model));
 }