예제 #1
0
        public void SetGlobalProp(string name, string value)
        {
            var gvars = settings.GetAll().Where(x => x.Propertyname == name);

            if (gvars.Count() > 0)
            {
                DBSettings gvar = gvars.First();
                gvar.Value = value;
                settings.Update(gvar);
            }
            else
            {
                var gvar = new DBSettings();
                gvar.Propertyname = name;
                gvar.Value        = value;
                settings.Insert(gvar);
            }
        }
예제 #2
0
        public string GetGlobalProp(string name)
        {
            try
            {
                var gvars = settings.GetAll().Where(x => x.Propertyname.Equals(name));
                if (gvars.Count() > 0)
                {
                    DBSettings gvar = gvars.First();
                    return(gvar.Value);
                }
            }
            catch (Exception e)
            {
                log.Error("Error: GetGlobalProp: " + e);
            }

            return("");
        }