C# form ile İstanbulkart uygulaması nasıl yapılır?

Toolbox’dan eklenecekler: 2 Groupbox, 13 Label, 2 NumericUpDown, 3 Panel, 8 Radiobutton, 1 Textbox, 1 Timer.

Form1 public partial class’ın altına yazılacak:

        double ogrenci = 0;
        double ogretmen = 0;
        double yasli = 0;
        double normal = 0;
        int ki;
        int hak = 2;
        int sayi = 1;

Button1_Click:

            double yb = Convert.ToDouble(numericUpDown1.Value);
            ki = Convert.ToInt16(textBox1.Text);
            if (ki == 1)
            {
                label4.Text = ogrenci.ToString();
                ogrenci += yb;
                label6.Text = ogrenci.ToString();
            }
            else if (ki == 2)
            {
                label4.Text = ogretmen.ToString();
                ogretmen += yb;
                label6.Text = ogretmen.ToString();
            }
            else if (ki == 3)
            {
                label4.Text = yasli.ToString();
                yasli += yb;
                label6.Text = yasli.ToString();
            }
            else if (ki == 4)
            {
                label4.Text = normal.ToString();
                normal += yb;
                label6.Text = normal.ToString();
            }

Form1_Load:

            label4.Text = null;
            label6.Text = null;
            label8.Text = null;
            label13.Text = null;
            panel3.Visible = false;

TextBox1_TextChanged:

            ki = Convert.ToInt16(textBox1.Text);
            if (ki == 1)
            {
                label6.Text = null;
                label8.Text = "Öğrenci";
                label4.Text = ogrenci.ToString();
            }
            else if (ki == 2)
            {
                label6.Text = null;
                label8.Text = "Öğretmen";
                label4.Text = ogretmen.ToString();
            }
            else if (ki == 3)
            {
                label6.Text = null;
                label8.Text = "Yaşlı";
                label4.Text = yasli.ToString();
            }
            else if (ki == 4)
            {
                label6.Text = null;
                label8.Text = "Normal";
                label4.Text = normal.ToString();
            }

RadioButton8_CheckedChanged:

            panel3.Visible = true;

RadioButton7_CheckedChanged:

            panel3.Visible = false;

RadioButton6_CheckedChanged:

            panel3.Visible = false;

RadioButton5_CheckedChanged:

            panel3.Visible = false;

Button2_Click:

            if (hak != 1)
            {
                if (radioButton1.Checked && radioButton5.Checked)
                {
                    if (ogrenci > 1.8)
                    {
                        ogrenci -= 1.8;
                        label13.Text = ogrenci.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton1.Checked && radioButton6.Checked)
                {
                    if (ogrenci > 2)
                    {
                        ogrenci -= 2;
                        label13.Text = ogrenci.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton1.Checked && radioButton7.Checked)
                {
                    if (ogrenci > 2.1)
                    {
                        ogrenci -= 2.1;
                        label13.Text = ogrenci.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton1.Checked && radioButton8.Checked)
                {
                    if (ogrenci > 2.1)
                    {
                        ogrenci -= 2.1;
                        label13.Text = ogrenci.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton5.Checked)
                {
                    if (ogretmen > 2.1)
                    {
                        ogretmen -= 2.1;
                        label13.Text = ogretmen.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton6.Checked)
                {
                    if (ogretmen > 2.5)
                    {
                        ogretmen -= 2.5;
                        label13.Text = ogretmen.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton7.Checked)
                {
                    if (ogretmen > 2.6)
                    {
                        ogretmen -= 2.6;
                        label13.Text = ogretmen.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton8.Checked)
                {
                    if (ogretmen > 2.6)
                    {
                        ogretmen -= 2.6;
                        label13.Text = ogretmen.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton3.Checked && radioButton5.Checked)
                {

                }
                if (radioButton3.Checked && radioButton6.Checked)
                {
                    if (yasli > 1)
                    {
                        yasli -= 1;
                        label13.Text = yasli.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton3.Checked && radioButton7.Checked)
                {
                    if (yasli > 1.5)
                    {
                        yasli -= 1.5;
                        label13.Text = yasli.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton3.Checked && radioButton8.Checked)
                {
                    if (yasli > 1.5)
                    {
                        yasli -= 1.5;
                        label13.Text = yasli.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton5.Checked)
                {
                    if (normal > 2.3)
                    {
                        normal -= 2.3;
                        label13.Text = normal.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton6.Checked)
                {
                    if (normal > 2.6)
                    {
                        normal -= 2.6;
                        label13.Text = normal.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton7.Checked)
                {
                    if (normal > 3)
                    {
                        normal -= 3;
                        label13.Text = normal.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton8.Checked)
                {
                    if (normal > 3)
                    {
                        normal -= 3;
                        label13.Text = normal.ToString();
                        hak--;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
            }
            else if (hak == 1)
            {
                if (radioButton1.Checked && radioButton5.Checked)
                {
                    if (ogrenci > 0.9)
                    {
                        ogrenci -= 0.9;
                        label13.Text = ogrenci.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton1.Checked && radioButton6.Checked)
                {
                    if (ogrenci > 1)
                    {
                        ogrenci -= 1;
                        label13.Text = ogrenci.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton1.Checked && radioButton7.Checked)
                {
                    if (ogrenci > 1.05)
                    {
                        ogrenci -= 1.05;
                        label13.Text = ogrenci.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton1.Checked && radioButton8.Checked)
                {
                    if (ogrenci > 1.05)
                    {
                        ogrenci -= 1.05;
                        label13.Text = ogrenci.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton5.Checked)
                {
                    if (ogretmen > 1.05)
                    {
                        ogretmen -= 1.05;
                        label13.Text = ogretmen.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton6.Checked)
                {
                    if (ogretmen > 1.25)
                    {
                        ogretmen -= 1.25;
                        label13.Text = ogretmen.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton7.Checked)
                {
                    if (ogretmen > 1.3)
                    {
                        ogretmen -= 1.3;
                        label13.Text = ogretmen.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton2.Checked && radioButton8.Checked)
                {
                    if (ogretmen > 1.3)
                    {
                        ogretmen -= 1.3;
                        label13.Text = ogretmen.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton3.Checked && radioButton5.Checked)
                {

                }
                if (radioButton3.Checked && radioButton6.Checked)
                {
                    if (yasli > 0.5)
                    {
                        yasli -= 0.5;
                        label13.Text = yasli.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton3.Checked && radioButton7.Checked)
                {
                    if (yasli > 0.75)
                    {
                        yasli -= 0.75;
                        label13.Text = yasli.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton3.Checked && radioButton8.Checked)
                {
                    if (yasli > 0.75)
                    {
                        yasli -= 0.75;
                        label13.Text = yasli.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton5.Checked)
                {
                    if (normal > 1.15)
                    {
                        normal -= 1.15;
                        label13.Text = normal.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton6.Checked)
                {
                    if (normal > 1.3)
                    {
                        normal -= 1.3;
                        label13.Text = normal.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton7.Checked)
                {
                    if (normal > 1.5)
                    {
                        normal -= 1.5;
                        label13.Text = normal.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
                if (radioButton4.Checked && radioButton8.Checked)
                {
                    if (normal > 1.5)
                    {
                        normal -= 1.5;
                        label13.Text = normal.ToString();
                        hak++;
                        timer1.Interval = 1000;
                        timer1.Start();
                    }
                    else
                    {
                        MessageBox.Show("Yetersiz Bakiye!", "Uyarı");
                    }
                }
            }

Timer1_Tick:

            if (sayi < 10)
            {
                label11.Text = "0" + sayi.ToString();
            }
            else
            {
                label11.Text = sayi.ToString();
            }
            if (sayi == 60)
            {
                label10.Text = "01 :";
                label11.Text = "00";
                timer1.Stop();
                hak = 2;
                MessageBox.Show("Aktarma Süreniz Doldu", "Uyarı");
            }
            sayi++;

RadioButton1_CheckedChanged:

            label13.Text = ogrenci.ToString();

RadioButton2_CheckedChanged:

            label13.Text = ogretmen.ToString();

RadioButton3_CheckedChanged:

            label13.Text = yasli.ToString();

RadioButton4_CheckedChanged:

            label13.Text = normal.ToString();

Button3_Click:

            double iade;
            int durak = Convert.ToInt32(numericUpDown2.Value);
            if (durak > 0 && durak < 11)
            {
                if (radioButton1.Checked)
                {
                    iade = 1.8 * 0.10;
                    ogrenci = iade + ogrenci;
                    label13.Text = ogrenci.ToString();
                }
                if (radioButton2.Checked)
                {
                    iade = 2.1 * 0.10;
                    ogretmen = iade + ogretmen;
                    label13.Text = ogretmen.ToString();
                }
                if (radioButton3.Checked)
                {
                    iade = 2.1 * 0.10;
                    yasli = iade + yasli;
                    label13.Text = yasli.ToString();
                }
                if (radioButton4.Checked)
                {
                    iade = 2.1 * 0.10;
                    normal = iade + normal;
                    label13.Text = normal.ToString();
                }
            }
            if (durak > 10 && durak < 21)
            {
                if (radioButton1.Checked)
                {
                    iade = 1.8 * 0.05;
                    ogrenci = iade + ogrenci;
                    label13.Text = ogrenci.ToString();
                }
                if (radioButton2.Checked)
                {
                    iade = 2.1 * 0.05;
                    ogretmen = iade + ogretmen;
                    label13.Text = ogretmen.ToString();
                }
                if (radioButton3.Checked)
                {
                    iade = 2.1 * 0.05;
                    yasli = iade + yasli;
                    label13.Text = yasli.ToString();
                }
                if (radioButton4.Checked)
                {
                    iade = 2.1 * 0.05;
                    normal = iade + normal;
                    label13.Text = normal.ToString();
                }
            }
            if (durak > 20)
            {
                MessageBox.Show("İade Yok");
            }

Çıktısı:

Bu alana reklam verebilirsiniz!