public PostViewModel(PostHandler _post, string search, int page, int pageLimit) : base(_post, page, pageLimit) { Posts = _post.PostsForSearch(search, page - 1, pageLimit); TotalPostsForPage = Posts.Count; TotalPosts = _post.TotalPostsForSearch(search); }
public PostViewModel(PostHandler _post, int page, int pageLimit) : base(_post, page, pageLimit) { Posts = _post.PostsForPage(page - 1, pageLimit); TotalPostsForPage = Posts.Count; TotalPosts = _post.TotalPosts(); }
public TagViewModel(TagHandler _tag, string tagSlug, PostHandler _post, int page, int pageLimit) : base(_post, page, pageLimit) { Tag = _tag.Tag(tagSlug); Posts = _post.PostsForTag(tagSlug, page - 1, pageLimit); TotalPosts = _post.TotalPostsForTag(tagSlug); TotalPostsForPage = Posts.Count; }
public CategoryViewModel(CategoryHandler _category, string categorySlug, PostHandler _post, int page, int pageLimit) : base(_post, page, pageLimit) { Posts = _post.PostsForCategory(categorySlug, page - 1, pageLimit); TotalPosts = _post.TotalPostsForCategory(categorySlug); Category = _category.Category(categorySlug); TotalPostsForPage = Posts.Count; }
protected void Page_Load(object sender, EventArgs e) { handler = new PostHandler(); if (!string.IsNullOrEmpty((string)Session["StatusMessage"])) { string message = (string)Session["StatusMessage"]; Session["StatusMessage"] = null; MessageLabel.Visible = true; MessageLabel.Text = message; } }
static void Main(string[] args) { logger.Debug("Application start"); CategoryHandler catHandler = new CategoryHandler(); IList<Category> categories = catHandler.Categories(); foreach (var category in categories) Console.WriteLine(category.Id + ". " + category.Name); CommentHandler comHandler = new CommentHandler(); IList<Comment> comments = comHandler.UserComments(1); foreach (var comment in comments) Console.WriteLine(comment.Id + ". " + comment.Text); PostHandler postHandler = new PostHandler(); IList<Post> posts = postHandler.Posts(); foreach (var post in posts) Console.WriteLine(post.Id + ". " + post.Comments.Count + " " + post.PostedOn.ToShortDateString()); TagHandler tagHandler = new TagHandler(); IList<Tag> tags = tagHandler.Tags(); foreach (var tag in tags) Console.WriteLine(tag.Name); UserHandler userHandler = new UserHandler(); IList<User> users = userHandler.AuthorUsers(); foreach (var user in users) Console.WriteLine(user.Id + ". " + user.Login + " " + user.Password); logger.Debug("Application loaded succesfully"); Console.ReadLine(); }
protected void Page_Load(object sender, EventArgs e) { postHandler = new PostHandler(); commentHandler = new CommentHandler(); }
public CategoryController() { _category = new CategoryHandler(); _post = new PostHandler(); }
public PostController() { _post = new PostHandler(); }
public InfoController() { _post = new PostHandler(); }
public TagsController() { _tag = new TagHandler(); _post = new PostHandler(); }
public BaseViewModel(PostHandler _post, int page, int pageLimit) { PageLimit = pageLimit; }