private void RefreshTeamList() { PlayerListBox.Items.Clear(); TeamCmd.CommandText = "SELECT Player FROM PlayerList"; reader = TeamCmd.ExecuteReader(); while (reader.Read()) { PlayerListBox.Items.Add(reader["Player"].ToString()); } reader.Close(); }
private void AddTeamRecord(string obj) { TeamCmd.CommandText = "SELECT COUNT(Player) FROM PlayerList WHERE Player = '" + obj + "'"; long i = (long)TeamCmd.ExecuteScalar(); if (i == 0) { TeamCmd.CommandText = "INSERT INTO PlayerList (Player) VALUES ('" + obj + "')"; TeamCmd.ExecuteNonQuery(); PlayerListBox.Items.Add(AdderTextBox.Text); AdderTextBox.Text = ""; } else { MessageBox.Show("既に追加されているプレイヤーです。"); } }
//接続 private void ConnectDB() { if (System.IO.File.Exists(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\\GalaxySoftware\\wcatManager\\DataLists\\PlayerList.db")) { TeamCon = new SQLiteConnection(TeamDBPath); TeamCon.Open(); TeamCmd = TeamCon.CreateCommand(); } else { TeamCon = new SQLiteConnection(TeamDBPath); TeamCon.Open(); TeamCmd = TeamCon.CreateCommand(); TeamCmd.CommandText = "CREATE TABLE PlayerList (id integer primary key, Player varchar)"; TeamCmd.ExecuteNonQuery(); } if (System.IO.File.Exists(System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\\GalaxySoftware\\wcatManager\\DataLists\\CustomList.db")) { CustomCon = new SQLiteConnection(CustomDBPath); CustomCon.Open(); CustomCmd = CustomCon.CreateCommand(); } else { CustomCon = new SQLiteConnection(CustomDBPath); CustomCon.Open(); CustomCmd = CustomCon.CreateCommand(); CustomCmd.CommandText = "CREATE TABLE CustomList (id integer primary key, Item varchar)"; CustomCmd.ExecuteNonQuery(); } BindCon = new SQLiteConnection("Data Source=" + @"DataLists\\SpecifiedBindList.db"); BindCon.Open(); BindCmd = BindCon.CreateCommand(); JobCon = new SQLiteConnection("Data Source=" + @"DataLists\\JobList.db"); JobCon.Open(); JobCmd = JobCon.CreateCommand(); TypeCon = new SQLiteConnection("Data Source=" + @"DataLists\\TypeList.db"); TypeCon.Open(); TypeCmd = TypeCon.CreateCommand(); MapCon = new SQLiteConnection("Data Source=" + @"DataLists\\MapList.db"); MapCon.Open(); MapCmd = MapCon.CreateCommand(); }
private void RemoveTeamRecord(string obj) { TeamCmd.CommandText = "DELETE FROM PlayerList WHERE Player = '" + obj + "'"; TeamCmd.ExecuteNonQuery(); RefreshTeamList(); }
internal static void Send <T>(TeamCmd joinUserTeam, object onJoinTeamBy) { throw new NotImplementedException(); }
internal static void Send <T>(TeamCmd joinUserTeam, Action <GameObject> onJoinTeam) { throw new NotImplementedException(); }