protected void Page_Load(object sender, EventArgs e)
 {
     if(!this.IsPostBack)
     {
         if(Session["ACCOUNT"] == null)
         {
             Response.Redirect("/index.aspx");
         }
         else
         {
             gm = new GroupManagement();
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         if (Session["ACCOUNT"] == null)
         {
             Response.Redirect("/index.aspx");
         }
         else
         {
             gm = new GroupManagement();
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            account = (Account)this.Session["Account"];
            if(account != null)
            {
                if(!this.IsPostBack)
                {
                    gm = new GroupManagement();
                    switch(account.Role)
                    {
                        case AccountType.Admin:
                            {
                                lbxGroups.DataSource = gm.Groups;
                                lbxGroups.DataBind();
                                lbxAccounts.DataSource = gm.Groups[lbxGroups.SelectedIndex].Users;
                                lbxAccounts.DataBind();
                                break;
                            }
                        case AccountType.User:
                            {
                                ownerGroups = gm.OwnerGroups(account);
                                lbxGroups.DataSource = ownerGroups;
                                lbxGroups.DataBind();
                                lbxAccounts.DataSource = ownerGroups[lbxAccounts.SelectedIndex];
                                lbxAccounts.DataBind();
                                break;
                            }
                    }
                }
            }
            else
            {
                Response.Redirect("/Index.aspx");

            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            account = (Account)this.Session["Account"];
            if (account != null)
            {
                if (!this.IsPostBack)
                {
                    gm = new GroupManagement();
                    switch (account.Role)
                    {
                    case AccountType.Admin:
                    {
                        lbxGroups.DataSource = gm.Groups;
                        lbxGroups.DataBind();
                        lbxAccounts.DataSource = gm.Groups[lbxGroups.SelectedIndex].Users;
                        lbxAccounts.DataBind();
                        break;
                    }

                    case AccountType.User:
                    {
                        ownerGroups          = gm.OwnerGroups(account);
                        lbxGroups.DataSource = ownerGroups;
                        lbxGroups.DataBind();
                        lbxAccounts.DataSource = ownerGroups[lbxAccounts.SelectedIndex];
                        lbxAccounts.DataBind();
                        break;
                    }
                    }
                }
            }
            else
            {
                Response.Redirect("/Index.aspx");
            }
        }