///<summary> /// SeriIlan Data Select ///</summary> public static SeriIlanCollection GetSelect(System.String phesapid) { SeriIlanCollection rvSeriIlan = new SeriIlanCollection(); using (MConnection conneciton = new MConnection(MClientProvider.MySQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "select * from seriilan where hesapid=?hesapid", conneciton)) { cmd.Parameters.Add("hesapid", phesapid, MSqlDbType.VarChar); using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvSeriIlan.Add(new SeriIlan(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["detay"]), MConvert.NullToString(IDR["semt"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToString(IDR["telefon"]), MConvert.NullToFloat(IDR["fiyat"]), MConvert.NullToByte(IDR["kimden"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvSeriIlan); }
/// <summary> /// SeriIlan Liste Getir /// </summary> public static SeriIlanCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { SeriIlanCollection rvSeriIlan = new SeriIlanCollection(); using (MConnection conneciton = new MConnection(MClientProvider.MySQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(cmdType, sqlQuery, conneciton)) { if (parameters != null) { foreach (MParameter item in parameters) { cmd.Parameters.Add(item); } } using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvSeriIlan.Add(new SeriIlan(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["detay"]), MConvert.NullToString(IDR["semt"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToString(IDR["telefon"]), MConvert.NullToFloat(IDR["fiyat"]), MConvert.NullToByte(IDR["kimden"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvSeriIlan); }