public static int Delete(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, "delete from reklam 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> /// Reklam Data PrimaryKey ///</summary> public static Reklam GetReklam(int pid) { Reklam rvReklam = new Reklam(); 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 reklam where id=?id", conneciton)) { cmd.Parameters.Add("id", pid, MSqlDbType.Int); using (IDataReader IDR = cmd.ExecuteReader()) { while (IDR.Read()) { rvReklam = 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.NullToString(IDR["adsenseclient"]), MConvert.NullToString(IDR["adsenseslot"]), MConvert.NullToInt(IDR["impressions"]), MConvert.NullToInt(IDR["width"]), MConvert.NullToInt(IDR["height"]), IDR.GetByte(11), MConvert.NullToBool(IDR["isactive"])); } IDR.Close(); } } switch (conneciton.State) { case System.Data.ConnectionState.Open: conneciton.Close(); break; } } return(rvReklam); }
///<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 void Remove(Reklam obj) { this.List.Remove(obj); }
public int IndexOf(Reklam obj) { return(this.List.IndexOf(obj)); }
public bool Contains(Reklam obj) { return(this.List.Contains(obj)); }
public void Insert(int index, Reklam obj) { this.List.Insert(index, obj); }
public int Add(Reklam obj) { return(this.List.Add(obj)); }