private void button__ara_Click(object sender, EventArgs e)
        {
            Musteriler musteri = null;

            try
            {
                int musteriID = Convert.ToInt32(textBox_ID.Text);
                musteri = ctx.Musterilers.Where(m => m.ID == musteriID).Select(m => m).Single();
                Form_musteriKayitAl musteriKaydi = new Form_musteriKayitAl(musteri);
                foreach (Form item in this.MdiParent.MdiChildren)
                {
                    if (item.Text == musteriKaydi.Text)
                    {
                        item.Close();
                        musteriKaydi.MdiParent = this.MdiParent;
                        musteriKaydi.Show();
                        this.Close();
                        return;
                    }
                }

                musteriKaydi.MdiParent = this.MdiParent;
                musteriKaydi.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                Form_ana_ekran.HataKaydi(ex);
                toolStripStatusLabel_bilgi.Text = "Aranan müşteri bulunamadı";
            }
        }
Ejemplo n.º 2
0
        private void musteriKayitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form_musteriKayitAl musteri_kaydet = new Form_musteriKayitAl();

            if (Form_musteriKayitAl.form_acik_mi)
            {
                foreach (Form item in this.MdiChildren)
                {
                    if (item.Text == musteri_kaydet.Text)
                    {
                        item.BringToFront();
                        return;
                    }
                }
            }

            musteri_kaydet.MdiParent = this;
            musteri_kaydet.Show();
        }