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;
        }
        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 setValue(DAOContext con, string strgKey, string strgValue)
        {
            SettingsDAO dao = new SettingsDAO(con);

            dao.mergeSettings(strgKey, strgValue);
            SettingsSingleton.cache_[strgKey] = new values(Int32.MinValue, strgValue);
        }
 public static bool isExistsHeader(DAOContext con, string headerText)
 {
     if (con.Connection.State != ConnectionState.Open) return false;
     bool ret = false;
     MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
     ret = dao.isExistsHeader(headerText);
     return ret;
 }
Ejemplo n.º 5
0
 public MyDAOBase(DAOContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException("context");
     }
     this.Context = context;
 }
 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 deleteSettings(DAOContext con, string headerText)
        {

            //DBから読み込む
            MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

            dao.deleteSettings(headerText);
            dao.deleteHeader(headerText);

        }
 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();
     }
 }
 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 void getValue(DAOContext con, string headerText, string strgKey, out int intValue)
        {
            intValue = 0;
            if (con.Connection.State != ConnectionState.Open) return;


            //DBから読み込む
            MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

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

        }
        public static string getValue(DAOContext con, string headerText, string strgKey)
        {
            string strgValue = "";
            if (con.Connection.State != ConnectionState.Open) return "";

            //DBから読み込む
            MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

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

            return strgValue;
        }
 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 void setStringValues(DAOContext con, string headerText, string strgKey, IList<string> strgs)
        {
            if (con.Connection.State != ConnectionState.Open) return;
            int no = 1;
            MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

            dao.deleteSettings(headerText, strgKey);

            foreach (string strg in strgs)
            {
                dao.insertNew(headerText, strgKey, no, strg);
                no++;
            }
        }
        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 IList<string> getHeaderTexts(DAOContext con)
        {
            List<string> headertexts = new List<string>();
            DataTable tbl = null;
            //DBから読み込む
            MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

            tbl = dao.selectHeaders();

            if (tbl != null)
            {
                foreach (DataRow row in tbl.Rows)
                {
                    headertexts.Add(row["HEADERTEXT"].ToString());
                }
            }
            return headertexts;
        }
        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> getValues(DAOContext con, string headerText, string strgKey)
        {
            List<string> ret = new List<string>();
            DataTable tbl = null;

            if (con.Connection.State != ConnectionState.Open) return ret;

            //DBから読み込む
            MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);

            tbl = dao.selectSettingRows(headerText, strgKey);

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

            return ret;
        }
        public static void getValue(DAOContext con, string strgKey, out string strgValue)
        {
            strgValue = "";

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

                dao.selectSetting(strgKey, out strgValue);

                SettingsSingleton.cache_[strgKey] = new values(Int32.MinValue, strgValue);
            }
            else
            {
                //キャッシュにあり
                //キャッシュの値を返す
                values v = SettingsSingleton.cache_[strgKey];
                strgValue = v.strgValue;
            }
        }
        public static void getValue(DAOContext con, string strgKey, out int intValue)
        {
            intValue = 0;

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

                dao.selectSetting(strgKey, out intValue);

                SettingsSingleton.cache_[strgKey] = new values(intValue, null);
            }
            else
            {
                //キャッシュにあり
                //キャッシュの値を返す
                values v = SettingsSingleton.cache_[strgKey];
                intValue = v.intValue;
            }
        }
        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;
        }
Ejemplo n.º 22
0
 public AccessSchemaDAO(DAOContext con) : base(con)
 {
 }
 public static void setValue(DAOContext con, string headerText, string strgKey, string strgValue)
 {
     if (con.Connection.State != ConnectionState.Open) return;
     MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
     dao.mergeSettings(headerText, strgKey, strgValue);
 }
 public static void MergeHeader(DAOContext con, string headerText)
 {
     if (con.Connection.State != ConnectionState.Open) return;
     MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
     dao.mergeHeader(headerText);
 }
 public static void deleteSettings(DAOContext con, string headerText, string strgKey)
 {
     if (con.Connection.State != ConnectionState.Open) return;
     MyDummySQLSettingsDAO dao = new MyDummySQLSettingsDAO(con);
     dao.deleteSettings(headerText, strgKey);
 }
 public SettingsDAO(DAOContext con) : base(con)
 {
 }
 public MyDummySQLSettingsDAO(DAOContext con) : base(con)
 {
 }
Ejemplo n.º 28
0
 public funcsDAO(DAOContext con)
     : base(con)
 {
 }
Ejemplo n.º 29
0
 public tableDAO(DAOContext con, string tableName_)
     : base(con)
 {
     this.tableName = tableName_;
 }
 public TemplatesDAO(DAOContext con)
     : base(con)
 {
 }