protected void Page_Load(object sender, EventArgs e) { #region SetControlProperty ctrlLeftPanel.UserID = userid; ctrlLeftPanel.UserName = username; ctrlLeftPanel.UserKey = userkey; ctrlFieldToolBar.UserID = userid; ctrlFieldToolBar.UserName = username; ctrlMenuTabBar.CurrentMenu = ClubMenuItem.ClubRank; ctrlMenuTabBar.ClubID = ClubID; ctrlClubSysHeader.UserID = userid; ctrlClubSysHeader.ClubID = ClubID; ctrlClubSysHeader.UserName = username; #endregion var currentClub = ClubLogic.GetClubInfo(ClubID); if (currentClub != null && Title.IndexOf("{0}") >= 0) { Title = string.Format(Title, currentClub.FullName); } if (currentClub != null) { var memberCount = ClubLogic.GetClubMemberCount(ClubID); var memberQuota = ClubLogic.GetClubMemberQuota(ClubID); var ra = new RankAlgorithm(currentClub); ltrlMemberCount.Text = $"<cite class=\"RankLevel\"><a style=\"width: {(ra.MemberCountRank*2)}px\">{ra.MemberCountRank}%</a></cite><em>{memberCount}//{memberQuota}</em>"; ltrlClubFortune.Text = $"<cite class=\"RankLevel\"><a style=\"width: {(ra.ClubFortuneRank*2)}px\">{ra.ClubFortuneRank}%</a></cite><em>{Convert.ToInt32(currentClub.Fortune).ToString("N0")}</em>"; ltrlMemberCredit.Text = $"<cite class=\"RankLevel\"><a style=\"width: {(ra.MemberCreditRank*2)}px\">{ra.MemberCreditRank}%</a></cite><em>{Convert.ToInt32(currentClub.MemberCredit).ToString("N0")}</em>"; ltrlMemberRP.Text = $"<cite class=\"RankLevel\"><a style=\"width: {(ra.MemberRPRank*2)}px\">{ra.MemberRPRank}%</a></cite><em>{Convert.ToInt32(currentClub.MemberRP).ToString("N0")}</em>"; ltrlEquipmentCount.Text = $"<cite class=\"RankLevel\"><a style=\"width: {(ra.MemberEquipmentRank*2)}px\">{ra.MemberEquipmentRank}%</a></cite><em>C:{PlayerStrip.GetClubMemberCardCount(currentClub.ID.Value)}|V:{PlayerStrip.GetClubMemberVideoCount(currentClub.ID.Value)}</em>"; ltrlRankScore.Text = currentClub.RankScore.ToString(); } }
//#region ICallbackEventHandler Members //public string GetCallbackResult() //{ // if (_clubID > 0 && _clientStatus >= 0) // { // UserClubStatus uct = (UserClubStatus)_clientStatus; // UserClubStatus resultStatus = UserClubStatus.No; // if ((int)ClubLogic.GetUserClubStatus(this.userid, _clubID) == _clientStatus) // { // //action = apply, check if club appliable flag // if (uct == UserClubStatus.No) // { // Arsenalcn.ClubSys.Entity.Club club = ClubLogic.GetClubInfo(_clubID); // if (club != null) // { // if (!club.IsAppliable.Value) // { // return "Not Appliable"; // } // } // else // { // return string.Empty; // } // } // if (UserClubLogic.UserClubAction(this.userid, this.username, _clubID, uct)) // { // switch (uct) // { // case UserClubStatus.Applied: // resultStatus = UserClubStatus.No; // break; // case UserClubStatus.Member: // resultStatus = UserClubStatus.No; // break; // case UserClubStatus.No: // resultStatus = UserClubStatus.Applied; // break; // default: // break; // } // return string.Format("{0};{1}", _clubID, (int)resultStatus); // } // else // return string.Empty; // } // else // return string.Empty; // } // else // return string.Empty; //} //private int _clubID = -1; //private int _clientStatus = -1; //public void RaiseCallbackEvent(string eventArgument) //{ // string[] param = eventArgument.Split(';'); // if (param.Length == 2) // { // _clubID = int.Parse(param[0]); // _clientStatus = int.Parse(param[1]); // } //} //#endregion protected void gvClubList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var club = (Club)e.Row.DataItem; var count = ClubLogic.GetClubMembers(club.ID.Value).Count; var ltrlMemberCount = e.Row.FindControl("ltrlMemberCount") as Literal; ltrlMemberCount.Text = count.ToString(); var ltrlClubLogo = e.Row.FindControl("ltrlClubLogo") as Literal; var ltrlClubName = e.Row.FindControl("ltrlClubName") as Literal; var ltrlClubRank = e.Row.FindControl("ltrlClubRank") as Literal; var ltrlActionText = e.Row.FindControl("ltrlActionText") as Literal; var ltrlStatus = e.Row.FindControl("ltrlStatus") as Literal; //Literal ltrlButtonDisplay = e.Row.FindControl("ltrlButtonDisplay") as Literal; var ltrlIsAppliable = e.Row.FindControl("ltrlIsAppliable") as Literal; var ltrlEquipmentCount = e.Row.FindControl("ltrlEquipmentCount") as Literal; ltrlClubLogo.Text = string.Format( "<a href=\"ClubView.aspx?ClubID={0}\" title=\"{2}\"><img src=\"UploadFiles/{1}\" alt=\"{2}\" width=\"80\" height=\"80\" /></a>", club.ID, club.LogoName, club.FullName); ltrlClubName.Text = $"<a href=\"ClubView.aspx?ClubID={club.ID}\" class=\"StrongLink\" title=\"{HttpUtility.HtmlEncode(club.Slogan).Replace("'", "\"")}\">{club.FullName}</a>"; ltrlClubRank.Text = $"<a href=\"ClubRank.aspx?ClubID={club.ID}\" class=\"StrongLink\">RPos:{club.RankScore}</a><div class=\"ClubSys_Rank\" style=\"width: {(club.RankLevel*20)}px;\"></div>"; ltrlEquipmentCount.Text = $"<em title=\"卡片数C|视频数V(今日库存)\">{PlayerStrip.GetClubMemberCardCount(club.ID.Value)}|{PlayerStrip.GetClubMemberVideoCount(club.ID.Value)}({PlayerStrip.GetClubRemainingEquipment(club.ID.Value)})</em>"; if (!club.IsAppliable.Value) { ltrlIsAppliable.Visible = true; } else { ltrlIsAppliable.Visible = false; } if (ConfigGlobal.ChampionsClubID > 0 && club.ID == ConfigGlobal.ChampionsClubID) { ltrlClubName.Text = $"<div class=\"ClubSys_Crown\" title=\"{ConfigGlobal.ChampionsTitle}\"></div><div>{ltrlClubName.Text}</div>"; } //if (userid == -1 || club.ManagerUid == userid) //{ // ltrlButtonDisplay.Text = "none"; //} //else //{ // ltrlButtonDisplay.Text = "inline"; //} // the count of clubs which current user has joined exceed max quota, hide join action //if (ClubLogic.GetActiveUserClubs(userid).Count >= Config.SingleUserMaxClubCount && uct != UserClubStatus.Member) //{ // ltrlButtonDisplay.Text = "none"; //} //hide join btn if club is set to not appliable to join //if (uct == UserClubStatus.No && (!club.IsAppliable.Value || count >= ClubLogic.GetClubMemberQuota(club.ID.Value))) //{ // ltrlButtonDisplay.Text = "none"; //} //ltrlStatus.Text = ((int)uct).ToString(); //switch (uct) //{ // case UserClubStatus.Applied: // ltrlActionText.Text = "取消申请"; // break; // case UserClubStatus.Member: // ltrlActionText.Text = "退出球会"; // break; // case UserClubStatus.No: // ltrlActionText.Text = "申请加入"; // break; // default: // ltrlActionText.Text = "申请加入"; // break; //} var rptLeader = e.Row.FindControl("rptClubLeads") as Repeater; if (rptLeader != null) { var uc = ClubLogic.GetClubLeads(club.ID.Value); foreach (var userClub in uc) { userClub.AdditionalData = ClubLogic.TranslateResponsibility(userClub.Responsibility.Value); //temp usage of username for li class if (userClub.Responsibility.Value == (int)Responsibility.Manager) { userClub.AdditionalData2 = " class=\"Manager\""; } else { userClub.AdditionalData2 = string.Empty; } } rptLeader.DataSource = uc; rptLeader.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { #region SetControlProperty ctrlLeftPanel.UserID = userid; ctrlLeftPanel.UserName = username; ctrlLeftPanel.UserKey = userkey; ctrlFieldToolBar.UserID = userid; ctrlFieldToolBar.UserName = username; ctrlMenuTabBar.CurrentMenu = ClubMenuItem.ClubInfo; ctrlMenuTabBar.ClubID = ClubID; ctrlClubSysHeader.UserID = userid; ctrlClubSysHeader.ClubID = ClubID; ctrlClubSysHeader.UserName = username; #endregion var currentClub = ClubLogic.GetClubInfo(ClubID); if (currentClub != null && Title.IndexOf("{0}", StringComparison.Ordinal) >= 0) { Title = string.Format(Title, currentClub.FullName); } if (currentClub != null) { ltrlShortName.Text = currentClub.ShortName; ltrlCreatorName.Text = $"<a href=\"MyPlayerProfile.aspx?userid={currentClub.CreatorUid.Value}\" target = \"_blank\" >{currentClub.CreatorUserName}</ a >"; //ltrlCreatorUid.Text = currentClub.CreatorUid.Value.ToString(); ltrlSlogan.Text = HttpUtility.HtmlEncode(currentClub.Slogan); ltrlFortune.Text = Convert.ToInt32(currentClub.Fortune).ToString("N0"); ltrlMemberCredit.Text = Convert.ToInt32(currentClub.MemberCredit).ToString("N0"); ltrlMemberFortune.Text = Convert.ToInt32(currentClub.MemberFortune).ToString("N0"); //ltrlEquipmentCount.Text = Convert.ToInt32(PlayerStrip.GetClubMemberEquipmentCount(currentClub.ID.Value)).ToString("N0"); ltrlEquipmentCount.Text = $"C:{PlayerStrip.GetClubMemberCardCount(currentClub.ID.Value)} | V:{PlayerStrip.GetClubMemberVideoCount(currentClub.ID.Value)}"; ltrlCreateDate.Text = currentClub.CreateDate.ToString("yyyy年MM月dd日"); ltrlDays.Text = (DateTime.Now - currentClub.CreateDate).Days.ToString(); ltrlMemeberCount.Text = ClubLogic.GetClubMemberCount(ClubID).ToString(); ltrlMemberQuota.Text = ClubLogic.GetClubMemberQuota(ClubID).ToString(); if (currentClub.IsAppliable.Value) { ltrlAppliable.Text = "开放中"; } else { ltrlAppliable.Text = "已关闭"; } var uc = ClubLogic.GetClubLeads(ClubID); foreach (var userClub in uc) { userClub.AdditionalData = ClubLogic.TranslateResponsibility(userClub.Responsibility.Value); //temp usage of username for li class if (userClub.Responsibility.Value == (int)Responsibility.Manager) { userClub.AdditionalData2 = " class=\"Manager\""; } else { userClub.AdditionalData2 = string.Empty; } } rptClubLeads.DataSource = uc; rptClubLeads.DataBind(); } }