-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHealthReg.aspx.cs
44 lines (41 loc) · 1.48 KB
/
HealthReg.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class HealthReg : System.Web.UI.Page
{
clsHealthInfo HeInfo = new clsHealthInfo();
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserId"] == null)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Session Timed Out! Please update your health later from the console to help us serve you better.');window.location ='Login.aspx';", true);
}
else
{
HeInfo.Age = Session["UserAge"].ToString();
}
}
protected void btnUserSumbit_Click(object sender, EventArgs e)
{
if (Session["UserId"] != null)
{
int id = Convert.ToInt32(Session["UserId"].ToString());
HeInfo.UserId = id.ToString();
HeInfo.Height = txtHt.Text.ToString();
HeInfo.Weight = txtWt.Text.ToString();
HeInfo.HeartRate = txtHrtRt.Text.ToString();
HeInfo.SugarLevel = txtSgrLvl.Text.ToString();
HeInfo.Cholestrol = txtChLvl.Text.ToString();
HeInfo.Platelet = txtPlt.Text.ToString();
HeInfo.trackHealth(id);
Response.Redirect("UserView.aspx?pg=uv");
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Session Expired! Please login again.');window.location ='Login.aspx';", true);
}
}
}