Ejemplo n.º 1
0
        public static int SubeGuncelle(E_Sube sube)
        {
            int        donen = 0;
            SqlCommand komut = null;

            try
            {
                komut             = new SqlCommand("SP_SubeGuncelle", Baglanti.baglan);
                komut.CommandType = CommandType.StoredProcedure;
                komut.Connection.Open();
                komut.Parameters.AddWithValue("ID", sube.ID);
                komut.Parameters.AddWithValue("Eposta", sube.Eposta);
                komut.Parameters.AddWithValue("Sifre", sube.Sifre);
                komut.Parameters.AddWithValue("Ad", sube.Ad);
                komut.Parameters.AddWithValue("Sehir", sube.Sehir);
                komut.Parameters.AddWithValue("Ilce", sube.Ilce);
                komut.Parameters.AddWithValue("Semt", sube.Semt);
                komut.Parameters.AddWithValue("Telefon", sube.Telefon);
                komut.Parameters.AddWithValue("Adres", sube.Adres);

                donen = komut.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("Bir hata oluştu.Hata: " + e.ToString(), "Hata");
            }
            finally
            {
                komut.Connection.Close();
            }
            return(donen);
        }
Ejemplo n.º 2
0
        //-----------------------------------------------------------------------------------------

        // EKLEME/GÜNCELLEME SAYFASI İŞLEMLERİ

        private void SubeEkleButon_Click(object sender, EventArgs e) // ŞUBE EKLEME BUTONU
        {
            E_Sube sube = new E_Sube();

            sube.Eposta  = EkleEpostaTxtBox.Text;
            sube.Sifre   = EkleSifreTxtBox.Text;
            sube.Ad      = EkleAdTxtBox.Text;
            sube.Sehir   = SehirComboBox.Text.ToString();
            sube.Ilce    = EkleilceTxtBox.Text;
            sube.Semt    = EkleSemtTxtBox.Text;
            sube.Telefon = EkleTelTxtBox.Text;
            sube.Adres   = EkleAdresTxtBox.Text;
            int durum = BLL_Sube.SubeEkle(sube);

            if (durum == -1)
            {
                MessageBox.Show("Şube eklenirken bir sorun oluştu.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (durum == 0)
            {
                MessageBox.Show("Eklemek istediğiniz e-posta zaten var.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (durum == 1)
            {
                MessageBox.Show("Şube Başarıyla eklendi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                SubeComboDoldur();
                TumSubeGridVerileri();
                SehirComboBox.SelectedIndex = -1;
                TextBoxTemizle();
            }
        }
Ejemplo n.º 3
0
        public static E_Sube SubeIDGetir(string Eposta, string Sifre)
        {
            E_Sube     sube  = new E_Sube();
            SqlCommand komut = null;

            try
            {
                komut = new SqlCommand("SP_SubeIDGetir", Baglanti.baglan);
                komut.Connection.Open();
                komut.CommandType = CommandType.StoredProcedure;
                komut.Parameters.AddWithValue("Eposta", Eposta);
                komut.Parameters.AddWithValue("Sifre", Sifre);

                SqlDataReader oku = komut.ExecuteReader();
                if (oku.Read())
                {
                    sube.ID = Convert.ToInt32(oku["ID"]);
                    sube.Ad = oku["Ad"].ToString();
                }
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("Bir hata oluştu.Hata: " + e.ToString(), "Hata");
            }
            finally
            {
                komut.Connection.Close();
            }
            return(sube);
        }
Ejemplo n.º 4
0
        public static List <E_Sube> SubeListe()
        {
            List <E_Sube> subeler = null;
            SqlCommand    komut   = null;

            try
            {
                komut = new SqlCommand("SELECT ID,Ad,Sehir,Ilce FROM SubeBilgi", Baglanti.baglan);
                komut.Connection.Open();
                SqlDataReader oku = komut.ExecuteReader();
                if (oku.HasRows)
                {
                    subeler = new List <E_Sube>();
                    while (oku.Read())
                    {
                        E_Sube subebilgi = new E_Sube();
                        subebilgi.ID = Convert.ToInt32(oku["ID"]);
                        subebilgi.Ad = oku["Sehir"].ToString() + " - " + oku["Ilce"].ToString() + " -> " + oku["Ad"].ToString();
                        subeler.Add(subebilgi);
                    }
                }

                oku.Close();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("Bir hata oluştu.Hata: " + e.ToString(), "Hata");
                subeler = null;
            }
            finally
            {
                komut.Connection.Close();
            }
            return(subeler);
        }
Ejemplo n.º 5
0
        void SubeBilgisi()
        {
            E_Sube sube = BLL_Sube.SubeBilgiGoster(Session.SubeID);

            SubeMailLabel.Text  = sube.Eposta;
            SubeAdLabel.Text    = sube.Ad;
            SubeSehirLabel.Text = sube.Sehir;
            SubeSemtLabel.Text  = sube.Semt;
            SubeTelLabel.Text   = sube.Telefon;
            SubeAdresLabel.Text = sube.Adres;
        }
Ejemplo n.º 6
0
 public static int SubeGuncelle(E_Sube sube)
 {
     if (
         !String.IsNullOrEmpty(sube.Eposta) &&
         !String.IsNullOrEmpty(sube.Sifre) &&
         !String.IsNullOrEmpty(sube.Ad) &&
         !String.IsNullOrEmpty(sube.Sehir) &&
         !String.IsNullOrEmpty(sube.Ilce) &&
         !String.IsNullOrEmpty(sube.Semt) &&
         !String.IsNullOrEmpty(sube.Telefon) &&
         !String.IsNullOrEmpty(sube.Adres)
         )
     {
         return(F_Sube.SubeGuncelle(sube));
     }
     return(-1);
 }
Ejemplo n.º 7
0
        private void GirisYapButon_Click(object sender, EventArgs e)
        {
            E_Uye uye = new E_Uye();

            uye.Eposta = EpostaTxtBox.Text;
            uye.Sifre  = SifreTxtBox.Text;
            int durum = BLL_Uye.UyeGiris(uye);

            if (durum == 0 || durum == -1)
            {
                MessageBox.Show("E-posta yada şifrenizi kontrol edin.");
            }
            else if (durum == 1) //DÖNEN YETKİ 1 İSE MÜŞTERİ
            {
                E_Uye bilgi = BLL_Uye.UyeBilgiGetir(uye.Eposta, uye.Sifre);

                Session.TC       = bilgi.TC;
                Session.UyeAd    = bilgi.Ad;
                Session.UyeSoyad = bilgi.Soyad;
                Session.Eposta   = uye.Eposta;
                Session.Yetki    = 1;


                KullaniciArayuz kullanici = new KullaniciArayuz();
                kullanici.Show();
                this.Hide();
            }
            else if (durum == 2) //DÖNEN YETKİ 2 İSE ŞUBE
            {
                E_Sube bilgi = BLL_Sube.SubeIDGetir(uye.Eposta, uye.Sifre);
                Session.UyeAd  = bilgi.Ad;
                Session.SubeID = bilgi.ID;
                SubeArayuz sube = new SubeArayuz();
                sube.Show();
                this.Hide();
            }
            else if (durum == 3) //DÖNEN YETKİ 3 İSE YÖNETİCİ
            {
                YonetimArayuz yonetim = new YonetimArayuz();
                yonetim.Show();
                this.Hide();
            }
        }
Ejemplo n.º 8
0
 private void SubeComboBox2_SelectedIndexChanged(object sender, EventArgs e) // ŞUBE GÜNCELLEME BÖLÜMÜ INDEXCHANGED İLE VERİ YENİLEME
 {
     if (SubeComboBox2.SelectedValue is int)
     {
         E_Sube sube = new E_Sube();
         sube.ID = Convert.ToInt32(SubeComboBox2.SelectedValue);
         sube    = BLL_Sube.SubeBilgiGoster(sube.ID);
         if (sube != null)
         {
             SubeGuncelleButon.Enabled = true;
             SG_EpostaTxtBox.Text      = sube.Eposta;
             SG_SifreTxtBox.Text       = sube.Sifre;
             SG_AdTxtBox.Text          = sube.Ad;
             SG_SehirTxtBox.Text       = sube.Sehir;
             SG_IlceTxtBox.Text        = sube.Ilce;
             SG_SemtTxtBox.Text        = sube.Semt;
             SG_TelTxtBox.Text         = sube.Telefon;
             SG_AdresTxtBox.Text       = sube.Adres;
         }
     }
 }
Ejemplo n.º 9
0
        public static E_Sube SubeBilgiGoster(int ID)
        {
            E_Sube     subebilgi = null;
            SqlCommand komut     = null;

            try
            {
                komut = new SqlCommand("SP_SubeBilgiGoster", Baglanti.baglan);
                komut.Parameters.AddWithValue("ID", ID);
                komut.CommandType = CommandType.StoredProcedure;
                komut.Connection.Open();
                SqlDataReader oku = komut.ExecuteReader();
                if (oku.Read())
                {
                    subebilgi = new E_Sube();

                    subebilgi.Eposta  = oku["Eposta"].ToString();
                    subebilgi.Sifre   = oku["Sifre"].ToString();
                    subebilgi.Ad      = oku["Ad"].ToString();
                    subebilgi.Sehir   = oku["Sehir"].ToString();
                    subebilgi.Ilce    = oku["Ilce"].ToString();
                    subebilgi.Semt    = oku["Semt"].ToString();
                    subebilgi.Telefon = oku["Telefon"].ToString();
                    subebilgi.Adres   = oku["Adres"].ToString();
                }
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show("Bir hata oluştu.Hata: " + e.ToString(), "Hata");
                subebilgi = null;
            }
            finally
            {
                komut.Connection.Close();
            }
            return(subebilgi);
        }
Ejemplo n.º 10
0
        private void SubeGuncelleButon_Click(object sender, EventArgs e) //ŞUBE GÜNCELLEME İŞLEMİ
        {
            E_Sube sube = new E_Sube();

            sube.ID      = Convert.ToInt32(SubeComboBox2.SelectedValue);
            sube.Eposta  = SG_EpostaTxtBox.Text;
            sube.Sifre   = SG_SifreTxtBox.Text;
            sube.Ad      = SG_AdTxtBox.Text;
            sube.Sehir   = SG_SehirTxtBox.Text;
            sube.Ilce    = SG_IlceTxtBox.Text;
            sube.Semt    = SG_SemtTxtBox.Text;
            sube.Telefon = SG_TelTxtBox.Text;
            sube.Adres   = SG_AdresTxtBox.Text;

            int durum = BLL_Sube.SubeGuncelle(sube);

            if (durum == -1)
            {
                MessageBox.Show("Verileri kontrol ederek tekrar girin.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else if (durum == -0)
            {
                MessageBox.Show("Şube Güncellenirken bir hata oluştu", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show(SG_AdTxtBox.Text + " Şubesi güncellendi.", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);
                SubeComboDoldur();
                TumSubeGridVerileri();
                TumSubeGridVerileri();
                TumSubeGridVerileri();
                TumSubeGridVerileri();
                TumSubeGridVerileri();
                TextBoxTemizle();
            }
        }