///<summary> /// Mesaj Data Update ///</summary> public static int Update(Mesaj p) { int rowsAffected = 0; 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, "update mesaj set hesapid=?hesapid,ip=?ip,adi=?adi,mail=?mail,telefon=?telefon,konu=?konu,icerik=?icerik,yanit=?yanit,kayittarihi=?kayittarihi,guncellemetarihi=?guncellemetarihi,durum=?durum,yoneticionay=?yoneticionay,aktif=?aktif where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.BigInt); cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar); cmd.Parameters.Add("telefon", p.Telefon, MSqlDbType.VarChar); cmd.Parameters.Add("konu", p.Konu, MSqlDbType.VarChar); cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.VarChar); cmd.Parameters.Add("yanit", p.Yanit, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("durum", p.Durum, MSqlDbType.SmallInt); cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
/// <summary> /// Album Liste Getir /// </summary> public static AlbumCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { AlbumCollection rvAlbum = new AlbumCollection(); 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()) { rvAlbum.Add(new Album(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["etiket"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToBool(IDR["gosterimsayi"]), MConvert.NullToBool(IDR["uye"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvAlbum); }
/// <summary> /// ResmiIlan Getir /// </summary> public static ResmiIlan GetResmiIlan(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { ResmiIlan rvResmiIlan = new ResmiIlan(); 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()) { rvResmiIlan = new ResmiIlan(MConvert.NullToInt64(IDR["id"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["aktif"])); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvResmiIlan); }
public static List <Kategori> GetMenu(string modulid, bool rootNode) { List <Kategori> rvKategori = new List <Kategori>(); using (MConnection conneciton = new MConnection(MClientProvider.MySQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } switch (rootNode) { case true: rvKategori.Add(new Kategori("0", "", modulid, "<Seçiniz>", "", 0, 1, false, "", "", "")); break; } using (MCommand cmd = new MCommand(CommandType.Text, "select * from kategori where modulid=?modulid and aktif=1 order by adi asc", conneciton)) { cmd.Parameters.Add("modulid", modulid, MSqlDbType.VarChar); using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvKategori.Add(new Kategori(MConvert.NullToString(IDR["id"]), MConvert.NullToString(IDR["parentid"]), MConvert.NullToString(IDR["modulid"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["dil"]), MConvert.NullToByte(IDR["sira"]), MConvert.NullToByte(IDR["menu"]), MConvert.NullToBool(IDR["aktif"]), MConvert.NullToString(IDR["renk"]), MConvert.NullToString(IDR["aciklama"]), MConvert.NullToString(IDR["etiket"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvKategori); }
/// <summary> /// Profil Liste Getir /// </summary> public static ProfilCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { ProfilCollection rvProfil = new ProfilCollection(); 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()) { rvProfil.Add(new Profil(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["url"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["web"]), MConvert.NullToString(IDR["telefon"]), MConvert.NullToString(IDR["gsm"]), MConvert.NullToString(IDR["meslek"]), MConvert.NullToString(IDR["egitim"]), MConvert.NullToString(IDR["sehir"]), MConvert.NullToString(IDR["hakkimda"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvProfil); }
///<summary> /// Mesaj Data Update ///</summary> public static int Update(Mesaj p) { int rowsAffected = 0; using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Mesaj SET HesapID=@HesapID,IP=@IP,Adi=@Adi,Mail=@Mail,Telefon=@Telefon,Konu=@Konu,Icerik=@Icerik,Yanit=@Yanit,KayitTarihi=@KayitTarihi,GuncellemeTarihi=@GuncellemeTarihi,Durum=@Durum,YoneticiOnay=@YoneticiOnay,Aktif=@Aktif WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.BigInt); cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar); cmd.Parameters.Add("Mail", p.Mail, MSqlDbType.VarChar); cmd.Parameters.Add("Telefon", p.Telefon, MSqlDbType.VarChar); cmd.Parameters.Add("Konu", p.Konu, MSqlDbType.NVarChar); cmd.Parameters.Add("Icerik", p.Icerik, MSqlDbType.NVarChar); cmd.Parameters.Add("Yanit", p.Yanit, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("GuncellemeTarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.TinyInt); cmd.Parameters.Add("YoneticiOnay", p.YoneticiOnay, MSqlDbType.Bit); cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
/// <summary> /// Galeri Liste Getir /// </summary> public static GaleriCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { GaleriCollection rvGaleri = new GaleriCollection(); 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()) { rvGaleri.Add(new Galeri(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToInt64(IDR["albumid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["aciklama"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["kapak"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvGaleri); }
/// <summary> /// Reklam Liste Getir /// </summary> public static ReklamCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { ReklamCollection rvReklam = new ReklamCollection(); using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { 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()) { rvReklam.Add(new Reklam(MConvert.NullToInt(IDR["ID"]), MConvert.NullToString(IDR["BannerName"]), MConvert.NullToString(IDR["ImageUrl"]), MConvert.NullToString(IDR["NavigateUrl"]), MConvert.NullToString(IDR["AlternateText"]), MConvert.NullToString(IDR["Keyword"]), MConvert.NullToInt(IDR["Impressions"]), MConvert.NullToInt(IDR["Width"]), MConvert.NullToInt(IDR["Height"]), MConvert.NullToBool(IDR["IsActive"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvReklam); }
/// <summary> /// Sayfa Liste Getir /// </summary> public static SayfaCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { SayfaCollection rvSayfa = new SayfaCollection(); 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()) { rvSayfa.Add(new Sayfa(MConvert.NullToInt16(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["baslik"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToString(IDR["dil"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToByte(IDR["yerlesim"]), MConvert.NullToBool(IDR["aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvSayfa); }
public static UrunRaporCollection GetSelect() { UrunRaporCollection rvUrunRapor = new UrunRaporCollection(); try { 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 UrunRapor order by KategoriAdi, Fiyat", conneciton)) { using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvUrunRapor.Add(new UrunRapor(MConvert.NullToFloat(IDR["Fiyat"]), MConvert.NullToFloat(IDR["KarOran"]), MConvert.NullToString(IDR["FirmaKod"]), MConvert.NullToString(IDR["UrunAdi"]), MConvert.NullToString(IDR["KategoriAdi"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } } catch (Exception ex) { Commons.Status(Commons.GetErrorCode("URP", 1) + ex.Message); } return(rvUrunRapor); }
/// <summary> /// Firma Liste Getir /// </summary> public static FirmaCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { FirmaCollection rvFirma = new FirmaCollection(); 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()) { rvFirma.Add(new Firma(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["kategoriid"]), MConvert.NullToString(IDR["resimurl"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["yetkili"]), MConvert.NullToString(IDR["adres"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["web"]), MConvert.NullToString(IDR["telefon1"]), MConvert.NullToString(IDR["telefon2"]), MConvert.NullToString(IDR["gsm"]), MConvert.NullToString(IDR["sehir"]), 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(rvFirma); }
/// <summary> /// Haber Liste Getir /// </summary> public static HaberCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { HaberCollection rvHaber = new HaberCollection(); using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { 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()) { rvHaber.Add(new Haber(MConvert.NullToInt64(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["KategoriID"]), MConvert.NullToString(IDR["ResimUrl"]), MConvert.NullToString(IDR["Baslik"]), MConvert.NullToString(IDR["Ozet"]), MConvert.NullToString(IDR["Icerik"]), MConvert.NullToString(IDR["Etiket"]), MConvert.NullToDateTime(IDR["KayitTarihi"]), MConvert.NullToBool(IDR["Uye"]), MConvert.NullToBool(IDR["Yorum"]), MConvert.NullToBool(IDR["Aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvHaber); }
/// <summary> /// Sayfa Getir /// </summary> public static Sayfa GetSayfa(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { Sayfa rvSayfa = new Sayfa(); using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { 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()) { rvSayfa = new Sayfa(MConvert.NullToInt16(IDR["ID"]), MConvert.NullToGuid(IDR["HesapID"]), MConvert.NullToString(IDR["Baslik"]), MConvert.NullToString(IDR["Icerik"]), MConvert.NullToString(IDR["Dil"]), MConvert.NullToDateTime(IDR["KayitTarihi"]), MConvert.NullToByte(IDR["Tipi"]), MConvert.NullToBool(IDR["Aktif"])); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvSayfa); }
/// <summary> /// Hesap Liste Getir /// </summary> public static HesapCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { HesapCollection rvHesap = new HesapCollection(); 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()) { rvHesap.Add(new Hesap(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["soyadi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["sifre"]), MConvert.NullToString(IDR["roller"]), MConvert.NullToString(IDR["onaykodu"]), MConvert.NullToDateTime(IDR["dogumtarihi"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToByte(IDR["cinsiyet"]), MConvert.NullToByte(IDR["tipi"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["abonelik"]), MConvert.NullToBool(IDR["aktivasyon"]), MConvert.NullToBool(IDR["aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvHesap); }
/// <summary> /// Yorum Getir /// </summary> public static Yorum GetYorum(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { Yorum rvYorum = new Yorum(); 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()) { rvYorum = new Yorum(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["modulid"]), MConvert.NullToString(IDR["icerikid"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"])); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvYorum); }
/// <summary> /// Mesaj Liste Getir /// </summary> public static MesajCollection GetList(CommandType cmdType, string sqlQuery, MParameterCollection parameters) { MesajCollection rvMesaj = new MesajCollection(); 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()) { rvMesaj.Add(new Mesaj(MConvert.NullToInt64(IDR["id"]), MConvert.NullToGuidString(IDR["hesapid"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["telefon"]), MConvert.NullToString(IDR["konu"]), MConvert.NullToString(IDR["icerik"]), MConvert.NullToString(IDR["yanit"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToDateTime(IDR["guncellemetarihi"]), MConvert.NullToByte(IDR["durum"]), MConvert.NullToBool(IDR["yoneticionay"]), MConvert.NullToBool(IDR["aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvMesaj); }
///<summary> /// Hesap Data URL ///</summary> public static Hesap GetHesapUrl(string purl) { Hesap rvHesap = new Hesap(); Profil tempProfil = ProfilMethods.GetProfilUrl(purl); if (tempProfil != null) { 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 hesap where id=?id limit 1", conneciton)) { cmd.Parameters.Add("id", tempProfil.ID, MSqlDbType.VarChar); using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvHesap = new Hesap(MConvert.NullToGuidString(IDR["id"]), MConvert.NullToString(IDR["ip"]), MConvert.NullToString(IDR["adi"]), MConvert.NullToString(IDR["soyadi"]), MConvert.NullToString(IDR["mail"]), MConvert.NullToString(IDR["sifre"]), MConvert.NullToString(IDR["roller"]), MConvert.NullToString(IDR["onaykodu"]), MConvert.NullToDateTime(IDR["dogumtarihi"]), MConvert.NullToDateTime(IDR["kayittarihi"]), MConvert.NullToByte(IDR["cinsiyet"]), MConvert.NullToByte(IDR["tipi"]), MConvert.NullToBool(IDR["yorum"]), MConvert.NullToBool(IDR["abonelik"]), MConvert.NullToBool(IDR["aktivasyon"]), MConvert.NullToBool(IDR["aktif"])); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } } rvHesap.ProfilObject = tempProfil; return(rvHesap); }
///<summary> /// Mesaj Data Insert ///</summary> public static int Insert(System.Guid pHesapID, string pIP, string pAdi, string pMail, string pTelefon, string pKonu, string pIcerik, string pYanit, DateTime pKayitTarihi, DateTime pGuncellemeTarihi, byte pDurum, bool pYoneticiOnay, bool pAktif) { int rowsAffected = 0; using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "INSERT INTO Mesaj (HesapID,IP,Adi,Mail,Telefon,Konu,Icerik,Yanit,KayitTarihi,GuncellemeTarihi,Durum,YoneticiOnay,Aktif) VALUES(@HesapID,@IP,@Adi,@Mail,@Telefon,@Konu,@Icerik,@Yanit,@KayitTarihi,@GuncellemeTarihi,@Durum,@YoneticiOnay,@Aktif)", conneciton)) { cmd.Parameters.Add("HesapID", pHesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("IP", pIP, MSqlDbType.VarChar); cmd.Parameters.Add("Adi", pAdi, MSqlDbType.NVarChar); cmd.Parameters.Add("Mail", pMail, MSqlDbType.VarChar); cmd.Parameters.Add("Telefon", pTelefon, MSqlDbType.VarChar); cmd.Parameters.Add("Konu", pKonu, MSqlDbType.NVarChar); cmd.Parameters.Add("Icerik", pIcerik, MSqlDbType.NVarChar); cmd.Parameters.Add("Yanit", pYanit, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", pKayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("GuncellemeTarihi", pGuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("Durum", pDurum, MSqlDbType.TinyInt); cmd.Parameters.Add("YoneticiOnay", pYoneticiOnay, MSqlDbType.Bit); cmd.Parameters.Add("Aktif", pAktif, MSqlDbType.Bit); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Makale Data Update ///</summary> public static int Update(Makale p) { int rowsAffected = 0; using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Makale SET HesapID=@HesapID,KategoriID=@KategoriID,ResimUrl=@ResimUrl,Baslik=@Baslik,Ozet=@Ozet,Icerik=@Icerik,Etiket=@Etiket,KayitTarihi=@KayitTarihi,Durum=@Durum,Uye=@Uye,Yorum=@Yorum,Aktif=@Aktif WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.BigInt); cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.VarChar); cmd.Parameters.Add("ResimUrl", p.ResimUrl, MSqlDbType.VarChar); cmd.Parameters.Add("Baslik", p.Baslik, MSqlDbType.NVarChar); cmd.Parameters.Add("Ozet", BAYMYO.UI.Commons.SubStringText(p.Ozet, 250), MSqlDbType.NVarChar); cmd.Parameters.Add("Icerik", p.Icerik, MSqlDbType.NVarChar); cmd.Parameters.Add("Etiket", p.Etiket, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.Byte); cmd.Parameters.Add("Uye", p.Uye, MSqlDbType.Bit); cmd.Parameters.Add("Yorum", p.Yorum, MSqlDbType.Bit); cmd.Parameters.Add("Aktif", p.Aktif, MSqlDbType.Bit); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Reklam Data Update ///</summary> public static int Update(Reklam p) { int rowsAffected = 0; 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, "update reklam set bannername=?bannername,imageurl=?imageurl,navigateurl=?navigateurl,alternatetext=?alternatetext,keyword=?keyword,adsenseclient=?adsenseclient,adsenseslot=?adsenseslot,impressions=?impressions,width=?width,height=?height,orders=?orders,isactive=?isactive where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.Int); cmd.Parameters.Add("bannername", p.BannerName, MSqlDbType.VarChar); cmd.Parameters.Add("imageurl", p.ImageUrl, MSqlDbType.LongText); cmd.Parameters.Add("navigateurl", p.NavigateUrl, MSqlDbType.VarChar); cmd.Parameters.Add("alternatetext", p.AlternateText, MSqlDbType.VarChar); cmd.Parameters.Add("keyword", p.Keyword, MSqlDbType.VarChar); cmd.Parameters.Add("adsenseclient", p.AdSenseClient, MSqlDbType.VarChar); cmd.Parameters.Add("adsenseslot", p.AdSenseSlot, MSqlDbType.VarChar); cmd.Parameters.Add("impressions", p.Impressions, MSqlDbType.Int); cmd.Parameters.Add("width", p.Width, MSqlDbType.Int); cmd.Parameters.Add("height", p.Height, MSqlDbType.Int); cmd.Parameters.Add("orders", p.Orders, MSqlDbType.TinyInt); cmd.Parameters.Add("isactive", p.IsActive, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static Hesap GetHesap(string pUrl) { Hesap rvHesap = new Hesap(); Profil tempProfil = ProfilMethods.GetProfil(pUrl); if (tempProfil != null) { using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "SELECT TOP(1) * FROM Hesap WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", tempProfil.ID, MSqlDbType.UniqueIdentifier); using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvHesap = new Hesap(MConvert.NullToGuid(IDR["ID"]), MConvert.NullToString(IDR["IP"]), MConvert.NullToString(IDR["Adi"]), MConvert.NullToString(IDR["Soyadi"]), MConvert.NullToString(IDR["Mail"]), MConvert.NullToString(IDR["Sifre"]), MConvert.NullToString(IDR["Roller"]), MConvert.NullToString(IDR["OnayKodu"]), MConvert.NullToDateTime(IDR["DogumTarihi"]), MConvert.NullToDateTime(IDR["KayitTarihi"]), MConvert.NullToByte(IDR["Cinsiyet"]), MConvert.NullToByte(IDR["Tipi"]), MConvert.NullToBool(IDR["Yorum"]), MConvert.NullToBool(IDR["Abonelik"]), MConvert.NullToBool(IDR["Aktivasyon"]), MConvert.NullToBool(IDR["Aktif"])); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } } rvHesap.ProfilObject = tempProfil; return(rvHesap); }
///<summary> /// Manset Data Update ///</summary> public static int Update(Manset p) { int rowsAffected = 0; 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, "update manset set modulid=?modulid,resimbuyuk=?resimbuyuk,baslik1=?baslik1,baslik2=?baslik2,aciklama=?aciklama,baglanti=?baglanti,dugme=?dugme,dil=?dil,kayittarihi=?kayittarihi,guncellemetarihi=?guncellemetarihi,yerlesim=?yerlesim,aktif=?aktif where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar); cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("resimbuyuk", p.ResimBuyuk, MSqlDbType.VarChar); cmd.Parameters.Add("baslik1", p.Baslik1, MSqlDbType.VarChar); cmd.Parameters.Add("baslik2", p.Baslik2, MSqlDbType.VarChar); cmd.Parameters.Add("aciklama", p.Aciklama, MSqlDbType.VarChar); cmd.Parameters.Add("baglanti", p.Baglanti, MSqlDbType.VarChar); cmd.Parameters.Add("dugme", p.Dugme, MSqlDbType.VarChar); cmd.Parameters.Add("dil", p.Dil, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("yerlesim", p.Yerlesim, MSqlDbType.Byte); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Manset Data Insert ///</summary> public static int Insert(Manset p) { int rowsAffected = 0; 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, "insert into manset (id,modulid,resimbuyuk,baslik1,baslik2,aciklama,baglanti,dugme,dil,kayittarihi,guncellemetarihi,yerlesim,aktif) values(?id,?modulid,?resimbuyuk,?baslik1,?baslik2,?aciklama,?baglanti,?dugme,?dil,?kayittarihi,?guncellemetarihi,?yerlesim,?aktif)", conneciton)) { cmd.Parameters.Add("id", Guid.NewGuid(), MSqlDbType.VarChar); cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("resimbuyuk", p.ResimBuyuk, MSqlDbType.VarChar); cmd.Parameters.Add("baslik1", p.Baslik1, MSqlDbType.VarChar); cmd.Parameters.Add("baslik2", p.Baslik2, MSqlDbType.VarChar); cmd.Parameters.Add("aciklama", p.Aciklama, MSqlDbType.VarChar); cmd.Parameters.Add("baglanti", p.Baglanti, MSqlDbType.VarChar); cmd.Parameters.Add("dugme", p.Dugme, MSqlDbType.VarChar); cmd.Parameters.Add("dil", p.Dil, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("yerlesim", p.Yerlesim, MSqlDbType.SmallInt); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Video Data Insert ///</summary> public static Int64 Insert(Video p) { Int64 rowsAffected = 0; 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, "insert into video (hesapid,kategoriid,resimurl,baslik,embed,etiket,kayittarihi,guncellemetarihi,gosterimsayi,uye,yorum,yoneticionay,aktif) values(?hesapid,?kategoriid,?resimurl,?baslik,?embed,?etiket,?kayittarihi,?guncellemetarihi,?gosterimsayi,?uye,?yorum,?yoneticionay,?aktif); select last_insert_id();", conneciton)) { cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar); cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar); cmd.Parameters.Add("baslik", p.Baslik, MSqlDbType.VarChar); cmd.Parameters.Add("embed", p.Embed, MSqlDbType.VarChar); cmd.Parameters.Add("etiket", p.Etiket, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean); cmd.Parameters.Add("uye", p.Uye, MSqlDbType.Boolean); cmd.Parameters.Add("yorum", p.Yorum, MSqlDbType.Boolean); cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); rowsAffected = MConvert.NullToInt64(cmd.ExecuteScalar()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Mesaj Data Insert ///</summary> public static Int64 Insert(Mesaj p) { Int64 rowsAffected = 0; 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, "insert into mesaj (hesapid,ip,adi,mail,telefon,konu,icerik,yanit,kayittarihi,guncellemetarihi,durum,yoneticionay,aktif) values(?hesapid,?ip,?adi,?mail,?telefon,?konu,?icerik,?yanit,?kayittarihi,?guncellemetarihi,?durum,?yoneticionay,?aktif); select last_insert_id();", conneciton)) { cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar); cmd.Parameters.Add("telefon", p.Telefon, MSqlDbType.VarChar); cmd.Parameters.Add("konu", p.Konu, MSqlDbType.VarChar); cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.VarChar); cmd.Parameters.Add("yanit", p.Yanit, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("durum", p.Durum, MSqlDbType.SmallInt); cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); rowsAffected = MConvert.NullToInt(cmd.ExecuteScalar()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Haber Data Update ///</summary> public static int Update(Int64 pID, System.Guid pHesapID, string pKategoriID, string pResimUrl, string pBaslik, string pOzet, string pIcerik, string pEtiket, DateTime pKayitTarihi, bool pUye, bool pYorum, bool pAktif) { int rowsAffected = 0; using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Haber SET HesapID=@HesapID,KategoriID=@KategoriID,ResimUrl=@ResimUrl,Baslik=@Baslik,Ozet=@Ozet,Icerik=@Icerik,Etiket=@Etiket,KayitTarihi=@KayitTarihi,Uye=@Uye,Yorum=@Yorum,Aktif=@Aktif WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", pID, MSqlDbType.BigInt); cmd.Parameters.Add("HesapID", pHesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("KategoriID", pKategoriID, MSqlDbType.VarChar); cmd.Parameters.Add("ResimUrl", pResimUrl, MSqlDbType.VarChar); cmd.Parameters.Add("Baslik", pBaslik, MSqlDbType.NVarChar); cmd.Parameters.Add("Ozet", pOzet, MSqlDbType.NVarChar); cmd.Parameters.Add("Icerik", pIcerik, MSqlDbType.NVarChar); cmd.Parameters.Add("Etiket", pEtiket, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", pKayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("Uye", pUye, MSqlDbType.Bit); cmd.Parameters.Add("Yorum", pYorum, MSqlDbType.Bit); cmd.Parameters.Add("Aktif", pAktif, MSqlDbType.Bit); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Randevu Data Update ///</summary> public static int Update(Randevu p) { int rowsAffected = 0; using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "UPDATE Randevu SET HesapID=@HesapID,ModulID=@ModulID,IcerikID=@IcerikID,Adi=@Adi,Mail=@Mail,Telefon=@Telefon,GSM=@GSM,Icerik=@Icerik,TarihSaat=@TarihSaat,Durum=@Durum,YoneticiOnay=@YoneticiOnay WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar); cmd.Parameters.Add("Mail", p.Mail, MSqlDbType.VarChar); cmd.Parameters.Add("Telefon", p.Telefon, MSqlDbType.VarChar); cmd.Parameters.Add("GSM", p.GSM, MSqlDbType.VarChar); cmd.Parameters.Add("Icerik", p.Icerik, MSqlDbType.NVarChar); cmd.Parameters.Add("TarihSaat", p.TarihSaat, MSqlDbType.DateTime); cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.TinyInt); cmd.Parameters.Add("YoneticiOnay", p.YoneticiOnay, MSqlDbType.Bit); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static Stok GetStok(Stok p) { Stok rvStok = new Stok(); 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 top 1 * from Stok where KategoriID=@KategoriID and UrunID=@UrunID and FirmaID=@FirmaID", conneciton)) { cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.Int); cmd.Parameters.Add("UrunID", p.UrunID, MSqlDbType.Int); cmd.Parameters.Add("FirmaID", p.FirmaID, MSqlDbType.Int); using (IDataReader IDR = cmd.ExecuteReader()) { List <Firma> pFirmalar = FirmaMethods.GetSelect(); while (IDR.Read()) { rvStok = new Stok(MConvert.NullToInt(IDR["ID"]), MConvert.NullToInt(IDR["KategoriID"]), MConvert.NullToInt(IDR["UrunID"]), MConvert.NullToInt(IDR["FirmaID"]), MConvert.NullToFloat(IDR["Fiyat"]), MConvert.NullToFloat(IDR["KarOran"]), MConvert.NullToDateTime(IDR["EklenmeTarihi"]), MConvert.NullToDateTime(IDR["GuncellemeTarihi"]), pFirmalar.Find(x => x.ID.Equals(MConvert.NullToInt(IDR["FirmaID"])))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvStok); }
///<summary> /// Album Data Update ///</summary> public static int Update(Album p) { int rowsAffected = 0; 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, "update album set hesapid=?hesapid,kategoriid=?kategoriid,adi=?adi,etiket=?etiket,kayittarihi=?kayittarihi,guncellemetarihi=?guncellemetarihi,gosterimsayi=?gosterimsayi,uye=?uye,yorum=?yorum,yoneticionay=?yoneticionay,aktif=?aktif where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.BigInt); cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("kategoriid", p.KategoriID, MSqlDbType.VarChar); cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); cmd.Parameters.Add("etiket", p.Etiket, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("guncellemetarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("gosterimsayi", p.GosterimSayi, MSqlDbType.Boolean); cmd.Parameters.Add("uye", p.Uye, MSqlDbType.Boolean); cmd.Parameters.Add("yorum", p.Yorum, MSqlDbType.Boolean); cmd.Parameters.Add("yoneticionay", p.YoneticiOnay, MSqlDbType.Boolean); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static List <Kategori> GetMenu(string modulID, bool rootNode) { List <Kategori> rvKategori = new List <Kategori>(); using (MConnection conneciton = new MConnection(MClientProvider.MSSQL)) { switch (conneciton.State) { case System.Data.ConnectionState.Closed: conneciton.Open(); break; } using (MCommand cmd = new MCommand(CommandType.Text, "SELECT * FROM Kategori WHERE ModulID=@ModulID AND Menu=1 AND Aktif=1 ORDER BY ID ASC", conneciton)) { cmd.Parameters.Add("ModulID", modulID, MSqlDbType.VarChar); using (IDataReader IDR = cmd.ExecuteReader()) { if (rootNode) { rvKategori.Add(new Kategori("0", "", modulID, "<Seçiniz>", "", 0, false, false, false)); } while (IDR.Read()) { rvKategori.Add(new Kategori(MConvert.NullToString(IDR["ID"]), MConvert.NullToString(IDR["ParentID"]), MConvert.NullToString(IDR["ModulID"]), MConvert.NullToString(IDR["Adi"]), MConvert.NullToString(IDR["Dil"]), MConvert.NullToByte(IDR["Sira"]), MConvert.NullToBool(IDR["Tab"]), MConvert.NullToBool(IDR["Menu"]), MConvert.NullToBool(IDR["Aktif"]))); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvKategori); }