public bool InsertRezMusteri(RezervasyondakiMusteri rezervasyondakiMusteri)
 {
     try
     {
         rezervasyondakiMusteriManagement.InsertRezMusteriler(rezervasyondakiMusteri);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
        //SqlDataReader rdr;
        public bool InsertRezMusteriler(RezervasyondakiMusteri yeniMusteri)
        {
            try
            {
                cmd = new SqlCommand("insert into RezervasyondakiMusteriler(RezervasyonId,MusteriId) values (@RezervasyonId,@MusteriId)", conn);

                cmd.Parameters.AddWithValue("@RezervasyonId", yeniMusteri.RezervasyonId);
                cmd.Parameters.AddWithValue("@MusteriId", yeniMusteri.MusteriId);

                conn.Open();
                cmd.ExecuteNonQuery();
                conn.Close();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
        private void btnRezervasyonuTamamla_Click(object sender, EventArgs e)
        {
            foreach (Musteri item in kalacakMusteriler)
            {
                if (musteriController.IsThereMusteri(item.TcNo))
                {
                    Musteri sonEklenen = musteriController.GetMusteriByTc(item.TcNo);
                    sonEklenenMusteriler.Add(sonEklenen);
                    continue;
                }
                else
                {
                    bool musteriklendiMi = musteriController.AddYanMusteri(item);
                    if (musteriklendiMi)
                    {
                        Musteri sonEklenen = musteriController.GetMusteriByTc(item.TcNo);
                        sonEklenenMusteriler.Add(sonEklenen);
                    }
                    else
                    {
                        MessageBox.Show("mus eklenemedi!");
                        return;
                    }
                }
            }
            bool rezEklendiMi = rezervasyonController.InsertRez(_rezervasyon);

            if (!rezEklendiMi)
            {
                MessageBox.Show("rez eklenemedi!");
                return;
            }
            sonEklenenMusteriler.Add(_musteri);
            RezervasyondakiMusteri rezervasyondakiMusteri;

            foreach (Musteri item in sonEklenenMusteriler)
            {
                rezervasyondakiMusteri = new RezervasyondakiMusteri()
                {
                    RezervasyonId = rezervasyonController.LastRezId(),
                    MusteriId     = item.Id
                };
                bool rzmsEklediMi = rezervasyondakiMusterilerController.InsertRezMusteri(rezervasyondakiMusteri);
            }
            if (_musteri.Mail != null)
            {
                string icerik = string.Format($"({_rezervasyon.GirisTarihi.ToShortDateString()}) Giriş tarihli ve({ _rezervasyon.CikisTarihi.ToShortDateString()}) Çıkış tarihli rezervasyonunuz tamamlanmıştır. \nRezervasyon numaranız:{rezervasyonController.LastRezId()}  \nÖdeme türü:{(rbNakit.Checked ? "Nakit" : "Kredi Kartı")} \nTutar:{_topTutar.ToString()}");
                Helper.Gonder("Bilge Adam Otel", icerik, _musteri.Mail);
            }
            Fatura fatura = new Fatura()
            {
                MusteriId     = _musteri.Id,
                RezervasyonId = rezervasyonController.LastRezId(),
                ToplamTutar   = _topTutar,
                NakitMi       = (rbNakit.Checked ? true : false)
            };

            if (faturaController.InsertFatura(fatura))
            {
                MessageBox.Show("fatura ekleme başarılı");
            }
            else
            {
                MessageBox.Show("fatura ekleme başarısız");
            }

            frmOdaSecimi frm = new frmOdaSecimi(_musteri);

            this.Hide();
            frm.ShowDialog();
            this.Close();
        }