Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
        if (stuffUser == null)
        {
            this.Response.Redirect("~/LogIn.aspx");
            return;

            string userName = User.Identity.Name;
            if (userName == null)
            {
                userName = "";
            }
            AuthorizationDS.StuffUserDataTable stable = new BusinessObjects.AuthorizationDSTableAdapters.StuffUserTableAdapter().GetDataByUserName(userName);
            if (stable.Count != 0)
            {
                Session["StuffUser"] = stable[0];
                stuffUser            = stable[0];
            }
            else
            {
                this.Response.Redirect("~/ErrorPage/NoRightErrorPage.aspx");
            }
        }
    }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AuthorizationDS.StuffUserRow stuffUser = (AuthorizationDS.StuffUserRow)Session["StuffUser"];
     if (stuffUser == null) {
         this.Response.Redirect("~/LogIn.aspx");
         return;
         string userName = User.Identity.Name;
         if (userName == null) {
             userName = "";
         }
         AuthorizationDS.StuffUserDataTable stable = new BusinessObjects.AuthorizationDSTableAdapters.StuffUserTableAdapter().GetDataByUserName(userName);
         if (stable.Count != 0) {
             Session["StuffUser"] = stable[0];
             stuffUser = stable[0];
         } else {
             this.Response.Redirect("~/ErrorPage/NoRightErrorPage.aspx");
         }
     }
 }