protected void Page_Load(object sender, EventArgs e) { var item = new ListItem("--请选择球会--", Guid.Empty.ToString()); ddlClub.DataSource = ClubLogic.GetActiveClubs(); ddlClub.DataTextField = "FullName"; ddlClub.DataValueField = "ID"; ddlClub.DataBind(); ddlClub.Items.Insert(0, item); if (ClubID != -1) { ddlClub.SelectedValue = ClubID.ToString(); } ctrlAdminFieldToolBar.AdminUserName = username; BindClubHistory(); }
private void BindClubListData() { if (clubList == null) { clubList = ClubLogic.GetActiveClubs(); } //if (userid == -1) //{ // //hide func button // gvClubList.Columns[gvClubList.Columns.Count - 1].Visible = false; //} //else if (ClubLogic.GetActiveUserClubs(userid).Count != 0) //{ // gvClubList.Columns[gvClubList.Columns.Count - 1].Visible = false; //} //clubList.Sort(new ClubComparer()); gvClubList.DataSource = clubList; gvClubList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { var club = ClubLogic.GetClubInfo(ClubID); if (club != null && Title.IndexOf("{0}") >= 0) { Title = string.Format(Title, club.FullName); } #region SetControlProperty ctrlLeftPanel.UserID = userid; ctrlLeftPanel.UserName = username; ctrlLeftPanel.UserKey = userkey; ctrlFieldToolBar.UserID = userid; ctrlFieldToolBar.UserName = username; ctrlManageMenuTabBar.CurrentMenu = ManageClubMenuItem.ManageMember; ctrlManageMenuTabBar.UserID = userid; #endregion if (!IsPostBack) { #region Bind ddlGroup var list = ClubLogic.GetActiveClubs(); if (list != null && list.Count > 0) { ddlClub.DataSource = list; ddlClub.DataTextField = "FullName"; ddlClub.DataValueField = "ID"; ddlClub.DataBind(); var item = new ListItem("--请选择球会--", string.Empty); ddlClub.Items.Insert(0, item); } else { ddlClub.Visible = false; } #endregion // Administrators could enter this page if (ConfigAdmin.IsPluginAdmin(userid)) { pnlInaccessible.Visible = false; phContent.Visible = true; //init gridview BindData(); } else { var userClub = ClubLogic.GetActiveUserClub(userid, ClubID); if (userClub != null && userClub.Responsibility.HasValue) { if (userClub.Responsibility.Value.Equals((int)Responsibility.Executor) || userClub.Responsibility.Value.Equals((int)Responsibility.Manager)) { pnlInaccessible.Visible = false; phContent.Visible = true; //init gridview BindData(); } else { pnlInaccessible.Visible = true; phContent.Visible = false; } } else { pnlInaccessible.Visible = true; phContent.Visible = false; } } } }