Esempio n. 1
0
 public static bool?getBool(String target, String key)
 {
     HRONLib.Config c = get(target, key);
     if (c != null)
     {
         return(c.valueBool);
     }
     return(null);
 }
Esempio n. 2
0
 public static decimal?getDecimal(String target, String key)
 {
     HRONLib.Config c = get(target, key);
     if (c != null)
     {
         return(c.valueDecimal);
     }
     return(null);
 }
Esempio n. 3
0
 public static String getString(String target, String key)
 {
     HRONLib.Config c = get(target, key);
     if (c != null)
     {
         return(c.value);
     }
     return(null);
 }
Esempio n. 4
0
        private static HRONLib.Config get(String target, string key)
        {
            HRONLib.Config c = ent.Config.Where(e => e.target == target && e.key == key).FirstOrDefault();
            if (c != null)
            {
                return(c);
            }
            else
            {
                HRONLib.Config x = new HRONLib.Config();
                x.key    = key;
                x.target = target;
                ent.Config.Add(x);

                ent.SaveChangesAsync();

                return(null);
            }
        }
Esempio n. 5
0
 private static void set(String target, String key, String vS, decimal?vD, bool?vB)
 {
     HRONLib.Config c = ent.Config.Where(e => e.target == target && e.key == key).FirstOrDefault();
     if (c != null)
     {
         c.value        = vS;
         c.valueBool    = vB;
         c.valueDecimal = vD;
     }
     else
     {
         HRONLib.Config x = new HRONLib.Config();
         x.key    = key;
         x.target = target;
         ent.Config.Add(x);
         c.value        = vS;
         c.valueBool    = vB;
         c.valueDecimal = vD;
     }
     ent.SaveChangesAsync();
 }