protected void Page_Init(object sender, EventArgs e) { #region check roles Permission.PERMITTED_USER = (UsersClass)Session["USER_ACCOUNT"]; Permission.ROLES = (List <UserRole>)Session["USER_ROLES"]; StringBuilder strPermissionNotification = new StringBuilder(); strPermissionNotification.Append("Your Account do not have: <br />"); if (Permission.CanInsert() == false) { this.btnNewProductCategory.Enabled = false; pnlNotification.Visible = true; strPermissionNotification.Append(" - Permission to Insert/Add SOI.<br />"); } if (Permission.CanUpdate() == false) { this.btnUpdateProductCategory.Enabled = false; pnlNotification.Visible = true; strPermissionNotification.AppendLine(" - Permission to Update/Edit SOI.<br />"); } if (Permission.CanDelete() == false) { btnDelete.Enabled = false; pnlNotification.Visible = true; strPermissionNotification.AppendLine(" - Permission to Delete SOI.<br />"); } lblPermissionNotifications.Text = strPermissionNotification.ToString(); #endregion check roles }
protected void Page_Init(object sender, EventArgs e) { #region check roles Permission.PERMITTED_USER = (UsersClass)Session["USER_ACCOUNT"]; Permission.ROLES = (List <UserRole>)Session["USER_ROLES"]; StringBuilder strPermissionNotification = new StringBuilder(); strPermissionNotification.Append("Your Account do not have: <br />"); if (Permission.CanInsert() == false) { pnlNotification.Visible = true; strPermissionNotification.Append(" - Permission to Insert/Add Grouping.<br />"); } if (Permission.CanUpdate() == false) { this.btnUpdateBookAdjustment.Enabled = false; btnChangeGroup.Enabled = false; pnlNotification.Visible = true; strPermissionNotification.AppendLine(" - Permission to Update/Edit Grouping.<br />"); } if (Permission.CanDelete() == false) { btnDelete.Enabled = false; btnDeleteFromGroup.Enabled = false; pnlNotification.Visible = true; strPermissionNotification.AppendLine(" - Permission to Delete Grouping.<br />"); } lblPermissionNotifications.Text = strPermissionNotification.ToString(); #endregion DDLInvventoryGroups.Items.Clear(); foreach (var inv_group in this.invGroupManager.InventoryGroups()) { DDLInvventoryGroups.Items.Add(new ListItem(inv_group.GroupName, inv_group.InventoryGroupId.ToString())); } }