コード例 #1
0
        public void SetSetting(string key, string value)
        {
            IList <Setting> settings = _settingRepository.Find(query => query.Where(s => s.SettingKey == key));

            foreach (var setting in settings)
            {
                setting.SettingValue = value;
                _settingRepository.Update(setting);
            }
            _settings[key] = value;
        }
コード例 #2
0
 public Setting GetRowSelectelById(int id)
 {
     try
     {
         var Result = _settingRepository.Find(id);
         return(Result);
     }
     catch (Exception)
     {
         return(null);
     }
 }
コード例 #3
0
        public void CreateNewHolidays()
        {
            var currentYear        = DateTime.Now.Year;
            var payrollCurrentYear = _settingRepository.Find(x => x.SettingKey == "HOLIDAY_CURRENT_YEAR").First();

            if (currentYear > Convert.ToInt32(payrollCurrentYear.Value))
            {
                var staticHolidays = GetStaticHolidays(currentYear);
                foreach (var holiday in staticHolidays)
                {
                    _holidayRepository.Add(holiday);
                }

                _settingRepository.Update(payrollCurrentYear);
                payrollCurrentYear.Value = currentYear.ToString();
                _unitOfWork.Commit();
            }
        }
コード例 #4
0
 // GET: /Settings/Details/5
 public ViewResult Details(long id)
 {
     return(View(settingRepository.Find(id)));
 }
コード例 #5
0
        private string GetSettingValue(string key)
        {
            Setting setting = _settingRepository.Find(x => x.Key == key).FirstOrDefault();

            return(setting != null ? setting.Value : null);
        }
コード例 #6
0
ファイル: SettingService.cs プロジェクト: festelariane/mcdb
        public IList <Setting> FindSettings(string name, string value)
        {
            var result = _settingRepository.Find(name, value).ToList();

            return(result);
        }