Ejemplo n.º 1
0
 public void Save(SettingsViewModel settingsViewModel)
 {
     AppSettings setting = new AppSettings(settingsViewModel.Id)
                            {
                                Key = (SettingsKeys)settingsViewModel.SettingKey,
                                Value = settingsViewModel.Value
                            };
     _settingsRepository.Save(setting);
 }
Ejemplo n.º 2
0
        public SettingsViewModel Map(AppSettings s)
        {
            var Keys = from Enum e in Enum.GetValues(typeof(SettingsKeys))
                       select new { Key = e, Value = e.ToString() };
                           
            var settingViewModel=  new SettingsViewModel
            {

                SettingKey = (int) s.Key,
                Value = s.Value,
                Id = s.Id,
                IsActive = s._Status == EntityStatus.Active ? true : false,
            };
            //settingViewModel.KeyList = new SelectList(Keys, "key", "Value");
            return settingViewModel;
        }