protected void Page_Load(object sender, EventArgs e)
    {

        RadTreeNode parentNode = ((administrator_administrator)this.Master).Menu.FindNodeByValue(beans.JobEnum.StaffGroupManagement.ToString());
        parentNode.Expanded = true;
        RadTreeNode childNode = parentNode.Nodes.FindNodeByValue("List");
        if (childNode != null)
            childNode.ImageUrl = "images/map_e.png";

        

        int groupId = 0;
        if (!int.TryParse(Request["group"], out groupId))
        {
            Response.Redirect("staff_groups.aspx", true);
            return;
        }
        ISession session = (ISession)Context.Items[Constant.NHibernateSessionSign];
        Player staff = session.Load<Player>(Session[Constant.StaffUserSessionSign]);
        this.StaffGroup = session.Get<StaffGroup>(groupId);
        if (this.StaffGroup == null)
        {
            Response.Redirect("staff_groups.aspx", true);
            return;
        }

        if (IsPostBack)
            return;
        
        this.rptGroupStaffs.DataSource = ServicesList.StaffManagementService.GetStaffGroupMembers(staff, this.StaffGroup, session);
        this.rptGroupStaffs.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {

        ISession session = (ISession)Context.Items[Constant.NHibernateSessionSign];
        Player staff = session.Load<Player>(Session[Constant.StaffUserSessionSign]);

        int groupId = 0;
        if (!int.TryParse(Request["group"], out groupId))
        {
            Response.Redirect("staff_groups.aspx", true);
            return;
        }

        this.StaffGroup = session.Get<StaffGroup>(groupId);
        if (this.StaffGroup == null)
        {
            Response.Redirect("staff_groups.aspx", true);
            return;
        }

        if (IsPostBack)
            return;

        RadTreeNode parentNode = ((administrator_administrator)this.Master).Menu.FindNodeByValue(beans.JobEnum.StaffGroupManagement.ToString());
        parentNode.Expanded = true;
        RadTreeNode childNode = parentNode.Nodes.FindNodeByValue("List");
        if (childNode != null)
            childNode.ImageUrl = "images/map_e.png";

        

        

        this.txtGroupName.Text = this.StaffGroup.Name;

        Permission numeric = (from permission in this.StaffGroup.Permissions
                              where permission.Job == JobEnum.NumericSettings.ToString()
                              select permission).SingleOrDefault<Permission>();
        this.chkNumeric.Checked = (numeric != null);

        Permission text = (from permission in this.StaffGroup.Permissions
                              where permission.Job == JobEnum.TextSettings.ToString()
                              select permission).SingleOrDefault<Permission>();
        this.chkText.Checked = (text != null);

        Permission restart = (from permission in this.StaffGroup.Permissions
                              where permission.Job == JobEnum.RestartServer.ToString()
                              select permission).SingleOrDefault<Permission>();
        this.chkRestartServer.Checked = (restart != null);

        Permission staffManagement = (from permission in this.StaffGroup.Permissions
                                      where permission.Job == JobEnum.StaffGroupManagement.ToString()
                                      select permission).SingleOrDefault<Permission>();
        this.chkStaffManagement.Checked = (staffManagement != null);
        this.txtStaffPrivilege.Text = this.chkStaffManagement.Checked ? staffManagement.Privilage : "";

        Permission memberManagement = (from permission in this.StaffGroup.Permissions
                                       where permission.Job == JobEnum.MemberManagement.ToString()
                                       select permission).SingleOrDefault<Permission>();
        this.chkMemberManagement.Checked = (memberManagement != null);
        this.txtMemberPrivilege.Text = this.chkMemberManagement.Checked ? memberManagement.Privilage : "";
        
    }