-
Notifications
You must be signed in to change notification settings - Fork 1
/
findallrecipecommentedbyuser.aspx.cs
103 lines (82 loc) · 3.21 KB
/
findallrecipecommentedbyuser.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#region XD World Recipe V 2.8
// FileName: findallrecipecommentedbyuser.cs
// Author: Dexter Zafra
// Date Created: 5/19/2008
// Website: www.ex-designz.net
#endregion
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using XDRecipe.UI;
using XDRecipe.BL;
using XDRecipe.BL.Providers.Recipes;
using XDRecipe.Common;
using XDRecipe.Model;
using XDRecipe.Common.Utilities;
public partial class findallrecipecommentedbyuser : BasePage
{
private Utility Util
{
get { return new Utility(); }
}
private string strAuthorName;
private int OrderBy;
protected void Page_Load(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(this.Request.QueryString["ob"]))
{
OrderBy = (int)Util.Val(Request.QueryString["ob"]);
lblsortname.Text = Util.GetSortOptionName(OrderBy);
}
else
{
lblsortname.Text = "";
}
strAuthorName = Request.QueryString["commentauthor"].ToString();
string strmetaTag = "Recipe(s) commented by: " + strAuthorName;
GetMetaTitleTagKeywords(strmetaTag);
BindList();
}
private void BindList()
{
strAuthorName = Request.QueryString["commentauthor"].ToString();
OrderBy = (int)Util.Val(Request.QueryString["ob"]);
string ParamURL = Request.CurrentExecutionFilePath + "?commentauthor=" + strAuthorName;
int GetPage = (int)Util.Val(Request.QueryString["page"]);
int iPage = 1;
if (!string.IsNullOrEmpty(this.Request.QueryString["page"]))
iPage = (int)Util.Val(Request.QueryString["page"]);
int PageSize = PagerLinks.DefaultPageSize;
int PageIndex = iPage;
ProvidersGetAllRecipeCommentedbyUser GetRecipe = ProvidersGetAllRecipeCommentedbyUser.GetInstance();
GetRecipe.Param(strAuthorName, OrderBy, 0, PageIndex, PageSize);
PagerLinks Pager = PagerLinks.GetInstance();
Pager.PagerLinksParam(PageIndex, PageSize, GetRecipe.RecordCount);
lblcount.Text = "(" + GetRecipe.RecordCount.ToString() + ") recipes found commented by (<b>" + strAuthorName + "</b>)";
lbPagerLink.Text = Pager.DisplayNumericPagerLink(ParamURL, OrderBy, 0, GetPage);
lblRecpagetop.Text = Pager.GetTopRightPagerCounterCustomPaging;
lblRecpage.Text = Pager.GetBottomPagerCounterCustomPaging;
RecipeCat.DataSource = GetRecipe.GetAllRecipeCommentedByAuthorResult();
RecipeCat.DataBind();
}
private void GetMetaTitleTagKeywords(string AlphaLetterName)
{
Page.Header.Title = AlphaLetterName;
HtmlMeta metaTag = new HtmlMeta();
metaTag.Name = "Keywords";
metaTag.Content = AlphaLetterName;
this.Header.Controls.Add(metaTag);
}
public void RecipeCat_ItemDataBound(Object s, RepeaterItemEventArgs e)
{
Utility.GetIdentifyItemNewPopular(Convert.ToDateTime(DataBinder.Eval(e.Item.DataItem, "Date")), e,
(int)DataBinder.Eval(e.Item.DataItem, "Hits"));
}
}