public static List <Masa> MasalariGuncelle() { baglanti(); OleDbCommand komut = new OleDbCommand("SELECT * FROM Masalar", con); OleDbDataReader oku = komut.ExecuteReader(); List <Masa> masalar = new List <Masa>(); while (oku.Read()) { Masa masa = new Masa(Convert.ToInt32(oku["Masa_No"]), Convert.ToBoolean(oku["Masa_Durum"])); masalar.Add(masa); } bitir(); return(masalar); }
public static List <Masa> BosMasaListele() { List <Masa> bosMasalar = new List <Masa>(); baglanti(); OleDbCommand komut = new OleDbCommand("SELECT * FROM Masalar WHERE Masa_Durum=false", con); OleDbDataReader oku = komut.ExecuteReader(); while (oku.Read()) { Masa masa = new Masa(Convert.ToInt32(oku["Masa_No"]), Convert.ToBoolean(oku["Masa_Durum"])); bosMasalar.Add(masa); } bitir(); return(bosMasalar); }
public static Masa MasaAl(int masaNo) { Masa masa = new Masa(0, false); baglanti(); OleDbCommand komut = new OleDbCommand("SELECT * FROM Masalar WHERE Masa_No=@no", con); komut.Parameters.AddWithValue("@no", masaNo); OleDbDataReader oku = komut.ExecuteReader(); while (oku.Read()) { masa.MasaNo = Convert.ToInt32(oku["Masa_No"]); masa.MasaDurum = Convert.ToBoolean(oku["Masa_Durum"]); } bitir(); return(masa); }