Beispiel #1
0
        void UpdateUserInfo(UserInfo contact)
        {
            MySqlDataReader Reader;
            MySqlCommand    command = MariaDbConnection.CreateCommand();


            int level = 0;

            if (contact.Level == UserLevel.Level1)
            {
                level = 1;
            }
            else if (contact.Level == UserLevel.Level2)
            {
                level = 2;
            }
            else if (contact.Level == UserLevel.Level3)
            {
                level = 3;
            }
            string sql = string.Format("update AMR_MST06 set MST06AID = '{0}', MST06LEV = '{1}', MST06NAM = '{2}', MST06PHN = '{3}', MST06PWD = '{4}' where MST06AID = '{5}'",
                                       contact.Id, level, contact.Name, contact.Phone, contact.Password, contact.Id);


            command.CommandText = sql;

            Reader = command.ExecuteReader();
            Reader.Close();
        }
Beispiel #2
0
        void InsertUserInfo(UserInfo contact)
        {
            MySqlDataReader Reader;
            MySqlCommand    command = MariaDbConnection.CreateCommand();

            int level = 0;

            if (contact.Level == UserLevel.Level1)
            {
                level = 1;
            }
            else if (contact.Level == UserLevel.Level2)
            {
                level = 2;
            }
            else if (contact.Level == UserLevel.Level3)
            {
                level = 3;
            }
            string sql = string.Format("insert into AMR_MST06 values('{0}', '{1}', '{2}', '{3}', '{4}')", contact.Id, contact.Password, contact.Name, level, contact.Phone);

            command.CommandText = sql;

            Reader = command.ExecuteReader();
            Reader.Close();
        }
Beispiel #3
0
 public static IEnumerable <object[]> AllConnectionsWithoutSQLite(string section) => new[] {
     new object[] { (IConnectionManager)MariaDbConnection.ConnectionManager(section) },
     new object[] { (IConnectionManager)OracleConnection.ConnectionManager(section) },
     new object[] { (IConnectionManager)SqlConnection.ConnectionManager(section) },
     new object[] { (IConnectionManager)PostgresConnection.ConnectionManager(section) },
     new object[] { (IConnectionManager)MySqlConnection.ConnectionManager(section) },
 };
Beispiel #4
0
 public static IEnumerable <object[]> AllSqlConnectionsWithValue(string section, int value) => new[] {
     new object[] { (IConnectionManager)MariaDbConnection.ConnectionManager(section), value },
     new object[] { (IConnectionManager)OracleConnection.ConnectionManager(section), value },
     new object[] { (IConnectionManager)SqlConnection.ConnectionManager(section), value },
     new object[] { (IConnectionManager)PostgresConnection.ConnectionManager(section), value },
     new object[] { (IConnectionManager)MySqlConnection.ConnectionManager(section), value },
     new object[] { (IConnectionManager)SQLiteConnection.ConnectionManager(section), value }
 };
Beispiel #5
0
        void DeleteUserInfo(UserInfo contact)
        {
            MySqlDataReader Reader;
            MySqlCommand    command = MariaDbConnection.CreateCommand();

            string sql = string.Format("delete from AMR_MST06 where MST06AID = '{0}'", contact.Id);


            command.CommandText = sql;

            Reader = command.ExecuteReader();
            Reader.Close();
        }