示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
文件: Config.cs 项目: bertyang/Mobile
 public bool Save(G_CONFIG entity)
 {
     return(DAL.BasicInfo.Config.Save(entity));
 }