コード例 #1
0
        private void BiletGoruntuleme_Load(object sender, EventArgs e)
        {
            int f = frmTcdd.biletbas.Count();
            
            int i = 0; 
            foreach (BiletBas x in frmTcdd.biletbas)
            {         
                i++;
                if(i == 1)
                    this.Size = new System.Drawing.Size(590, 240);
                else if (i == 2)
                    this.Size = new System.Drawing.Size(1155, 240);
                else if (i == 3)
                    this.Size = new System.Drawing.Size(1155, 434);
                else if (i > 4)
                {
                    frmTcdd.biletbas.RemoveAt(1);
                    frmTcdd.biletbas.RemoveAt(2);
                    frmTcdd.biletbas.RemoveAt(3);
                    frmTcdd.biletbas.RemoveAt(4);
                    BiletGoruntuleme BiletGoruntuleDevam = new BiletGoruntuleme();
                    BiletGoruntuleDevam.Text = "Bilet Görüntüleme (Sayfa 2)";
                    BiletGoruntuleDevam.Show();
                    break;
                }  
                Control c = new Control();
                c = this.Controls["bilet" + i];

                c.Controls["lblAd" + i].Text = x.AdSoyad;
                c.Controls["lblCikis" + i].Text = x.Cikis;
                c.Controls["lblVaris" + i].Text = x.Varis;
                c.Controls["lblTren" + i].Text = x.Tren;
                c.Controls["lblTarih" + i].Text = x.Tarih.ToShortDateString();
                c.Controls["lblSaat" + i].Text = x.Saat;
                c.Controls["lblKoltuk" + i].Text = x.KoltukNo.ToString();
                c.Controls["lblBiletNo" + i].Text = x.BiletNo;
                c.Controls["lblUcret" + i].Text = x.Ucret.ToString();
                c.Controls["lblTarife" + i].Text = x.Tarife;

                this.Controls["bilet" + i].Visible = true; 
            }

            if (f < 5)
                frmTcdd.biletbas.Clear();
        }
コード例 #2
0
        private void btnOdemeYap_Click(object sender, EventArgs e)
        {
            
            BiletGoruntuleme bg = new BiletGoruntuleme();
            bg.Text = "Bilet Görüntüleme (Sayfa 1)";
            bg.Show();
            if (rdNakit.Checked == true)
            {
                Nakit n = new Nakit(y1);
                MessageBox.Show(n.Ode());
            }
            else if (rdKrediKarti.Checked == true)
            {
                KrediKarti k = new KrediKarti(y1);
                MessageBox.Show(k.Ode());
            }
            for (int i = 1; i <= deger; i++)
            {
                Control c1 = grpYolcu.Controls["pnlTekYolcu" + i];
                c1.Controls["txtTc" + i].Text = "";
                c1.Controls["txtAd" + i].Text = "";
                c1.Controls["txtSoyad" + i].Text = "";

            }

            rdTekYon.Checked = true;
            cmbTekYolcu.SelectedIndex = 0;
            sonuc = 0;             
            grpSeyahat.Enabled = grpYolcu.Enabled = true;
            lblTutar.Text = 0.ToString("C2");
        }