Example #1
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_emlakOzellikTur.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable dtKelimeVarmi = vt.Select("select * from emlakOzellikTur where emlakOzellikAd = '" + txt_emlakOzellikTur.Text + "'");

            if (dtKelimeVarmi.Rows.Count > 0)
            {
                MessageBox.Show("Bu emlak özellik tür bilgileri eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult dr = MessageBox.Show("Yeni Emlak Özellik Türü Eklemek İstiyomusun?", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int kayit_id = vt.Insert("INSERT INTO emlakOzellikTur(emlakOzellikAd) VALUES ('" + txt_emlakOzellikTur.Text + "')");

                if (kayit_id > 0)
                {
                    emlakOzellikTur();
                    MessageBox.Show("Emlak Özellik Türü  Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Emlak Özellik Türü  Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Emlak Özellik Türü Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #2
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_ad.Text == "" || txt_telefon.Text == "" || txt_il.Text == "" || txt_ilce.Text == "" || txt_mahalle.Text == "" || txt_cadde.Text == "" || txt_sokak.Text == "" || txt_kapiNo.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (txt_telefon.Text == "")
            {
                MessageBox.Show("Telefon Numarasını Lütfen 11 karakter giriniz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable k = vt.Select("select * from ofis where ofisTelefon = '" + txt_telefon.Text + "'");

            if (k.Rows.Count > 0)
            {
                MessageBox.Show("Bu telefon bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable adresv = vt.Select("select * from adres where il = '" + txt_il.Text + " 'AND ilce= '" + txt_ilce.Text + "' and mahalle ='" + txt_mahalle.Text + "' and sokak ='" + txt_sokak.Text + "' and cadde ='" + txt_cadde.Text + "' and kapiNo ='" + txt_kapiNo.Text + "'");

            if (adresv.Rows.Count > 0)
            {
                MessageBox.Show("Bu adres bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult dr = MessageBox.Show("Yeni Ofis eklemek istiyomusun?", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int adres_id = vt.Insert(@"insert into adres(il,ilce,mahalle,cadde,sokak,kapiNo)
                                            values ('" + txt_il.Text + "','" + txt_ilce.Text + "','" + txt_mahalle.Text + "','" + txt_cadde.Text + "','" + txt_sokak.Text + "'," + txt_kapiNo.Text + ")");
                MessageBox.Show(adres_id.ToString(), "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (adres_id > 0)
                {
                    int kayit_id = vt.Insert("INSERT INTO ofis(ofisAd,ofisTelefon,adres_id) VALUES ('" + txt_ad.Text + "','" + txt_telefon.Text + "','" + adres_id + "')");

                    if (kayit_id > 0)
                    {
                        Ofis_Load(null, null);
                        MessageBox.Show("Ofis  Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Ofis  Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Adres bilgileri eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Ofis  Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #3
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (cmb_durum.SelectedIndex == -1 || cmb_mulkSahibi.SelectedIndex == -1 || cmb_emlakTur.SelectedIndex == -1)
            {
                MessageBox.Show("Seçim Yapınız.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (txt_fiyat.Text == "" || txt_slogan.Text == "" || txt_il.Text == "" || txt_ilce.Text == "" || txt_mahalle.Text == "" || txt_cadde.Text == "" || txt_sokak.Text == "" || txt_kapiNo.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable adresv = vt.Select("select * from adres where il = '" + txt_il.Text + " 'AND ilce= '" + txt_ilce.Text + "' and mahalle ='" + txt_mahalle.Text + "' and sokak ='" + txt_sokak.Text + "' and cadde ='" + txt_cadde.Text + "' and kapiNo ='" + txt_kapiNo.Text + "'");

            if (adresv.Rows.Count > 0)
            {
                MessageBox.Show("Bu adres bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult dr = MessageBox.Show("Yeni Emlak Eklemek İstiyomusun ?", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int adres_id = vt.Insert(@"insert into adres(il,ilce,mahalle,cadde,sokak,kapiNo)
                                            values ('" + txt_il.Text + "','" + txt_ilce.Text + "','" + txt_mahalle.Text + "','" + txt_cadde.Text + "','" + txt_sokak.Text + "'," + txt_kapiNo.Text + ")");
                MessageBox.Show(adres_id.ToString(), "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (adres_id > 0)
                {
                    int kayit_id = vt.Insert("INSERT INTO emlak(slogan,emlakDurum_id,mulkSahibi_id,adres_id,emlakTur_id,fiyat) VALUES ('" + txt_slogan.Text + "','" + cmb_durum.SelectedValue + "','" + cmb_mulkSahibi.SelectedValue + "','" + adres_id + "'," + cmb_emlakTur.SelectedValue + "," + txt_fiyat.Text + ")");

                    if (kayit_id > 0)
                    {
                        Emlak_Load(null, null);
                        MessageBox.Show("Emlak  Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Emlak  Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Adres bilgileri eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Emlak  Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #4
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            //Ürün Ekleme aşamasından önce hata kontrollerini yapıyoruz.

            if (tx_urunKod.Text == "")
            {
                MessageBox.Show("Boş kısımları doldurunuz.");
                return;
            }
            if (tx_urunAdi.Text == "" || tx_urunBilgi.Text == "")
            {
                MessageBox.Show("Boş kısımları doldurunuz.");
                return;
            }


            dgv_urunEklenen.DataSource = vt.Insert(@"insert into tbl_urunler(urunAdi,urunFiyat,urunBilgisi,urunKodu_id,urunKatagori_id,Stok)
                                    values('" + tx_urunAdi.Text + "','" + nud_fiyat.Value + "','" + tx_urunBilgi.Text + "','" + secili_id + "','" + cbx_urunKategori.SelectedValue + "','" + nud_stok.Value + "')");
            UrunEkleme_Load(null, null);
            MessageBox.Show("Ürün başarıyla eklendi.");
            // ***** Bu kısımda beklenmedik bir hatadan dolayı şu anda yorum içerisine aldık. Sonra tekrar Aktif Edicez!! *******
            //else {
            //    MessageBox.Show("Beklenmedik bir hata oluştu Lütfen Tekrar Deneyin!");
            //}
        }
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_acıklama.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (cmb_emlak.SelectedIndex == -1 || cmb_emlakOzellikTur.SelectedIndex == -1)
            {
                MessageBox.Show("Seçim Yapınız...", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult dr = MessageBox.Show("Yeni Emlak Özellik eklemek istiyomusun ?", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int kayit_id = vt.Insert("INSERT INTO emlakOzellik(emlak_id,emlakOzellikTur_id,aciklama) VALUES ('" + cmb_emlak.SelectedValue + "','" + cmb_emlakOzellikTur.SelectedValue + "','" + txt_acıklama.Text + "')");

                if (kayit_id > 0)
                {
                    emlakOzellikGridYukle();
                    // Emlak_Özellik_Load(null, null);
                    MessageBox.Show("Emlak Özellik Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("Emlak Özellik Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Emlak Özellik Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            //Sorgu aşaması
            // Eğer boş ise eklemesini engelleyen Kod!
            if (tx_urunKod.Text == "")
            {
                MessageBox.Show("Bu alan boş bırakılamaz!");
                return;
            }
            //Ürün kodu var ise eklemeyi engelleyen kodu.
            DataTable dtSonuc = vt.Select("select * from tbl_urunKodu where urunKodu='" + tx_urunKod.Text + "'");

            if (dtSonuc.Rows.Count > 0)
            {
                MessageBox.Show("Böyle bir ürün kodu zaten var! Lütfen tekrar deneyiniz.");
                return;
            }

            //Ürün Kodu Ekleme Aşaması

            int kodEkle = Convert.ToInt32(vt.Insert(@"insert into tbl_urunKodu(urunKodu)
				             values('"                 + tx_urunKod.Text + "')"));

            // Ekleme işlemi gerçekleşti ise mesaj veriyoruz.

            if (kodEkle > 0)
            {
                MessageBox.Show("Kayıt başarılı bir şekilde eklendi.");
            }
        }
Example #7
0
        private void G2_Click(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            dizi[koltuksay] = btn.Name;
            if (btn.BackColor == Color.Brown)
            {
                btn.BackColor = Color.PaleGreen;

                tx_koltuk.Text = "";//tekrarı engelle

                foreach (Button b in groupBox1.Controls)
                {
                    if (b.BackColor == Color.Brown)
                    {
                        tx_koltuk.Text += b.Name + ";";

                        //lst_koltuk.Items.Remove(dizi[koltuksay]);//sill
                    }
                }
            }
            else
            {
                btn.BackColor = Color.Brown;

                tx_koltuk.Text += btn.Name.ToString() + "-";


                int sayi = vt.Insert(@"insert into tbl_koltuk(koltuk_ad)values('" + btn.Name.ToString() + "')");
                // tx_koltuk.Items.Add(dizi[koltuksay]);
            }
            koltuksay++;
        }
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (cmb_personel.SelectedIndex == -1 || cmb_müşteri.SelectedIndex == -1 || cmb_emlak.SelectedIndex == -1)
            {
                MessageBox.Show("şeçim yapınız.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (txt_fiyat.Text == "" || dtp_tarih.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            int sayı = Convert.ToInt32(txt_fiyat.Text);

            if (sayı >= 300 && sayı <= 1000000)
            {
                DialogResult dr = MessageBox.Show("Emlak İşlemleri Eklemek istiyomusun", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (dr == DialogResult.Yes)
                {
                    int kayit_id = vt.Insert("INSERT INTO emlakİslemleri(emlak_id,musteri_id,personel_id,fiyat,tarih) VALUES ('" + cmb_emlak.SelectedValue + "','" + cmb_müşteri.SelectedValue + "','" + cmb_personel.SelectedValue + "','" + txt_fiyat.Text + "','" + dtp_tarih.Text + "')");
                    if (kayit_id > 0)
                    {
                        DataTable emlakDur       = vt.Select("select emlakDurum_id from emlak where emlak_id =" + cmb_emlak.SelectedValue);
                        int       emlakDurum_idd = (int)emlakDur.Rows[0][0];

                        int ks = vt.UpdateDelete("update emlak set emlakDurum_id =" + (emlakDurum_idd + 3) + " where emlak_id=" + cmb_emlak.SelectedValue);
                        Emlak_Satış_Load(null, null);
                        dgv_emlakOzellik.DataSource = null;

                        MessageBox.Show("Emlak İşlemleri Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Emlak İşlemleri Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Emlak İşlemleri Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            else
            {
                MessageBox.Show("Lütfen fiyatı 300 TL ile 1000000 TL arasında giriniz", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #9
0
        private void bt_biletAl_Click(object sender, EventArgs e)
        {
            int ucret = 0;

            if (tx_biletAd.Text == "" || tx_biletSoyad.Text == "" || tx_biletKoltuk.Text == "")
            {
                MessageBox.Show("ad, soyad ve koltuk seçimi yapınız."); return;
            }

            //--------------seçili radio butona göre fiyat hesaplatma
            if (rb_ogrenci.Checked == true)
            {
                ucret = (lst_koltuk.Items.Count) * 5;
            }
            else if (rb_tam.Checked == true)
            {
                ucret = (lst_koltuk.Items.Count) * 10;
            }


            //--------------seans bilgilerine göre seans_idsini bulmak:
            DataTable dtseans  = vt.Select(@"select s.seans_id, s.seanssaat, s.seanstarih, f.film_id, sl.salon_id from tbl_seans s
                                JOIN tbl_filmler f ON f.film_id=s.film_id JOIN tbl_salon sl ON sl.salon_id= s.salon_id where 
                s.seanssaat='" + cb_biletSaat.Text + "' and s.seanstarih='" + cb_biletTarih.Text + "' and f.film_id=" + cb_biletFilm.SelectedValue + @" 
                             and sl.salon_id =" + cb_biletSalon.SelectedValue);
            int       seansTut = Convert.ToInt32(dtseans.Rows[0][0].ToString());

            //--------------tüm bilgilere göre koltukları kaydetmek :

            for (int i = 0; i < lst_koltuk.Items.Count; i++)
            {//koltuk adları listbox da ve bizim koltuk_id ye ihtiyacımız var
                DataTable dt = vt.Select("select koltuk_id from tbl_koltuk where koltuk_ad= '" + lst_koltuk.Items[i].ToString() + "'");
                cmb_koltuk_id.Items.Add(dt.Rows[0][0].ToString());

                int sayi = vt.Insert(@"insert into tbl_bilet (musteriAd,musteriSoyad,ucret,film_id,salon_id,seans_id,koltuk_id )
                                            values('" + tx_biletAd.Text + "','" + tx_biletSoyad.Text + "'," + ucret +
                                     "," + cb_biletFilm.SelectedValue + "," + cb_biletSalon.SelectedValue +
                                     "," + seansTut + "," + cmb_koltuk_id.Items[i].ToString() + ")");
                if (sayi < 1)
                {
                    MessageBox.Show("Bir Hata nedeniyle bilet alınamadı."); return;
                }
            }
        }
Example #10
0
        private void btn_sinemaEkle_Click(object sender, EventArgs e)
        {
            ep_hata.Clear();
            int hata = 0;

            if (tx_sinemaAd.Text == "")
            {
                ep_hata.SetError(tx_sinemaAd, "Sinema Adını Giriniz..");
                hata = 1;
                //return;
            }
            if (tx_il.Text == "")
            {
                ep_hata.SetError(tx_il, "Bulunduğu il'i Giriniz..");
                hata = 1;
                //return;
            }
            if (tx_ilce.Text == "")
            {
                ep_hata.SetError(tx_ilce, "Bulunduğu ilçe'yi Giriniz..");
                hata = 1;
                //return;
            }
            if (tx_mah.Text == "")
            {
                ep_hata.SetError(tx_mah, "Bulunduğu Mahalle'yi Giriniz..");
                hata = 1;
                //return;
            }
            if (tx_sok.Text == "")
            {
                ep_hata.SetError(tx_sok, "Bulunduğu Sokak Giriniz..");
                hata = 1;
                //return;
            }
            if (tx_no.Text == "")
            {
                ep_hata.SetError(tx_no, "Bulunduğu No Giriniz..");
                hata = 1;
                //return;
            }
            if (tx_tel.Text == "")
            {
                ep_hata.SetError(tx_tel, "Telefon Numarasını Giriniz..");
                hata = 1;
                //return;
            }
            if (hata == 1)
            {
                MessageBox.Show("Lütfen boş alanları doldurunuz!!");
                return;
            }
            else
            {
                int sayi = vt.Insert(@"INSERT INTO tbl_Sinema(sinema_ad,il,ilce,mah,sokak,no,telefon) 
VALUES('" + tx_sinemaAd.Text + "','" + tx_il.Text + "','" + tx_ilce.Text + "','" + tx_mah.Text + "','" + tx_sok.Text + "'," + tx_no.Text + ",'" + tx_tel.Text + "')");
                if (sayi > 0)
                {
                    adminPanel_Load(null, null);
                    MessageBox.Show("Kayıt Eklendi..");
                }
            }
            tx_sinemaAd.Text = "";
            tx_il.Text       = "";
            tx_ilce.Text     = "";
            tx_mah.Text      = "";
            tx_sok.Text      = "";
            tx_no.Text       = "";
            tx_tel.Text      = "";
        }
Example #11
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_ad.Text == "" || txt_soyad.Text == "" || txt_tcNo.Text == "" || txt_telefon.Text == "" || txt_il.Text == "" || txt_ilce.Text == "" || txt_mahalle.Text == "" || txt_cadde.Text == "" || txt_sokak.Text == "" || txt_kapiNo.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz...", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (cmb_ofis.SelectedIndex == -1)
            {
                MessageBox.Show("Ofis Seçimi Yapınız...", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            if (txt_telefon.Text.Length != 11 || txt_tcNo.Text.Length != 11)
            {
                MessageBox.Show("Lütfen 11 karakter giriniz...", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (rtbn_bay.Checked == false && rtbn_bayan.Checked == false)
            {
                MessageBox.Show("Cinsiyeti Seçiniz...", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable telefonvarmi = vt.Select("select * from personel where personelTelefon = '" + txt_telefon.Text + "'");

            if (telefonvarmi.Rows.Count > 0)
            {
                MessageBox.Show("Bu telefon bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable tcvarmı = vt.Select("select * from personel where personelTcNo = '" + txt_tcNo.Text + "'");

            if (tcvarmı.Rows.Count > 0)
            {
                MessageBox.Show("Bu tcNo bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable adresv = vt.Select("select * from adres where il = '" + txt_il.Text + " 'AND ilce= '" + txt_ilce.Text + "' and mahalle ='" + txt_mahalle.Text + "' and sokak ='" + txt_sokak.Text + "' and cadde ='" + txt_cadde.Text + "' and kapiNo ='" + txt_kapiNo.Text + "'");

            if (adresv.Rows.Count > 0)
            {
                MessageBox.Show("Bu adres bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult dr = MessageBox.Show("Yeni Personel eklemek istiyomusun ?", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int adres_id = vt.Insert(@"insert into adres(il,ilce,mahalle,cadde,sokak,kapiNo)
                                            values ('" + txt_il.Text + "','" + txt_ilce.Text + "','" + txt_mahalle.Text + "','" + txt_cadde.Text + "','" + txt_sokak.Text + "'," + txt_kapiNo.Text + ")");
                MessageBox.Show(adres_id.ToString(), "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (adres_id > 0)
                {
                    //decimal sifre = Convert.ToDecimal(txt_tcNo.Text);

                    int kayit_id = vt.Insert("INSERT INTO personel(personelAd,personelSoyad,personelTcNo,personelCinsiyet,personelTelefon,yöneticiMi,aktifMi,adres_id,ofis_id,sifre) VALUES ('" + txt_ad.Text + "','" + txt_soyad.Text + "'," + txt_tcNo.Text + ",'" + (rtbn_bayan.Checked == true ? "Bayan" : "Erkek") + "','" + txt_telefon.Text + "'," + (chb_yöneticiMi.Checked == true ? 1 : 0) + "," + (chb_aktifMi.Checked == true ? 1 : 0) + ",'" + adres_id + "'," + cmb_ofis.SelectedValue + ",'" + MD5Sifrele(txt_tcNo.Text) + "')");

                    if (kayit_id > 0)
                    {
                        Personel_Load(null, null);
                        MessageBox.Show("Personel  Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Personel  Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Adres bilgileri eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Personel  Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Example #12
0
        private void btn_ekle_Click(object sender, EventArgs e)
        {
            if (txt_ad.Text == "" || txt_soyad.Text == "" || txt_tcNo.Text == "" || txt_telefon.Text == "" || txt_il.Text == "" || txt_ilce.Text == "" || txt_mahalle.Text == "" || txt_cadde.Text == "" || txt_sokak.Text == "" || txt_kapiNo.Text == "")
            {
                MessageBox.Show("Boş Bırakmayınız Gerekli Alanları Doldurunuz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (txt_telefon.Text.Length != 11 || txt_tcNo.Text.Length != 11)
            {
                MessageBox.Show("Lütfen 11 karakter giriniz.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            if (rtbn_bay.Checked == false && rtbn_bayan.Checked == false)
            {
                MessageBox.Show("Cinsiyeti seçiniz...", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable telefonvarmi = vt.Select("select * from musteri where musteriTelefon = '" + txt_telefon.Text + "'");

            if (telefonvarmi.Rows.Count > 0)
            {
                MessageBox.Show("Bu telefon bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable ass = vt.Select("select * from musteri where musteriTcNo = '" + txt_tcNo.Text + "'");

            if (ass.Rows.Count > 0)
            {
                MessageBox.Show("Bu tcNo bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DataTable adresv = vt.Select("select * from adres where il = '" + txt_il.Text + " 'AND ilce= '" + txt_ilce.Text + "' and mahalle ='" + txt_mahalle.Text + "' and sokak ='" + txt_sokak.Text + "' and cadde ='" + txt_cadde.Text + "' and kapiNo ='" + txt_kapiNo.Text + "'");

            if (adresv.Rows.Count > 0)
            {
                MessageBox.Show("Bu adres bilgisi eklenmiş tekrar eklenemez !", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            DialogResult dr = MessageBox.Show("Yeni Müşteri Eklemek İstiyomusun ?", "Uyarı Mesajı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dr == DialogResult.Yes)
            {
                int adres_id = vt.Insert(@"insert into adres(il,ilce,mahalle,cadde,sokak,kapiNo)
                                            values ('" + txt_il.Text + "','" + txt_ilce.Text + "','" + txt_mahalle.Text + "','" + txt_cadde.Text + "','" + txt_sokak.Text + "'," + txt_kapiNo.Text + ")");
                MessageBox.Show(adres_id.ToString(), "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

                if (adres_id > 0)
                {
                    int kayit_id = vt.Insert("INSERT INTO musteri(musteriAd,musteriSoyad,musteriTcNo,cinsiyet,musteriTelefon,adres_id) VALUES ('" + txt_ad.Text + "','" + txt_soyad.Text + "'," + txt_tcNo.Text + ",'" + (rtbn_bayan.Checked == true ? "Bayan" : "Erkek") + "','" + txt_telefon.Text + "','" + adres_id + "')");

                    if (kayit_id > 0)
                    {
                        Müşteri_Load(null, null);
                        MessageBox.Show("Müşteri  Eklendi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        MessageBox.Show("Müşteri  Eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show("Adres bilgileri eklenemedi", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show("Müşteri  Ekleme işlemi iptal edildi.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }