Files
yavsc/yavscModel/Blogs/BlogManager.cs
Paul Schneider 57a473aff8 Many changes :
* JsonReaderError.aspx: display a nice json conversion error

* CalendarEntryList.cs: new Google data for the calendar entries

* JsonReaderError.cs: Json error model

* README.md: Documentation url

* NpgsqlBlogProvider.cs: Update the blog post title

* BlogsController.cs: - Updating the blog post title
- bug fix rendering the avatar

* FrontOfficeController.cs: - the client cannot modify its estimation

* GoogleController.cs: - implementing the calendar entries retrieval

* HomeController.cs: - the home start page from configuration
  parameter named "StartPage"

* Global.asax.cs: - back to a clean global.asax

* style.css: showing the main area with a background transparent color

* Post.aspx: Bug fix: the message was displayed two times (we keep the
  one from app.master)

* UserPost.aspx: the blog title comes from the poster profile found in
  ViewData

* DateQuery.aspx: implementing the date query

* Web.config: the start page now comes from Web.config

* Web.csproj: the Sql db creation script should not be deployed,
  neither as package.config

* BlogManager.cs: updating the blog post title

* BlogProvider.cs: yavscModel/Blogs/BlogManager.cs


* YavscModel.csproj: new cs files to compile

* App.master: returning from the Google login
2015-01-06 10:15:24 +01:00

74 lines
2.0 KiB
C#

using System;
using Yavsc.Model.Blogs;
using Yavsc.Model.RolesAndMembers;
using System.Web;
namespace Yavsc.Model.Blogs
{
public static class BlogManager
{
public static long RemoveComment(long cmtid)
{
return Provider.RemoveComment (cmtid);
}
public static void Comment (string from, long postid, string content, bool visible)
{
provider.Comment (from, postid, content);
}
static BlogProvider provider;
public static BlogProvider Provider {
get {
if (provider == null)
provider = BlogHelper.GetProvider();
return provider;
}
}
public static BlogEntry GetPost (string username, string title)
{
return Provider.GetPost (username, title );
}
public static BlogEntry GetPost(long postid)
{
return Provider.GetPost (postid);
}
public static void Post(string username, string title, string content, bool visible)
{
Provider.Post(username, title, content, visible );
}
public static void UpdatePost(long postid, string title, string content, bool visible)
{
Provider.UpdatePost(postid, title, content, visible);
}
public static BlogEntryCollection FindPost (string pattern, FindBlogEntryFlags searchflags, int pageIndex, int pageSize, out int totalRecords)
{
return Provider.FindPost (pattern, searchflags, pageIndex, pageSize, out totalRecords);
}
public static void RemovePost (string username, string title)
{
Provider.RemovePost (username, title);
}
public static BlogEntryCollection LastPosts (int pageIndex, int pageSize, out int totalRecords)
{
return Provider.LastPosts (pageIndex, pageSize, out totalRecords);
}
public static Comment[] GetComments(long postid, bool getHidden=true)
{
return Provider.GetComments (postid,getHidden);
}
/// <summary>
/// Tag the specified post by postid.
/// </summary>
/// <param name="postid">Postid.</param>
/// <returns>The tag identifier</returns>
public static long Tag(long postid, string tag) {
return Provider.Tag (postid, tag);
}
}
}