Пример #1
0
        public static int GetInt(String Name)
        {
            String moduleSettings = ModuleConfig.GetSettings();
            Data.Config config = new Fpp.WebModules.Data.Config(moduleSettings);
            DataSet ds = config.GetValue(Name);
            int res = 0;
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                res = Convert.ToInt32(ds.Tables[0].Rows[0]["Value"]);
            }

            return res;
        }
Пример #2
0
        public static String GetString(String Name)
        {
            String moduleSettings = ModuleConfig.GetSettings();
            Data.Config config = new Fpp.WebModules.Data.Config(moduleSettings);
            DataSet ds = config.GetValue(Name);
            String res = "";
            if (ds.Tables.Count > 1 && ds.Tables[0].Rows.Count > 1)
            {
                res = ds.Tables[0].Rows[0].ToString();
            }

            return res;
        }
Пример #3
0
        public static bool GetBoolean(String Name)
        {
            String moduleSettings = ModuleConfig.GetSettings();
            Data.Config config = new Fpp.WebModules.Data.Config(moduleSettings);
            DataSet ds = config.GetValue(Name);
            bool res = false;
            if (ds.Tables[0].Rows.Count > 0)
            {
                res = ( Convert.ToInt32(ds.Tables[0].Rows[0]["Value"]) == 1 );
            }

            return res;
        }