Exemple #1
0
        private void btn_Click(object sender, EventArgs e)
        {
            Button b = sender as Button;

            koltuknotemp = Convert.ToInt32(b.Text);
            //1.Ad soyad ilk sec
            //2.koltuk seç
            if (b.BackColor == Color.Red) // Dolu, silme işlemi yap
            {
                //silme işleminde sorun var

                // MessageBox.Show("Silindi");
                b.BackColor = Color.Lime;
                biletler.DeletePos(koltuknotemp);
            }
            else // Boş, ekleme yap
            {
                //MessageBox.Show("Eklendi");
                b.BackColor = Color.Red;
                Bilet bilet = new Bilet();
                bilet.musteri       = new Musteri(txtAd.Text, txtSoyad.Text);
                bilet.SecilenKoltuk = koltuknotemp;
                biletler.InsertPos(koltuknotemp, bilet);
            }
        }
        public override void InsertPos(int position, Bilet value)
        {
            Node temp = new Node {
                Data = value
            };
            Node current = Head;


            if (current != null)
            {
                for (int i = 0; i < position && current.Next != null; i++)
                {
                    current = current.Next;
                }

                temp.Next    = current.Next;
                current.Next = temp;
            }
            else
            {
                Head = temp;
            }

            Size++;
        }
 public abstract void InsertPos(int position, Bilet value);