示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     OutputTable.Rows.Clear();
     if (!this.Page.User.Identity.IsAuthenticated)
     {
         FormsAuthentication.RedirectToLoginPage();
     }
     else
     {
         ClubBaistSystem system    = new ClubBaistSystem();
         UserPermission  upCurrent = new UserPermission();
         upCurrent = system.GetUser(Page.User.Identity.Name);
         if (upCurrent.EmployeeFlag)
         {
             //User is employee so load all features. (Admin User can change username)
             tbUser.Enabled = true;
         }
         else if (upCurrent.ApprovedFlag)
         {
             //User is standard user so load single user only functions. (Cannot change username)
             tbUser.Text    = Page.User.Identity.Name;
             tbUser.Enabled = false;
         }
         else
         {
             //User is not employee or approved so don't do anything.
             wizSearchReservation.Visible = false;
         }
     }
 }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.User.Identity.IsAuthenticated)
     {
         FormsAuthentication.RedirectToLoginPage();
     }
     else
     {
         //Need to know if employee or standard user, hopefully a quick select will be fine?
         system    = new ClubBaistSystem();
         upCurrent = new UserPermission();
         loc       = new LocHour();
         upCurrent = system.GetUser(Page.User.Identity.Name);
         if (upCurrent.EmployeeFlag)
         {
             //User is employee so load all features. (Admin User can change username)
             tbUser.Enabled = true;
         }
         else if (upCurrent.ApprovedFlag)
         {
             //User is standard user so load single user only functions. (Cannot change username)
             tbUser.Text    = Page.User.Identity.Name;
             tbUser.Enabled = false;
         }
         else
         {
             //User is not employee or approved so don't do anything. Disable the wizard completely.
             wizAddReservation.Enabled = false;
             wizAddReservation.Visible = false;
         }
     }
 }