Ejemplo n.º 1
0
 public bool SaveTplCfg(TplCfgInfo info)
 {
     int maxBannerSequence = this.GetMaxBannerSequence();
     StringBuilder builder = new StringBuilder("insert into  Hishop_Banner (ShortDesc,ImageUrl,DisplaySequence,LocationType,Url,Type,IsDisable)");
     builder.Append("values (@ShortDesc,@ImageUrl,@DisplaySequence,@LocationType,@Url,@Type,@IsDisable)");
     DbCommand sqlStringCommand = this.database.GetSqlStringCommand(builder.ToString());
     this.database.AddInParameter(sqlStringCommand, "ShortDesc", DbType.String, info.ShortDesc);
     this.database.AddInParameter(sqlStringCommand, "ImageUrl", DbType.String, info.ImageUrl);
     this.database.AddInParameter(sqlStringCommand, "DisplaySequence", DbType.String, maxBannerSequence);
     this.database.AddInParameter(sqlStringCommand, "LocationType", DbType.Int32, (int) info.LocationType);
     this.database.AddInParameter(sqlStringCommand, "Url", DbType.String, info.Url);
     this.database.AddInParameter(sqlStringCommand, "Type", DbType.Int32, info.Type);
     this.database.AddInParameter(sqlStringCommand, "IsDisable", DbType.Boolean, info.IsDisable);
     return (this.database.ExecuteNonQuery(sqlStringCommand) > 0);
 }
Ejemplo n.º 2
0
 public bool UpdateTplCfg(TplCfgInfo info)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("update Hishop_Banner set ");
     builder.Append("ShortDesc=@ShortDesc,");
     builder.Append("ImageUrl=@ImageUrl,");
     builder.Append("DisplaySequence=@DisplaySequence,");
     builder.Append("LocationType=@LocationType,");
     builder.Append("Url=@Url,");
     builder.Append("Type=@Type,");
     builder.Append("IsDisable=@IsDisable");
     builder.Append(" where BannerId=@BannerId ");
     DbCommand sqlStringCommand = this.database.GetSqlStringCommand(builder.ToString());
     this.database.AddInParameter(sqlStringCommand, "BannerId", DbType.Int32, info.Id);
     this.database.AddInParameter(sqlStringCommand, "ShortDesc", DbType.String, info.ShortDesc);
     this.database.AddInParameter(sqlStringCommand, "ImageUrl", DbType.String, info.ImageUrl);
     this.database.AddInParameter(sqlStringCommand, "DisplaySequence", DbType.String, info.DisplaySequence);
     this.database.AddInParameter(sqlStringCommand, "LocationType", DbType.Int32, (int) info.LocationType);
     this.database.AddInParameter(sqlStringCommand, "Url", DbType.String, info.Url);
     this.database.AddInParameter(sqlStringCommand, "Type", DbType.Int32, info.Type);
     this.database.AddInParameter(sqlStringCommand, "IsDisable", DbType.Boolean, info.IsDisable);
     return (this.database.ExecuteNonQuery(sqlStringCommand) > 0);
 }
Ejemplo n.º 3
0
 public static bool UpdateTplCfg(TplCfgInfo info)
 {
     return new BannerDao().UpdateTplCfg(info);
 }
Ejemplo n.º 4
0
 public static bool SaveTplCfg(TplCfgInfo info)
 {
     return new BannerDao().SaveTplCfg(info);
 }