Exemple #1
0
        private void buttonAddKr_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(textBoxAmountKr.Text) > 1 && Convert.ToInt32(textBoxPercentKr.Text) > 0)
            {
                int    num    = this.account.GetKredits().Count;
                Kredit kredit = new Kredit(Convert.ToInt32(textBoxAmountKr.Text), Convert.ToInt32(textBoxPercentKr.Text), textBoxCurrencyKr.Text, num);
                this.account.AddKredit(kredit);
                listBoxKr.Items.Clear();
                foreach (Offer kr in this.account.GetKredits())
                {
                    listBoxKr.Items.Add(kr.Show());
                }


                _settings.amountKr   = textBoxAmountKr.Text;
                _settings.currencyKr = textBoxCurrencyKr.Text;
                _settings.percentKr  = textBoxPercentKr.Text;

                _settings.Save();
            }
            else
            {
                MessageBox.Show("Try to fill all fields correctly");
            }
        }
Exemple #2
0
 internal void AddKredit(Kredit kred)
 {
     kredits.Add(kred);
 }