示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                pnlAccountTxsDashboard.Visible   = false;
                pnlAddAccountTxs.Visible         = false;
                pnlManageAccountTxTitles.Visible = false;
                //Get user role
                if (User.Identity.IsAuthenticated)
                {
                    string strID = User.Identity.Name;
                    //string strRole  = lnUser.GetUserRole(strID);
                    if (User.IsInRole("Admin"))
                    {
                        lblRole.Text = "Admin";
                    }
                    if (User.IsInRole("Manager"))
                    {
                        lblRole.Text = "Manager";
                    }
                    if (User.IsInRole("Accounts"))
                    {
                        lblRole.Text = "Accounts";
                    }
                }

                //In case the logged in role is Admin then display delete button.
                if (User.IsInRole("Admin"))
                {
                    BD.DataBindToDataGrid(dgExistingAccountTxTitles, "SELECT * FROM EduSphere.AccountTxTitles");
                }
                else
                {
                    BD.DataBindToDataGrid(dgExistingAccountTxTitlesView, "SELECT * FROM EduSphere.AccountTxTitles");
                }

                //Show business Indicators without user intervention
                //ShowIndicatorsDashboard();
            }
        }