public void SetNameValue(string name, string value) { Settings s = sd.GetModel(name); if (s == null) { s = new Settings(); s.Name = name; s.Value = value; dal.Add(s); } else { s.Value = value; dal.Update(s); } HttpRuntime.Cache["setting_" + name] = value; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(BookShop.Model.Settings model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BookShop.Model.Settings model) { return(dal.Add(model)); }