Example #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);
                }
            }
        }
Example #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);
            }
        }
Example #3
0
 public bool Save(G_CONFIG entity)
 {
     return(DAL.BasicInfo.Config.Save(entity));
 }