public static IList<string> getValues(string headerText, string strgKey)
        {
            List<string> ret = new List<string>();
            DataTable tbl = null;

            //DBから読み込む
            using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
            {
                con.OpenConnection();
                MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

                tbl = dao.selectSettingRows(headerText, strgKey);

                con.CloseConnection();

            }

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    ret.Add(row["TEXTVALUE"].ToString());
                }
            }

            return ret;
        }
コード例 #2
0
        public static void getValue(string strgKey, out string strgValue)
        {
            strgValue = "";

            if (!SettingsSingleton.isExistsStringValue(strgKey))
            {
                //キャッシュになし
                //DBから読み込む
                using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
                {
                    con.OpenConnection();
                    SettingsDAO dao = new SettingsDAO(con);

                    dao.selectSetting(strgKey, out strgValue);

                    con.CloseConnection();

                    SettingsSingleton.cache_[strgKey] = new values(Int32.MinValue, strgValue);
                }
            }
            else
            {
                //キャッシュにあり
                //キャッシュの値を返す
                values v = SettingsSingleton.cache_[strgKey];
                strgValue = v.strgValue;
            }
        }
 public static void deleteSettings(string headerText, string strgKey)
 {
     using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
     {
         con.OpenConnection();
         MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
         dao.deleteSettings(headerText, strgKey);
         con.CloseConnection();
     }
 }
 public static void MergeHeader(string headerText)
 {
     using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
     {
         con.OpenConnection();
         MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
         dao.mergeHeader(headerText);
         con.CloseConnection();
     }
 }
コード例 #5
0
 public static void setValue(string strgKey, string strgValue)
 {
     using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
     {
         con.OpenConnection();
         SettingsDAO dao = new SettingsDAO(con);
         dao.mergeSettings(strgKey, strgValue);
         con.CloseConnection();
     }
     SettingsSingleton.cache_[strgKey] = new values(Int32.MinValue, strgValue);
 }
        public static void setValue(string headerText, string strgKey, int intValue)
        {
            using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
            {
                con.OpenConnection();
                MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
                dao.mergeSettings(headerText, strgKey, intValue);
                con.CloseConnection();
            }

        }
 public static bool isExistsHeader(string headerText)
 {
     bool ret = false;
     using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
     {
         con.OpenConnection();
         MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
         ret = dao.isExistsHeader(headerText);
         con.CloseConnection();
     }
     return ret;
 }
        public static string getValue(string headerText, string strgKey)
        {
            string strgValue = "";

            //DBから読み込む
            using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
            {
                con.OpenConnection();
                MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

                dao.selectSetting(headerText, strgKey, out strgValue);

                con.CloseConnection();

            }
            return strgValue;
        }
        public static void setStringValues(string headerText, string strgKey, IList<string> strgs)
        {
            int no = 1;
            using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
            {
                con.OpenConnection();
                MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

                dao.deleteSettings(headerText, strgKey);

                foreach (string strg in strgs)
                {
                    dao.insertNew(headerText, strgKey, no, strg);
                    no++;
                }

                con.CloseConnection();
            }

        }
        public static IList<string> getHeaderTexts()
        {
            List<string> headertexts = new List<string>();
            DataTable tbl = null;
            //DBから読み込む
            using (DAOContext con = new DAOContext(AccessConstring.SettingConString))
            {
                con.OpenConnection();
                MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

                tbl = dao.selectHeaders();

                con.CloseConnection();
            }

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    headertexts.Add(row["HEADERTEXT"].ToString());
                }
            }
            return headertexts;
        }