public static int Delete(Urun p) { int rowsAffected = 0; if (StokMethods.GetUrunCount(p.ID) > 0) { System.Windows.Forms.MessageBox.Show(string.Format(L.UrunStokdaVarSilinmez, p.Adi), "Warning"); return(0); } 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, "delete from Urun where ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Yorum Data Delete ///</summary> public static int Delete(Yorum 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, "DELETE FROM Yorum WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Delete(Kategori p) { int rowsAffected = 0; 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, "delete from Kategori where ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Video Data Update ///</summary> public static int Update(Video 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 Video SET HesapID=@HesapID,KategoriID=@KategoriID,ResimUrl=@ResimUrl,Baslik=@Baslik,Embed=@Embed,Etiket=@Etiket,KayitTarihi=@KayitTarihi,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("Embed", p.Embed, MSqlDbType.VarChar); cmd.Parameters.Add("Etiket", p.Etiket, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Yorum Data Insert ///</summary> public static int Insert(Yorum 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, "INSERT INTO Yorum (IP,ModulID,IcerikID,Adi,Mail,Icerik,KayitTarihi,YoneticiOnay,Aktif) VALUES(@IP,@ModulID,@IcerikID,@Adi,@Mail,@Icerik,@KayitTarihi,@YoneticiOnay,@Aktif)", conneciton)) { cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar); 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("Icerik", p.Icerik, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Sehir Data Update ///</summary> public static int Update(Sehir 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 sehir set adi=?adi where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.SmallInt); cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Update(AnketPuan 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 anketpuan set hesapid=?hesapid,anketid=?anketid,soruid=?soruid,ip=?ip where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar); cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("anketid", p.AnketID, MSqlDbType.BigInt); cmd.Parameters.Add("soruid", p.SoruID, MSqlDbType.BigInt); cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Reklam Data Insert ///</summary> public static int Insert(string pBannerName, string pImageUrl, string pNavigateUrl, string pAlternateText, string pKeyword, int pImpressions, int pWidth, int pHeight, bool pIsActive) { 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 Reklam (BannerName,ImageUrl,NavigateUrl,AlternateText,Keyword,Impressions,Width,Height,IsActive) VALUES(@BannerName,@ImageUrl,@NavigateUrl,@AlternateText,@Keyword,@Impressions,@Width,@Height,@IsActive)", conneciton)) { cmd.Parameters.Add("BannerName", pBannerName, MSqlDbType.NVarChar); cmd.Parameters.Add("ImageUrl", pImageUrl, MSqlDbType.VarChar); cmd.Parameters.Add("NavigateUrl", pNavigateUrl, MSqlDbType.VarChar); cmd.Parameters.Add("AlternateText", pAlternateText, MSqlDbType.NVarChar); cmd.Parameters.Add("Keyword", pKeyword, MSqlDbType.NVarChar); cmd.Parameters.Add("Impressions", pImpressions, MSqlDbType.Int); cmd.Parameters.Add("Width", pWidth, MSqlDbType.Int); cmd.Parameters.Add("Height", pHeight, MSqlDbType.Int); cmd.Parameters.Add("IsActive", pIsActive, 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.MSSQL)) { 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,Impressions=@Impressions,Width=@Width,Height=@Height,IsActive=@IsActive WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int); cmd.Parameters.Add("BannerName", p.BannerName, MSqlDbType.NVarChar); cmd.Parameters.Add("ImageUrl", p.ImageUrl, MSqlDbType.VarChar); cmd.Parameters.Add("NavigateUrl", p.NavigateUrl, MSqlDbType.VarChar); cmd.Parameters.Add("AlternateText", p.AlternateText, MSqlDbType.NVarChar); cmd.Parameters.Add("Keyword", p.Keyword, MSqlDbType.NVarChar); 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("IsActive", p.IsActive, MSqlDbType.Bit); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Publish(string pID) { 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 yorum set yoneticionay=?yoneticionay,aktif=?aktif where id=?id", conneciton)) { cmd.Parameters.Add("id", pID, MSqlDbType.VarChar); cmd.Parameters.Add("yoneticionay", true, MSqlDbType.Boolean); cmd.Parameters.Add("aktif", true, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Update(Yorum 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 yorum set ip=?ip,modulid=?modulid,icerikid=?icerikid,adi=?adi,mail=?mail,icerik=?icerik,kayittarihi=?kayittarihi,yoneticionay=?yoneticionay,aktif=?aktif where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar); cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("icerikid", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); cmd.Parameters.Add("mail", p.Mail, MSqlDbType.VarChar); cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Gosterim Data Insert ///</summary> public static int Insert(Gosterim 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, "INSERT INTO Gosterim (HesapID,IP,ModulID,IcerikID,KayitTarihi) VALUES(@HesapID,@IP,@ModulID,@IcerikID,@KayitTarihi)", conneciton)) { cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Manset Data Update ///</summary> public static int Update(Manset 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 Manset SET ModulID=@ModulID,IcerikID=@IcerikID,ResimKucuk=@ResimKucuk,ResimUrl=@ResimUrl,Baslik=@Baslik,Aciklama=@Aciklama,KayitTarihi=@KayitTarihi,Aktif=@Aktif WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("ResimKucuk", p.ResimKucuk, MSqlDbType.VarChar); cmd.Parameters.Add("ResimUrl", p.ResimUrl, MSqlDbType.VarChar); cmd.Parameters.Add("Baslik", p.Baslik, MSqlDbType.NVarChar); cmd.Parameters.Add("Aciklama", p.Aciklama, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Manset Data Insert ///</summary> public static int Insert(Manset 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, "INSERT INTO Manset (ModulID,IcerikID,ResimKucuk,ResimUrl,Baslik,Aciklama,KayitTarihi,Aktif) VALUES(@ModulID,@IcerikID,@ResimKucuk,@ResimUrl,@Baslik,@Aciklama,@KayitTarihi,@Aktif)", conneciton)) { cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("ResimKucuk", p.ResimKucuk, MSqlDbType.VarChar); cmd.Parameters.Add("ResimUrl", p.ResimUrl, MSqlDbType.VarChar); cmd.Parameters.Add("Baslik", p.Baslik, MSqlDbType.NVarChar); cmd.Parameters.Add("Aciklama", p.Aciklama, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Begen Data Update ///</summary> public static int Update(Begen 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 Begen SET HesapID=@HesapID,IP=@IP,ModulID=@ModulID,IcerikID=@IcerikID,Durum=@Durum,KayitTarihi=@KayitTarihi WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("IcerikID", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("Durum", p.Durum, MSqlDbType.Bit); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Sayfa Data Update ///</summary> public static int Update(Sayfa 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 sayfa set hesapid=?hesapid,baslik=?baslik,icerik=?icerik,dil=?dil,kayittarihi=?kayittarihi,yerlesim=?yerlesim,aktif=?aktif where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.SmallInt); cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("baslik", p.Baslik, MSqlDbType.VarChar); cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.LongText); cmd.Parameters.Add("dil", p.Dil, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, 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> /// Sehir Data Insert ///</summary> public static int Insert(Sehir 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 sehir (adi) values(?adi)", conneciton)) { cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Update(Kategori 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.StoredProcedure, "Kategori_Update", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.VarChar); cmd.Parameters.Add("ParentID", p.ParentID, MSqlDbType.VarChar); cmd.Parameters.Add("ModulID", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar); cmd.Parameters.Add("Dil", p.Dil, MSqlDbType.VarChar); cmd.Parameters.Add("Sira", p.Sira, MSqlDbType.TinyInt); cmd.Parameters.Add("Tab", p.Tab, MSqlDbType.Bit); cmd.Parameters.Add("Menu", p.Menu, 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> /// CalismaAlani Data Insert ///</summary> public static int Insert(CalismaAlani 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, "if (@Varsayilan=1) begin UPDATE CalismaAlani SET Varsayilan=0 WHERE HesapID=@HesapID AND Varsayilan=1 end INSERT INTO CalismaAlani (HesapID,Kurum,Telefon,Adres,Semt,Sehir,WebSitesi,Randevu,Varsayilan,Aktif) VALUES(@HesapID,@Kurum,@Telefon,@Adres,@Semt,@Sehir,@WebSitesi,@Randevu,@Varsayilan,@Aktif)", conneciton)) { cmd.Parameters.Add("HesapID", p.HesapID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("Kurum", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Kurum.ToLower().Trim()), MSqlDbType.NVarChar); cmd.Parameters.Add("Telefon", p.Telefon, MSqlDbType.VarChar); cmd.Parameters.Add("Adres", p.Adres, MSqlDbType.NVarChar); cmd.Parameters.Add("Semt", System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(p.Semt.ToLower().Trim()), MSqlDbType.NVarChar); cmd.Parameters.Add("Sehir", p.Sehir.ToUpper().Trim(), MSqlDbType.NVarChar); cmd.Parameters.Add("WebSitesi", p.WebSitesi.Trim(), MSqlDbType.VarChar); cmd.Parameters.Add("Randevu", p.Randevu, MSqlDbType.Bit); cmd.Parameters.Add("Varsayilan", p.Varsayilan, 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> /// Astroloji Data Insert ///</summary> public static int Insert(System.String phesapid, byte pburcid, string picerik, DateTime pkayittarihi, bool pyoneticionay, bool paktif) { 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 astroloji (hesapid,burcid,icerik,kayittarihi,yoneticionay,aktif) values(?hesapid,?burcid,?icerik,?kayittarihi,?yoneticionay,?aktif)", conneciton)) { cmd.Parameters.Add("hesapid", phesapid, MSqlDbType.VarChar); cmd.Parameters.Add("burcid", pburcid, MSqlDbType.SmallInt); cmd.Parameters.Add("icerik", picerik, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", pkayittarihi, MSqlDbType.DateTime); cmd.Parameters.Add("yoneticionay", pyoneticionay, MSqlDbType.Boolean); cmd.Parameters.Add("aktif", paktif, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Remove(Int64 soruid) { 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, "delete from anketpuan where soruid=?soruid", conneciton)) { cmd.Parameters.Add("soruid", soruid, MSqlDbType.BigInt); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Astroloji Data Update ///</summary> public static int Update(Astroloji 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 astroloji set hesapid=?hesapid,burcid=?burcid,icerik=?icerik,kayittarihi=?kayittarihi,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("burcid", p.BurcID, MSqlDbType.SmallInt); cmd.Parameters.Add("icerik", p.Icerik, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Anket Data Update ///</summary> public static int Update(Anket 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 anket set anketid=?anketid,adi=?adi,kayittarihi=?kayittarihi,aktif=?aktif,resimurl=?resimurl,grup=?grup,yatay=?yatay where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.BigInt); cmd.Parameters.Add("anketid", p.AnketID, MSqlDbType.BigInt); cmd.Parameters.Add("adi", p.Adi, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("aktif", p.Aktif, MSqlDbType.Boolean); cmd.Parameters.Add("resimurl", p.ResimUrl, MSqlDbType.VarChar); cmd.Parameters.Add("grup", p.Grup, MSqlDbType.VarChar); cmd.Parameters.Add("yatay", p.Yatay, MSqlDbType.Boolean); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Update(Doviz p) { int rowsAffected = 0; 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, "Update Doviz SET Cinsi=@Cinsi,Kuru=@Kuru,Tarih=@Tarih where ID=@ID", conneciton)) { cmd.Parameters.Add("Cinsi", p.Cinsi.ToUpper(), MSqlDbType.VarChar); cmd.Parameters.Add("Kuru", p.Kuru, MSqlDbType.Float); cmd.Parameters.Add("Tarih", p.Tarih, MSqlDbType.DateTime); cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Yorum Data Update ///</summary> public static int Update(Yorum 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 Yorum SET IP=@IP,ModulID=@ModulID,IcerikID=@IcerikID,Adi=@Adi,Mail=@Mail,Icerik=@Icerik,KayitTarihi=@KayitTarihi,YoneticiOnay=@YoneticiOnay,Aktif=@Aktif WHERE ID=@ID", conneciton)) { cmd.Parameters.Add("ID", p.ID, MSqlDbType.UniqueIdentifier); cmd.Parameters.Add("IP", p.IP, MSqlDbType.VarChar); 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("Icerik", p.Icerik, MSqlDbType.NVarChar); cmd.Parameters.Add("KayitTarihi", p.KayitTarihi, MSqlDbType.DateTime); 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> /// Gosterim Data Update ///</summary> public static int Update(Gosterim 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 gosterim set hesapid=?hesapid,ip=?ip,modulid=?modulid,icerikid=?icerikid,kayittarihi=?kayittarihi where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.VarChar); cmd.Parameters.Add("hesapid", p.HesapID, MSqlDbType.VarChar); cmd.Parameters.Add("ip", p.IP, MSqlDbType.VarChar); cmd.Parameters.Add("modulid", p.ModulID, MSqlDbType.VarChar); cmd.Parameters.Add("icerikid", p.IcerikID, MSqlDbType.VarChar); cmd.Parameters.Add("kayittarihi", p.KayitTarihi, MSqlDbType.DateTime); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Delete(string modulID, string icerikID) { 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, "DELETE FROM Yorum WHERE ModulID=@ModulID AND IcerikID=@IcerikID", conneciton)) { cmd.Parameters.Add("ModulID", modulID, MSqlDbType.VarChar); cmd.Parameters.Add("IcerikID", icerikID, MSqlDbType.VarChar); rowsAffected = MConvert.NullToInt(cmd.ExecuteNonQuery()); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Update(Stok p) { int rowsAffected = 0; 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, "Update Stok SET KategoriID=@KategoriID,UrunID=@UrunID,FirmaID=@FirmaID,Fiyat=@Fiyat,KarOran=@KarOran,EklenmeTarihi=@EklenmeTarihi,GuncellemeTarihi=@GuncellemeTarihi where ID=@ID", 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); cmd.Parameters.Add("Fiyat", p.Fiyat, MSqlDbType.Float); cmd.Parameters.Add("KarOran", p.KarOran, MSqlDbType.Float); cmd.Parameters.Add("EklenmeTarihi", p.EklenmeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("GuncellemeTarihi", p.GuncellemeTarihi, MSqlDbType.DateTime); cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
///<summary> /// Makale Data Delete ///</summary> public static int Delete(Makale 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, "delete from makale where id=?id", conneciton)) { cmd.Parameters.Add("id", p.ID, MSqlDbType.BigInt); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }
public static int Update(Urun p) { int rowsAffected = 0; 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, "Update Urun SET Kod=@Kod,KategoriID=@KategoriID,Adi=@Adi,Miktar=@Miktar,Birim=@Birim,Kdv=@Kdv,Tarih=@Tarih where ID=@ID", conneciton)) { cmd.Parameters.Add("Kod", p.Kod, MSqlDbType.VarChar); cmd.Parameters.Add("KategoriID", p.KategoriID, MSqlDbType.Int); cmd.Parameters.Add("Adi", p.Adi, MSqlDbType.NVarChar); cmd.Parameters.Add("Miktar", p.Miktar, MSqlDbType.Float); cmd.Parameters.Add("Birim", p.Birim, MSqlDbType.VarChar); cmd.Parameters.Add("Kdv", p.Kdv, MSqlDbType.Float); cmd.Parameters.Add("Tarih", p.Tarih, MSqlDbType.DateTime); cmd.Parameters.Add("ID", p.ID, MSqlDbType.Int); rowsAffected = cmd.ExecuteNonQuery(); } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rowsAffected); }