예제 #1
0
        private void bettorComboBox_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            bettor selectedbettor = (bettor)bettorComboBox.SelectedItem;
            int    balance        = selectedbettor.balance;

            betterBalLabel.Text = Convert.ToString(balance);
        }
예제 #2
0
        private void gokkerAddButton_Click(object sender, EventArgs e)
        {
            if (gokkerNameTextBox.Text == "")
            {
                MessageBox.Show("Vul Aub een naam in.");
            }
            else
            {
                bettor newbettor = new bettor();
                newbettor.name    = gokkerNameTextBox.Text;
                newbettor.balance = 100;

                this.Result = newbettor;
                this.Close();
            }
        }
예제 #3
0
        public List <bettor> Load()  //Bron: Docent tim: File: UsingObjects// :) Natuurlijk aan gepast naar mijn wensen
        {
            List <bettor> result = new List <bettor>();

            if (!Directory.Exists(LOCATION))
            {
                return(result);
            }
            foreach (string fileName in Directory.EnumerateFiles(LOCATION))
            {
                string fileContent = File.ReadAllText(fileName);

                bettor loadedBettor = new bettor();

                string[] contentLines = fileContent.Split('\n');

                loadedBettor.name = contentLines[0];

                loadedBettor.balance = Convert.ToInt32(contentLines[1]);

                result.Add(loadedBettor);
            }
            return(result);
        }
예제 #4
0
 // niet vergeten.
 public void addBettor(bettor newbettor)
 {
     this.bettors.Add(newbettor);
 }