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; }
public Setting GetRowSelectelById(int id) { try { var Result = _settingRepository.Find(id); return(Result); } catch (Exception) { return(null); } }
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(); } }
// GET: /Settings/Details/5 public ViewResult Details(long id) { return(View(settingRepository.Find(id))); }
private string GetSettingValue(string key) { Setting setting = _settingRepository.Find(x => x.Key == key).FirstOrDefault(); return(setting != null ? setting.Value : null); }
public IList <Setting> FindSettings(string name, string value) { var result = _settingRepository.Find(name, value).ToList(); return(result); }