예제 #1
0
        public static List <EAdres> MusteriAdresListele(int p)
        {
            SqlCommand cmd = new SqlCommand("sp_MusteriAdresListele", baglanti.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@mID", p);
            baglanti.conn.Open();
            SqlDataReader dr     = cmd.ExecuteReader();
            List <EAdres> aListe = new List <EAdres>();

            while (dr.Read())
            {
                EAdres a = new EAdres();
                a.ID          = Convert.ToInt32(dr["ID"].ToString());
                a.CustomerID  = Convert.ToInt32(dr["CustomerID"].ToString());
                a.AddressName = dr["AddressName"].ToString();
                a.Firstname   = dr["Firstname"].ToString();
                a.Lastname    = dr["Lastname"].ToString();
                a.City        = dr["City"].ToString();
                a.Town        = dr["Town"].ToString();
                a.PostalCode  = Convert.ToInt32(dr["PostalCode"].ToString());
                a.Address     = dr["Address"].ToString();
                aListe.Add(a);
            }
            dr.Close();
            baglanti.conn.Close();
            return(aListe);
        }
예제 #2
0
        public static EAdres AdresBul(int aID)
        {
            SqlCommand cmd = new SqlCommand("sp_AdresBul", baglanti.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@aID", aID);
            baglanti.conn.Open();
            SqlDataReader dr = cmd.ExecuteReader();
            EAdres        a  = new EAdres();

            while (dr.Read())
            {
                a.ID          = Convert.ToInt32(dr["ID"].ToString());
                a.CustomerID  = Convert.ToInt32(dr["CustomerID"].ToString());
                a.AddressName = dr["AddressName"].ToString();
                a.Firstname   = dr["Firstname"].ToString();
                a.Lastname    = dr["Lastname"].ToString();
                a.City        = dr["City"].ToString();
                a.Town        = dr["Town"].ToString();
                a.PostalCode  = Convert.ToInt32(dr["PostalCode"].ToString());
                a.Address     = dr["Address"].ToString();
            }
            dr.Close();
            baglanti.conn.Close();
            return(a);
        }
예제 #3
0
        private void lviAdresler_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            aID = Convert.ToInt32(lviAdresler.SelectedItems[0].SubItems[0].Text);
            EAdres a = BLLAdres.AdresBul(aID);

            lblAdresAdi.Text = a.AddressName;
        }
예제 #4
0
        private void btnSil_Click(object sender, EventArgs e)
        {
            EAdres a     = BLLAdres.AdresBul(aID);
            string cevap = BLLAdres.Sil(a);

            MessageBox.Show(cevap);
            Doldur();
        }
예제 #5
0
        public static void Sil(EAdres a)
        {
            SqlCommand cmd = new SqlCommand("sp_AdresSil", baglanti.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@aID", a.ID);
            baglanti.conn.Open();
            cmd.ExecuteNonQuery();
            baglanti.conn.Close();
        }
        private void frmAdresDetay_Load(object sender, EventArgs e)
        {
            EAdres a = BLLAdres.AdresBul(BLLSiparis.SiparisBul(Form1.sID).AddressID);

            lblAd.Text        = a.Firstname;
            lblSoyad.Text     = a.Lastname;
            lblil.Text        = a.City;
            lblilce.Text      = a.Town;
            lblPostaKodu.Text = a.PostalCode.ToString();
            lblAdres.Text     = a.Address;
        }
예제 #7
0
 private void frmAdresDuzenle_Load(object sender, EventArgs e)
 {
     a = BLLAdres.AdresBul(frmAdresListele.aID);
     lblKullanici.Text   = BLLMusteri.MusteriBul(a.CustomerID).Username;
     txtAdresAdi.Text    = a.AddressName;
     txtAliciAdi.Text    = a.Firstname;
     txtAliciSoyadi.Text = a.Lastname;
     txtil.Text          = a.City;
     txtilce.Text        = a.Town;
     txtPostaKodu.Text   = a.PostalCode.ToString();
     txtAdres.Text       = a.Address;
 }
 public static string Duzenle(EAdres a)
 {
     if (a.ID <= 0 || a.AddressName == "" || a.Firstname == "" || a.Lastname == "" || a.City == "" || a.Town == "" || a.PostalCode <= 0 || a.Address == "")
     {
         return("Hatalı işlem...");
     }
     else
     {
         DALAdres.Duzenle(a);
         return("Düzenlendi...");
     }
 }
 public static string Sil(EAdres a)
 {
     if (a.ID > 0)
     {
         DALAdres.Sil(a);
         return("Silindi");
     }
     else
     {
         return("Hatalı işlem...");
     }
 }
 public static string Ekle(EAdres a)
 {
     if (a.CustomerID > 0 && a.AddressName != "" && a.Firstname != "" && a.Lastname != "" && a.City != "" && a.Town != "" && a.PostalCode > 0 && a.Address != "")
     {
         if (DALAdres.Ekle(a) > 0)
         {
             return("Eklendi...");
         }
         else
         {
             return("Aynı adres isminden var, farklı bir isim giriniz...");
         }
     }
     return("Hatalı işlem...");
 }
예제 #11
0
        public static void Duzenle(EAdres a)
        {
            SqlCommand cmd = new SqlCommand("sp_AdresDuzenle", baglanti.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@id", a.ID);
            cmd.Parameters.AddWithValue("@adresAdi", a.AddressName);
            cmd.Parameters.AddWithValue("@aliciAdi", a.Firstname);
            cmd.Parameters.AddWithValue("@aliciSoyadi", a.Lastname);
            cmd.Parameters.AddWithValue("@il", a.City);
            cmd.Parameters.AddWithValue("@ilce", a.Town);
            cmd.Parameters.AddWithValue("@postaKodu", a.PostalCode);
            cmd.Parameters.AddWithValue("@adres", a.Address);
            baglanti.conn.Open();
            cmd.ExecuteNonQuery();
            baglanti.conn.Close();
        }
예제 #12
0
        public static int Ekle(EAdres a)
        {
            SqlCommand cmd = new SqlCommand("sp_AdresEkle", baglanti.conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@mID", a.CustomerID);
            cmd.Parameters.AddWithValue("@adresAdi", a.AddressName);
            cmd.Parameters.AddWithValue("@mAdi", a.Firstname);
            cmd.Parameters.AddWithValue("@mSoyadi", a.Lastname);
            cmd.Parameters.AddWithValue("@il", a.City);
            cmd.Parameters.AddWithValue("@ilce", a.Town);
            cmd.Parameters.AddWithValue("@postaKodu", a.PostalCode);
            cmd.Parameters.AddWithValue("@adres", a.Address);
            baglanti.conn.Open();
            int sayi = cmd.ExecuteNonQuery();

            baglanti.conn.Close();
            return(sayi);
        }
예제 #13
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            EAdres a = new EAdres();

            a.CustomerID  = m.ID;
            a.AddressName = txtAdresAdi.Text;
            a.Firstname   = txtAliciAdi.Text;
            a.Lastname    = txtAliciSoyadi.Text;
            a.City        = txtil.Text;
            a.Town        = txtilce.Text;
            a.PostalCode  = Convert.ToInt32(txtPostaKodu.Text);
            a.Address     = txtAdres.Text;
            string cevap = BLLAdres.Ekle(a);

            MessageBox.Show(cevap);
            frmAdresListele f = Application.OpenForms["frmAdresListele"] as frmAdresListele;

            f.Doldur();
        }