public static string GetKeyValue(string key) { using (MainDataContext dbContext = new MainDataContext()) { G_CONFIG config = dbContext.G_CONFIG.FirstOrDefault(t => t.Key == key); if (config != null) { return(config.Value); } else { return(string.Empty); } } }
public static bool Save(G_CONFIG entity) { using (MainDataContext dbContext = new MainDataContext()) { var model = dbContext.G_CONFIG.FirstOrDefault(a => a.Key == entity.Key); model.Value = entity.Value; try { dbContext.SubmitChanges(); } catch (Exception e) { throw; } return(true); } }
public bool Save(G_CONFIG entity) { return(DAL.BasicInfo.Config.Save(entity)); }