示例#1
0
        private void buttonSaCreateOfficer_Click(object sender, EventArgs e)
        {
            if (comboSaOfficers.SelectedItem == null)
            {
                return;
            }
            CrewOfficerType ofType = (CrewOfficerType)comboSaOfficers.SelectedItem;
            //int playerId = DataConnection.GetResultInt("SELECT MAX(id) AS Result FROM [admirals]");
            int         playerId   = PlayerDataSql.GetTestPlayerData().Id;
            CrewOfficer newOfficer = new CrewOfficer(ofType, playerId);

            listSaOfficers.Items.Add(newOfficer);
        }
示例#2
0
        private void FillPlayersOfficers()
        {
            PlayerData pData = PlayerDataSql.GetTestPlayerData();

            listSaOfficers.Items.Clear();
            List <CrewOfficer> officers = CrewOfficer.OfficersForPlayer(pData.Id);

            if (officers.Count > 0)
            {
                foreach (CrewOfficer off in officers)
                {
                    listSaOfficers.Items.Add(off);
                }
            }
        }