Documentation et fiche préstataire
Une nouvelle page de doc : la page des fonctionalités, [Features.md](Features.md), au format Markdown. * p8-av4.jpg: * p8-av4.l.jpg: * p8-av4.xs.jpg: p8-av4 * Performer.ascx: Implémente la fiche préstataire, avec son éventuel lien vers le blog * ITContentProvider.csproj: ... * NpgsqlBlogProvider.cs: implémente le compteur de billet en base de données * Presta.csproj: * TestAPI.csproj: * YavscClient.csproj: * fortune.csproj: * WebControls.csproj: * SalesCatalog.csproj: * NpgsqlMRPProviders.csproj: * NpgsqlBlogProvider.csproj: * NpgsqlContentProvider.csproj: ... * README.md: mise à jour des priorités * Yavsc.sln: ajout du fichier "Features.md" à la solution * BlogProvider.cs: doc xml * BlogManager.cs: implémente un accès au compteur de billet
This commit is contained in:
parent
dbcbf8b318
commit
e8bf2dd8fa
32 changed files with 156 additions and 38 deletions
|
|
@ -15,11 +15,36 @@ namespace Npgsql.Web.Blog
|
|||
/// </summary>
|
||||
public class NpgsqlBlogProvider : BlogProvider
|
||||
{
|
||||
|
||||
|
||||
string applicationName;
|
||||
string connectionString;
|
||||
|
||||
#region implemented abstract members of BlogProvider
|
||||
|
||||
public override long GetPublicPostCount (string bloggerName)
|
||||
{
|
||||
long result = -1;
|
||||
using (NpgsqlConnection cnx = new NpgsqlConnection (connectionString))
|
||||
using (NpgsqlCommand cmd = cnx.CreateCommand ()) {
|
||||
cmd.CommandText = @"
|
||||
Select count(*)
|
||||
FROM blog b
|
||||
LEFT OUTER JOIN blog_access a ON a.post_id = b._id
|
||||
WHERE a.post_id IS NULL
|
||||
AND b.visible = TRUE
|
||||
AND b.username = :bname
|
||||
AND b.applicationname = :app
|
||||
|
||||
";
|
||||
cmd.Parameters.AddWithValue ("bname", bloggerName);
|
||||
cmd.Parameters.AddWithValue ("app", applicationName);
|
||||
cnx.Open ();
|
||||
result = (long) cmd.ExecuteScalar ();
|
||||
cnx.Close ();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the post.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue