private void btn_Gonder_Click(object sender, EventArgs e)
        {
            if (grp_Puan.Visible && grp_Yorum.Visible)
            {
                musteriIslemleri = new MusteriIslemleri();
                Yorumcu yorumcu = new Yorumcu();

                yorumcu.tamAdi            = txt_İsimSoyisim.Text;
                yorumcu.yorum             = txt_Yorum.Text;
                yorumcu.konakladigiOtelID = musteri.konakladigiOtelID;
                yorumcu.ePosta            = txt_EPosta.Text;
                yorumcu.tcKimlikNo        = musteri.tcKimlikNo;

                musteriIslemleri.OtelePuanVer(int.Parse(cmb_Puan.Text), otel);

                musteriIslemleri.OteleYorumYap(yorumcu, otel);

                musteriRepository.MusteriSil(musteri);
            }

            else if (grp_Puan.Visible && !grp_Yorum.Visible)
            {
                musteriIslemleri = new MusteriIslemleri();

                musteriIslemleri.OtelePuanVer(int.Parse(cmb_Puan.Text), otel);

                musteriRepository.MusteriSil(musteri);
            }

            else
            {
                musteriIslemleri = new MusteriIslemleri();
                Yorumcu yorumcu = new Yorumcu();

                yorumcu.tamAdi            = txt_İsimSoyisim.Text;
                yorumcu.yorum             = txt_Yorum.Text;
                yorumcu.konakladigiOtelID = musteri.konakladigiOtelID;
                yorumcu.ePosta            = txt_EPosta.Text;
                yorumcu.tcKimlikNo        = musteri.tcKimlikNo;

                musteriIslemleri.OteleYorumYap(yorumcu, otel);

                musteriRepository.MusteriSil(musteri);
            }

            this.Close();
        }
示例#2
0
        public void YorumEkle(Yorumcu yorumYapan)
        {
            //Eski sonuncu node, Head'den başlanarak set ediliyor
            YorumcuDugumu oldLast = head;


            if (head == null)
            {
                YorumcuDugumu tmpHead = new YorumcuDugumu
                {
                    yorumcuBilgisi = yorumYapan
                };

                head = tmpHead;
            }
            else
            {
                //Yeni sonuncu node yaratılıyor
                YorumcuDugumu newLast = new YorumcuDugumu
                {
                    yorumcuBilgisi = yorumYapan
                };

                //Eski sonuncu node bulunuyor
                //Tail olsaydı sonuncuyu bulmaya gerek yoktu.
                while (oldLast != null)
                {
                    if (oldLast.sonraki != null)
                    {
                        oldLast = oldLast.sonraki;
                    }
                    else
                    {
                        break;
                    }
                }

                //Eski sonuncu node referansı artık yeni sonuncu node'u gösteriyor
                oldLast.sonraki = newLast;

                //Bağlı listedeki eleman sayısı bir arttı
                size++;
            }
        }
        public void OteleYorumYap(Yorumcu yorumYapan, Otel otel)
        {
            otel.yorumcu.YorumEkle(yorumYapan);

            yorumcuRepository.YorumEkle(yorumYapan);
        }