public static KategoriCollection GetSelect() { KategoriCollection rvKategori = new KategoriCollection(); using (MConnection conneciton = new MConnection(MClientProvider.OleDb, Commons.ConnectionStringName)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "select * from Kategori order by Adi asc", conneciton)) { using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvKategori.Add(new Kategori(MConvert.NullToInt(IDR["ID"]), MConvert.NullToString(IDR["Kod"]), MConvert.NullToString(IDR["Adi"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvKategori); }
public void GetKategoriler() { try { KategoriCollection k = KategoriMethods.GetSelect(); k.Add(new Kategori { ID = 0, Adi = L.YeniKategori }); this.kategoriBindingSource.DataSource = k; } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("FST", 16) + ex.Message); } }
public void GetKategoriler() { try { KategoriCollection k = KategoriMethods.GetSelect(); k.Add(new Kategori { ID = 0, Kod = "...", Adi = L.TumKategorilereUygula }); this.kategoriBindingSource.DataSource = k; } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("FKS", 3) + ex.Message); } }