예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var durum = string.IsNullOrEmpty(textBox1.Text) ||
                        string.IsNullOrWhiteSpace(textBox2.Text) ||
                        string.IsNullOrWhiteSpace(textBox3.Text) ||
                        string.IsNullOrWhiteSpace(textBox4.Text) ||
                        string.IsNullOrWhiteSpace(textBox5.Text) ||
                        string.IsNullOrWhiteSpace(textBox6.Text) ||
                        comboBox1.SelectedIndex == -1 ||
                        comboBox2.SelectedIndex == -1;

            if (durum)
            {
                MessageBox.Show("Tüm Alanları Doldurun !");
            }
            else
            {
                if (textBox1.Text.Length < 11)
                {
                    MessageBox.Show("Geçerli Bir TC Giriniz !");
                }
                else
                {
                    AbonelerModel ab = new AbonelerModel();
                    ab.AbonelikDurumu = Convert.ToBoolean(comboBox2.SelectedIndex);
                    ab.AboneID        = musteriID;
                    ab.TC             = textBox1.Text;
                    ab.Ad             = textBox2.Text;
                    ab.Soyad          = textBox3.Text;
                    ab.Telefon        = textBox4.Text;
                    ab.Email          = textBox5.Text;
                    ab.PlakaNo        = textBox6.Text;
                    ab.AracTipiID     = (comboBox1.SelectedIndex + 1);

                    Aboneler k = new Aboneler();

                    k.AbonelikDurumu = ab.AbonelikDurumu;
                    k.AboneID        = ab.AboneID;
                    k.TC             = ab.TC;
                    k.Ad             = ab.Ad;
                    k.Soyad          = ab.Soyad;
                    k.Telefon        = ab.Telefon;
                    k.Email          = ab.Email;
                    k.PlakaNo        = ab.PlakaNo;
                    k.AracTipiID     = ab.AracTipiID;
                    AboneİslemHelper.MusteriAptade(k);
                    MusteriKayıt mk = new MusteriKayıt();
                    mk.Refresh();
                    Hide();
                }
            }
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            MusteriKayıt musteriKayıt = new MusteriKayıt();

            musteriKayıt.ShowDialog();
        }