protected void Page_Load(object sender, EventArgs e) { DurationManage dr = new DurationManage(); if (dr.Header() || dr.Dean()) { Session["OtherCarryUserName"] = HttpContext.Current.User.Identity.Name; Response.Redirect("~/CarryShowOnly/CarryCalculateMain.aspx"); } AssessmentSystemsDBDataContext db = new AssessmentSystemsDBDataContext(); var q = (from p in db.Users where p.UserName == HttpContext.Current.User.Identity.Name select p.Prefix.Prefix1 + "" + p.FirstName + " " + p.LastName).First(); FullName.InnerText = q; }
protected void Page_Load(object sender, EventArgs e) { setDefaultPage(); if (HttpContext.Current.User.Identity.Name != "") { DurationManage dm = new DurationManage(); if (Roles.IsUserInRole(User.Identity.Name, "Admin")) { Response.Redirect("~/Admin/Admin_DefaultPage.aspx"); } else if (Roles.IsUserInRole(User.Identity.Name, "Dean")) { btnProfessor.Visible = true; try { if (dm.Dean()) { btnDean.Visible = true; } } catch (Exception) { } } else if (Roles.IsUserInRole(User.Identity.Name, "Header")) { btnProfessor.Visible = true; try { if (dm.Header()) { btnHeader.Visible = true; } } catch (Exception) { } } else if (Roles.IsUserInRole(User.Identity.Name, "Professor")) { btnProfessor.Visible = true; } Session["UserName"] = HttpContext.Current.User.Identity.Name; try { Session["DurationID"] = dm.getDurationId(); Session["PreviousDurationID"] = dm.getPreviousDurationId(); } catch (Exception) { Session["DurationID"] = dm.getPreviousDurationId(); Session["PreviousDurationID"] = dm.getPreviousDurationId()-1; } AssessmentSystemsDBDataContext db = new AssessmentSystemsDBDataContext(); try { var q = (from p in db.Users where p.UserName == HttpContext.Current.User.Identity.Name select p.DeptId).First(); Session["DeptId"] = q; } catch (Exception) { } } }