-
Notifications
You must be signed in to change notification settings - Fork 0
/
PersonInfoTree.aspx.cs
35 lines (29 loc) · 1023 Bytes
/
PersonInfoTree.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class PersonInfoTree : System.Web.UI.Page
{
public MyFamilyDatabaseDataContext _db;
public PersonInfo _PersonInfo;
public PersonInfo _LogedInUserInfo;
protected void Page_Load(object sender, EventArgs e)
{
_db = new MyFamilyDatabaseDataContext();
int id;
if (!int.TryParse(Request["PersonID"], out id))
id = 9;
_PersonInfo = _db.PersonInfos.Where(p => p.PersonID == id).FirstOrDefault();
_LogedInUserInfo = Session["LogedInUserInfo"] as PersonInfo;
if (_LogedInUserInfo != null)
{
lblLogin.Text = string.Format("Welcome <a href='./PersonInfo.aspx?PersonID={0}'>{1}</a>", _LogedInUserInfo.PersonID, _LogedInUserInfo.FullName);
}
else
{
lblLogin.Text = "<a href='./LoginPage.aspx'>Login</a>";
}
}
}