protected void Page_Load(object sender, EventArgs e) { //check login int UserId = 0; if (Request.Cookies["VC"] != null) { string VC = Request.Cookies["VC"].Values["VC"]; Classes.LoginSession ls = new Classes.LoginSession(); UserId = ls.getUserId(VC); if (UserId == 0) //if user not logged in redirect to login { Response.Redirect("~/Login/Messages"); } else { Session["UserId"] = UserId.ToString(); } } else { Response.Redirect("~/Login/Messages"); } //all read Classes.Messages m = new Classes.Messages(); m.allRead(UserId); //get message lists DataTable dt = m.messageLists(UserId); if (dt.Rows.Count == 0) { LabelNoRecord.Visible = true; } else { RepeaterMessages.DataSource = dt; RepeaterMessages.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { //check login int UserId = 0; if (Request.Cookies["VC"] != null) { string VC = Request.Cookies["VC"].Values["VC"]; Classes.LoginSession ls = new Classes.LoginSession(); UserId = ls.getUserId(VC); if (UserId == 0) //if user not logged in redirect to login { Response.Redirect("~/Login/Messages"); } else { Session["UserId"] = UserId.ToString(); } } else { Response.Redirect("~/Login/Messages"); } //all read Classes.Messages m = new Classes.Messages(); m.allRead(UserId); //get message lists DataTable dt = m.messageLists(UserId); if (dt.Rows.Count == 0) { LabelNoRecord.Visible = true; } else { RepeaterMessages.DataSource = dt; RepeaterMessages.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { //check login int UserId = 0; if (Session["UserId"] != null) { UserId = Convert.ToInt32(Session["UserId"]); } else { if (Request.Cookies["VC"] != null) { string VC = Request.Cookies["VC"].Values["VC"]; Classes.LoginSession ls = new Classes.LoginSession(); UserId = ls.getUserId(VC); if (UserId == 0) //if user not logged in redirect to login { Response.Redirect("~/Login/Messages"); } else { Session["UserId"] = UserId.ToString(); } } else { Response.Redirect("~/Login/Messages"); } } //check user status string completionValue = Session["DoneCompletion"] as string; if (String.IsNullOrEmpty(completionValue)) { Classes.UserInfo ui = new Classes.UserInfo(); int userStatus = ui.getUserStatus(UserId); switch (userStatus) { case 1: Session["DoneCompletion"] = "1"; break; case 0: case 4: Response.Redirect("~/Completion"); break; case 2: Response.Redirect("~/Error/UserDisabled"); break; case 3: Response.Redirect("~/Error/UserDeactivated"); break; } } //all read Classes.Messages m = new Classes.Messages(); m.allRead(UserId); //get message lists DataTable dt = m.messageLists(UserId); if (dt.Rows.Count == 0) { HiddenFieldStatus.Value = "0"; } else { RepeaterMessages.DataSource = dt; RepeaterMessages.DataBind(); HiddenFieldStatus.Value = "1"; } }
protected void Page_Load(object sender, EventArgs e) { //check login int UserId = 0; if (Session["UserId"] != null) { UserId = Convert.ToInt32(Session["UserId"]); } else { if (Request.Cookies["VC"] != null) { string VC = Request.Cookies["VC"].Values["VC"]; Classes.LoginSession ls = new Classes.LoginSession(); UserId = ls.getUserId(VC); if (UserId == 0) //if user not logged in redirect to login { Response.Redirect("~/Login/Messages"); } else { Session["UserId"] = UserId.ToString(); } } else { Response.Redirect("~/Login/Messages"); } } //check user status string completionValue = Session["DoneCompletion"] as string; if (String.IsNullOrEmpty(completionValue)) { Classes.UserInfo ui = new Classes.UserInfo(); int userStatus = ui.getUserStatus(UserId); switch (userStatus) { case 1: Session["DoneCompletion"] = "1"; break; case 0: case 4: Response.Redirect("~/Completion"); break; case 2: Response.Redirect("~/Error/UserDisabled"); break; case 3: Response.Redirect("~/Error/UserDeactivated"); break; } } //all read Classes.Messages m = new Classes.Messages(); m.allRead(UserId); //get message lists DataTable dt = m.messageLists(UserId); if (dt.Rows.Count == 0) { HiddenFieldStatus.Value = "0"; } else { RepeaterMessages.DataSource = dt; RepeaterMessages.DataBind(); HiddenFieldStatus.Value = "1"; } }