-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserProfileHome.aspx.cs
70 lines (59 loc) · 1.96 KB
/
UserProfileHome.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class
UserProfileHome : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["user_id"] == null)
{
Response.Redirect("~/Default.aspx");
}
load_news();
LoadLatestEvents();
}
public void load_news()
{
newsBO n_bo = new newsBO();
newsBAL n_bal = new newsBAL();
try
{
DataSet ds = n_bal.news_top3_BAL_view();
news.DataSource = ds;
news.DataBind();
}
catch (Exception ex)
{
ErrorReportBAL error = new ErrorReportBAL();
error.SendErrorReport("UserProfleHome.aspx", ex.ToString());
Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
}
}
public void LoadLatestEvents()
{
AdminFunctionsBAL viewTop5events = new AdminFunctionsBAL();
if (!(Page.IsPostBack))
{
try
{
top5EventsDL.DataSource = viewTop5events.TopFiveEvents();
top5EventsDL.DataBind();
}
catch (Exception ex)
{
ErrorReportBAL error = new ErrorReportBAL();
error.SendErrorReport("UserProfileHome.aspx", ex.ToString());
Response.Write("<script>alert('Some Error Occured \n Sorry for inconvenience');</script>");
}
}
}
protected String datelongformat(DateTime d)
{
return d.ToLongDateString();
}
}