Ejemplo n.º 1
0
        public SettingViewModel()
        {
            _settingRepository = SettingRepository.SR;

            _selectedSetting = new SettingVo();

            SettingList = new ObservableCollection <SettingVo>(_settingRepository.GetSettings());

            ModifyCommand    = new Command(ExecuteModifyMethod);
            InitalizeCommand = new Command(ExecuteInitalizeMethod);
        }
Ejemplo n.º 2
0
        public void DeleteSetting(SettingVo setting)
        {
            MySqlDataAdapter adapter = new MySqlDataAdapter(_sql, _conn.Msc);

            DataTable table = _ds.Tables[0];

            DataRow row = table.Select().Single(x => x["property"] as string == setting.Property);

            row.Delete();

            Save(adapter);
        }
Ejemplo n.º 3
0
        public List <SettingVo> GetSettings()
        {
            List <SettingVo> list = new List <SettingVo>();

            foreach (DataRow row in _ds.Tables[0].Rows)
            {
                SettingVo s = new SettingVo();
                s.Property = row["property"] as string;
                s.Value    = row["value"] as string;
                list.Add(s);
            }
            return(list);
        }