public bool Update(CsPrice model) { var strSql = new StringBuilder(); strSql.Append("UPDATE CrabShop.dbo.[CsPrice] SET "); strSql.Append("PriceNumber = @PriceNumber,ProductId = @ProductId,PriceDate = @PriceDate"); strSql.Append(" WHERE PriceId = @PriceId"); return(DbClient.Excute(strSql.ToString(), model) > 0); }
public int Add(CsPrice model) { var strSql = new StringBuilder(); strSql.Append("INSERT INTO CrabShop.dbo.[CsPrice] ("); strSql.Append("PriceNumber,ProductId,PriceDate"); strSql.Append(") VALUES ("); strSql.Append("@PriceNumber,@ProductId,@PriceDate);"); strSql.Append("SELECT @@IDENTITY"); return(DbClient.ExecuteScalar <int>(strSql.ToString(), model)); }