public void OzelKodlarListele() { Veritabani veritabani = new Veritabani(); SqlCommand sqlKomut = new SqlCommand("SELECT * FROM TBL_KODLAR", veritabani.BaglantiAc()); SqlDataReader dataReader = sqlKomut.ExecuteReader(); while (dataReader.Read()) { RchOzelKod1.Text = dataReader[0].ToString(); RchOzelKod2.Text = dataReader[1].ToString(); RchOzelKod3.Text = dataReader[2].ToString(); } }
public void FirmalarOku() { try { Veritabani veritabani = new Veritabani(); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter("SELECT ID,AD FROM TBL_FIRMALAR", veritabani.BaglantiAc()); da.Fill(dt); LookFirma.Properties.ValueMember = "ID"; LookFirma.Properties.DisplayMember = "AD"; LookFirma.Properties.DataSource = dt; veritabani.BaglantiAc().Close(); } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public Notlar() { Veritabani veritabani = new Veritabani(); SqlCommand sqlKomut = new SqlCommand("SELECT * FROM TBL_NOTLAR", veritabani.BaglantiAc()); SqlDataReader dataReader = sqlKomut.ExecuteReader(); if (dataReader.HasRows) { while (dataReader.Read()) { NotId = int.Parse(dataReader["ID"].ToString()); NotTarihi = dataReader["TARIH"].ToString(); NotSaati = dataReader["SAAT"].ToString(); NotBaslik = dataReader["BASLIK"].ToString(); NotDetay = dataReader["DETAY"].ToString(); NotOlusturan = dataReader["OLUSTURAN"].ToString(); NotHitap = dataReader["HITAP"].ToString(); } } }
public void IllerOku() { try { Veritabani veritabani = new Veritabani(); SqlCommand sqlKomut = new SqlCommand("Select SEHIR FROM TBL_ILLER", veritabani.BaglantiAc()); SqlDataReader sqlRead = sqlKomut.ExecuteReader(); if (sqlRead.HasRows) { while (sqlRead.Read()) { CmbIl.Properties.Items.Add(sqlRead[0]); } veritabani.BaglantiAc().Close(); } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public void IlcelerOku() { try { Veritabani veritabani = new Veritabani(); SqlCommand sqlKomut = new SqlCommand("Select ILCE FROM TBL_ILCELER WHERE SEHIR=@sehir", veritabani.BaglantiAc()); sqlKomut.Parameters.AddWithValue("@sehir", CmbIl.SelectedIndex + 1); SqlDataReader sqlRead = sqlKomut.ExecuteReader(); if (sqlRead.HasRows) { while (sqlRead.Read()) { CmbIlce.Properties.Items.Add(sqlRead[0]); } } } catch (Exception e) { Console.WriteLine(e.ToString()); } }
public Urunler() { Veritabani veritabani = new Veritabani(); SqlCommand sqlKomut = new SqlCommand("Select * FROM TBL_URUNLER", veritabani.BaglantiAc()); SqlDataReader sqlRead = sqlKomut.ExecuteReader(); //Urunler urunler = new Urunler(); if (sqlRead.HasRows) { while (sqlRead.Read()) { ProductID = int.Parse(sqlRead["ID"].ToString()); UrunAdi = sqlRead["URUNAD"].ToString(); MarkaAdi = sqlRead["MARKA"].ToString(); ModelAdi = sqlRead["MODEL"].ToString(); Yili = sqlRead["YIL"].ToString(); AdetSayisi = int.Parse(sqlRead["ADET"].ToString()); AlisFiyati = decimal.Parse(sqlRead["ALISFIYAT"].ToString()); SatisFiyati = decimal.Parse(sqlRead["SATISFIYAT"].ToString()); Detaylandirma = sqlRead["DETAY"].ToString(); } } }
public Firmalar() { try { Veritabani veritabani = new Veritabani(); SqlCommand sqlKomut = new SqlCommand("SELECT * FROM TBL_FIRMALAR", veritabani.BaglantiAc()); SqlDataReader dataReader = sqlKomut.ExecuteReader(); if (dataReader.HasRows) { while (dataReader.Read()) { FirmaID = int.Parse(dataReader["ID"].ToString()); FirmaAdi = dataReader["AD"].ToString(); YetkiliStatu = dataReader["YETKILISTATU"].ToString(); YetkiliAdSoyad = dataReader["YETKILIADSOYAD"].ToString(); YetkiliKimlikNo = dataReader["YETKILITC"].ToString(); FirmaSektor = dataReader["SEKTOR"].ToString(); FirmaTelefon1 = dataReader["TELEFON1"].ToString(); FirmaTelefon2 = dataReader["TELEFON2"].ToString(); FirmaTelefon3 = dataReader["TELEFON3"].ToString(); MailAdresi = dataReader["MAIL"].ToString(); MusteriFax = dataReader["FAX"].ToString(); ILi = dataReader["IL"].ToString(); Ilce = dataReader["ILCE"].ToString(); VergiDairesi = dataReader["VERGIDAIRE"].ToString(); Adresi = dataReader["ADRES"].ToString(); OzelKod1 = dataReader["OZELKOD1"].ToString(); OzelKod2 = dataReader["OZELKOD2"].ToString(); OzelKod3 = dataReader["OZELKOD3"].ToString(); } } } catch (Exception) { throw; } }