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; ctrlMenuTabBar.CurrentMenu = ClubMenuItem.ClubMemeber; ctrlMenuTabBar.ClubID = ClubID; ctrlClubSysHeader.UserID = userid; ctrlClubSysHeader.ClubID = ClubID; ctrlClubSysHeader.UserName = username; #endregion BindMemberList(); }
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); } if (!IsPostBack) { LoadPageData(); } #region SetControlProperty ctrlLeftPanel.UserID = userid; ctrlLeftPanel.UserName = username; ctrlLeftPanel.UserKey = userkey; ctrlFieldToolBar.UserID = userid; ctrlFieldToolBar.UserName = username; ctrlManageMenuTabBar.CurrentMenu = ManageClubMenuItem.ManageClub; ctrlManageMenuTabBar.UserID = userid; #endregion }
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; ctrlMenuTabBar.CurrentMenu = ClubMenuItem.ClubStrip; ctrlMenuTabBar.ClubID = ClubID; ctrlClubSysHeader.UserID = userid; ctrlClubSysHeader.ClubID = ClubID; ctrlClubSysHeader.UserName = username; #endregion BindStripHistory(); ltlClubBingoStrip.Text = $"<span title=\"抽取装备计数\">今天(累计)尝试:<em>{PlayerStrip.GetClubBingoPlayCountToday(ClubID)}({PlayerStrip.GetClubBingoPlayCount(ClubID).ToString("N0")})</em>次 | 库存:<em>{PlayerStrip.GetClubRemainingEquipment(ClubID)}/{ConfigGlobal.DailyClubEquipmentCount}</em>件装备</span>"; ltlClubStripCount.Text = $"<span class=\"ClubSys_Strip SHIRT\">球衣:</span><em>{ShirtCount}</em><span class=\"ClubSys_Strip SHORTS\">球裤:</span><em>{ShortsCount}</em><span class=\"ClubSys_Strip SOCK\">球袜:</span><em>{SockCount}</em><span class=\"ClubSys_Strip CARD\">球星卡:</span><em>{CardCount}</em><span class=\"ClubSys_Strip VIDEO\">视频卡:</span><em>{VideoCount}</em>"; }
protected void Page_Load(object sender, EventArgs e) { var club = ClubLogic.GetClubInfo(ClubID); var userInfo = Users.GetUserInfo(ToUserID); if (club != null && userInfo != null && Title.IndexOf("{0}") >= 0 && Title.IndexOf("{1}") >= 0) { Title = string.Format(Title, club.FullName, userInfo.Username.Trim()); } rvMaxCash.MaximumValue = "1"; #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) { LoadPageData(); } }
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(); } }
protected void gvClubMemberList_RowCommand(object sender, GridViewCommandEventArgs e) { try { if (e.CommandName == "KickUser") { var _kickUserID = Convert.ToInt32(e.CommandArgument.ToString()); var club = ClubLogic.GetClubInfo(ClubID); var userClub = ClubLogic.GetActiveUserClub(userid, ClubID); if (userClub != null && club != null) { if (userClub.Responsibility.HasValue && (userClub.Responsibility.Equals((int)Responsibility.Manager) || userClub.Responsibility.Equals((int)Responsibility.Executor))) { if (club.ManagerUid == _kickUserID) { throw new Exception("您没有权限解约此会员"); } //kick user logic UserClubLogic.LeaveClub(_kickUserID, ClubID, true, username); ClientScript.RegisterClientScriptBlock(typeof(string), "success", "alert('球会已与此会员成功解约');", true); BindData(); } else { throw new Exception("您没有权限解约此会员"); } } else { throw new Exception("该用户已不是该球会会员"); } } } catch (Exception ex) { ClientScript.RegisterClientScriptBlock(typeof(string), "failed", $"alert('{ex.Message}');", true); } }
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; ctrlMenuTabBar.CurrentMenu = ClubMenuItem.ClubPlayer; ctrlMenuTabBar.ClubID = ClubID; ctrlClubSysHeader.UserID = userid; ctrlClubSysHeader.ClubID = ClubID; ctrlClubSysHeader.UserName = username; #endregion ClubPlayerLvCount = new Dictionary <int, int>(); for (var i = 0; i <= (ConfigGlobal.PlayerMaxLv + 1); i++) { ClubPlayerLvCount[i] = 0; } BindPlayers(); ltlPlayerCount.Text = $"<span>本球会正式/总球员数:<em>{FormalPlayerCount}/{PlayerStrip.GetClubPlayerCount(ClubID)}</em></span>"; ltlPlayerLv.Text = $"<span>>LV5:{ClubPlayerLvCount[ConfigGlobal.PlayerMaxLv + 1]}</span>"; for (var j = ConfigGlobal.PlayerMaxLv; j > 0; j--) { ltlPlayerLv.Text += string.Format(" <span class=\"ClubSys_PlayerLV{0}\">LV{0}:{1}</span>", j, ClubPlayerLvCount[j]); } }
protected void LoadPageData() { //UserClub ucFrom = ClubLogic.GetActiveUserClubs(this.userid); //UserClub ucTo = ClubLogic.GetActiveUserClub(ToUserID, ClubID); var userFrom = Users.GetUserInfo(userid); var userTo = Users.GetUserInfo(ToUserID); if (userid != ToUserID) { var list = ClubLogic.GetUserManagedClubs(userid); if (list != null && list.Count > 0) { pnlInaccessible.Visible = false; phContent.Visible = true; var club = ClubLogic.GetClubInfo(ClubID); lblTransferInfo.Text = string.Format("<em>{1}</em>转账给会员<em>{0} {2}</em>,您现拥有枪手币<em>{3}</em>", club.FullName, userFrom.Username.Trim(), userTo.Username.Trim(), userFrom.Extcredits2.ToString("N2")); ltrlFromUserInfo.Text = $"<em>{userFrom.Username.Trim()}</em>(金钱:{userFrom.Extcredits2.ToString("N2")} | RP:{userFrom.Extcredits4})"; ltrlToUserInfo.Text = $"<em>{userTo.Username.Trim()}</em>(金钱:{userTo.Extcredits2.ToString("N2")} | RP:{userTo.Extcredits4})"; lblMaxTransfer.Text = $" *最多为可转账<em>{(userFrom.Extcredits2*0.5f).ToString("N0")}</em>枪手币 "; rvMaxCash.MaximumValue = Convert.ToInt32(userFrom.Extcredits2 * 0.5f).ToString(); } else { pnlInaccessible.Visible = true; lblTips.Text = "您没有转帐权限。"; phContent.Visible = false; } } else { pnlInaccessible.Visible = true; lblTips.Text = "您不能对自己转账。"; phContent.Visible = false; } }
protected void btnSave_Click(object sender, EventArgs e) { var club = ClubLogic.GetCreateClubApplicationByUserID(userid); var sameNameClub = ClubLogic.GetClubInfo(tbFullName.Text); if (club != null) { if (club.FullName == tbFullName.Text) { ClubLogic.UpdateApplyClub(club.ID.Value, tbFullName.Text, tbShortName.Text, tbSlogan.Text, tbDesc.Text, userid, username); } else { if (sameNameClub != null) { var script = "alert('该球会名已被使用!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "name_used", script, true); } else { ClubLogic.UpdateApplyClub(club.ID.Value, tbFullName.Text, tbShortName.Text, tbSlogan.Text, tbDesc.Text, userid, username); } } } else { if (sameNameClub != null) { var script = "alert('该球会名已被使用!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "name_used", script, true); } else { ClubLogic.ApplyClub(tbFullName.Text, tbShortName.Text, tbSlogan.Text, tbDesc.Text, userid, username); } } var scriptSaved = "alert('申请已提交!'); window.location.href = window.location.href;"; ClientScript.RegisterClientScriptBlock(typeof(string), "saved", scriptSaved, true); }
protected void gvHistoryLog_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var ch = (Entity.ClubHistory)e.Row.DataItem; var club = ClubLogic.GetClubInfo(ch.ClubID); if (club != null) { var ltrlClubName = e.Row.FindControl("ltrlClubName") as Literal; if (ltrlClubName != null) { ltrlClubName.Text = club.FullName; } } } }
protected void Page_Load(object sender, EventArgs e) { var club = ClubLogic.GetClubInfo(ClubID); if (club != null) { if (club.ManagerUid.Value != UserID) { liManageClub.Visible = false; } else { liManageClub.Visible = true; } } else { Response.Redirect("ClubPortal.aspx"); } }
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; ctrlManageMenuTabBar.CurrentMenu = ManageClubMenuItem.ManageApplication; ctrlManageMenuTabBar.UserID = userid; #endregion #region Callback Reference var callbackReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "GetResult", "context"); var callbackScript = $"function ApproveJoin(arg, context){{ {callbackReference} }};"; Page.ClientScript.RegisterClientScriptBlock(typeof(string), "action", callbackScript, true); #endregion var club = ClubLogic.GetClubInfo(ClubID); if (club != null && Title.IndexOf("{0}") >= 0) { Title = string.Format(Title, club.FullName); } if (!IsPostBack) { LoadPageData(); } }
protected void Page_Load(object sender, EventArgs e) { int gRank; if (int.TryParse(ddlGoalRank.SelectedValue, out gRank)) { Response.Redirect($"ClubVideoView.aspx?ClubID={ClubID}&GRank={gRank}"); } 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; ctrlMenuTabBar.CurrentMenu = ClubMenuItem.ClubVideo; ctrlMenuTabBar.ClubID = ClubID; ctrlClubSysHeader.UserID = userid; ctrlClubSysHeader.ClubID = ClubID; ctrlClubSysHeader.UserName = username; #endregion BindVideo(); }
protected void Page_Load(object sender, EventArgs e) { var clubs = ClubLogic.GetActiveUserClubs(userid); if (clubs.Count == 0) { //user without a club joined can not access this page var script = "alert('您尚未加入一个球会!'); window.location.href = 'ClubPortal.aspx';"; ClientScript.RegisterClientScriptBlock(typeof(string), "redirect", script, true); } else { ClubID = clubs[0].ID.Value; } if (ClubID > 0) { if (PlayerStrip.GetClubRemainingEquipment(ClubID) <= 0) { //ctrlGoogleAdv.DisplayAdv = "none"; cbGoogleAdvActive.Visible = false; pnlShowGetStrip.Visible = false; lblGetStripUserInfo.Visible = false; lblGetStripNotAvailable.Visible = true; lblGetStripNotAvailable.Text = $"<em>今天本球会的装备领取已到上限。({ConfigGlobal.DailyClubEquipmentCount})</em>"; } else if (PlayerStrip.GetUserBingoGainCountToday(userid) >= ConfigGlobal.DailyUserEquipmentCount) { //ctrlGoogleAdv.DisplayAdv = "none"; cbGoogleAdvActive.Visible = false; pnlShowGetStrip.Visible = false; lblGetStripUserInfo.Visible = false; lblGetStripNotAvailable.Visible = true; lblGetStripNotAvailable.Text = $"<em>您今天的装备领取已到上限。({ConfigGlobal.DailyUserEquipmentCount})</em>"; } else { pnlShowGetStrip.Visible = true; lblGetStripUserInfo.Visible = true; lblGetStripNotAvailable.Visible = false; if (IsPostBack) { PlayerStrip.UpdatePlayerGoogleAdvActive(UserID, cbGoogleAdvActive.Checked); } BindGetStrip(); } 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; //ctrlMenuTabBar.CurrentMenu = Arsenalcn.ClubSys.Web.Control.ClubMenuItem.ClubStrip; //ctrlMenuTabBar.ClubID = _clubID; ctrlPlayerHeader.UserID = userid; ctrlPlayerHeader.ProfileUserID = ProfileUserID; #endregion } }
protected void LoadPageData() { var club = ClubLogic.GetClubInfo(ClubID); if (club != null) { // Current User must be the manager of this club or Administrator if (club.ManagerUid.Value.Equals(userid) || ConfigAdmin.IsPluginAdmin(userid)) { pnlInaccessible.Visible = false; phContent.Visible = true; //Init Form ltrlClubName.Text = club.FullName; ltrlClubManagerName.Text = club.ManagerUserName; ltrlFullName.Text = club.FullName; ltrlShortName.Text = club.ShortName; if (club.IsAppliable.Value) { rblAppliable.SelectedValue = "true"; } else { rblAppliable.SelectedValue = "false"; } tbManager.Text = club.ManagerUserName; if (club.RankLevel == 0) { phExecutor.Visible = false; } else { phExecutor.Visible = true; var users = ClubLogic.GetClubLeads(ClubID); var sbEx = new StringBuilder(); foreach (var user in users) { if (user.Responsibility.Value == (int)Responsibility.Executor) { sbEx.AppendFormat("{0}|", user.UserName); } } if (sbEx.Length != 0) { sbEx.Remove(sbEx.Length - 1, 1); } tbExecutor.Text = sbEx.ToString(); } tbSlogan.Text = club.Slogan; tbDesc.Text = club.Description; if (club.LogoName != string.Empty) { ltrlLogo.Visible = true; ltrlLogo.Text = string.Format( "<a href=\"{0}\" target=\"_blank\" title=\"点击放大\"><img src=\"{0}\" width=\"24\" height=\"24\" alt=\"点击放大\" /></a>", "UploadFiles/" + club.LogoName); } else { ltrlLogo.Visible = false; } } else { pnlInaccessible.Visible = true; phContent.Visible = false; } } else { pnlInaccessible.Visible = true; phContent.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (clubID > 0) { if (aManageClub.HRef.IndexOf("{0}") >= 0) { aManageClub.HRef = string.Format(aManageClub.HRef, clubID); } var currentClub = ClubLogic.GetClubInfo(clubID); if (currentClub != null) { imgClubLogo.ImageUrl = $"../UploadFiles/{currentClub.LogoName}"; imgClubLogo.ToolTip = currentClub.FullName; ltrlClubFullName.Text = currentClub.FullName; var clubDesc = HttpUtility.HtmlEncode(currentClub.Description); if (clubDesc.Length > 80) { ltrlClubDesc.Text = $"<span title=\"{clubDesc}\">{clubDesc.Substring(0, 80)}...</span>"; } else { ltrlClubDesc.Text = clubDesc; } divClubRank.Style.Add("Width", $"{currentClub.RankLevel*20}px"); divClubRank.Attributes.Add("Title", currentClub.RankScore.ToString()); if (userID == -1) { //anonymous user aManageClub.Visible = false; btnCancelApply.Visible = false; btnJoinClub.Visible = false; btnLeaveClub.Visible = false; btnGetStrip.Visible = false; } else { var ucs = ClubLogic.GetUserClubStatus(userID, clubID); switch (ucs) { case UserClubStatus.Applied: btnCancelApply.Visible = true; btnJoinClub.Visible = false; btnLeaveClub.Visible = false; break; case UserClubStatus.Member: btnCancelApply.Visible = false; btnJoinClub.Visible = false; btnLeaveClub.Visible = true; break; case UserClubStatus.No: btnCancelApply.Visible = false; btnJoinClub.Visible = true; btnLeaveClub.Visible = false; break; default: btnCancelApply.Visible = false; btnJoinClub.Visible = false; btnLeaveClub.Visible = false; break; } //manager can not leave a club if (currentClub.ManagerUid.Value == userID) { btnLeaveClub.Visible = false; } // the count of clubs which current user has joined exceed max quota, hide join action if (ClubLogic.GetActiveUserClubs(userID).Count >= ConfigGlobal.SingleUserMaxClubCount && ucs != UserClubStatus.Member) { btnJoinClub.Visible = false; btnCancelApply.Visible = false; } if (!currentClub.IsAppliable.Value || ClubLogic.GetClubMemberCount(clubID) >= ClubLogic.GetClubMemberQuota(clubID)) { btnJoinClub.Visible = false; } var userClub = ClubLogic.GetActiveUserClub(userID, clubID); if (userClub != null) { //current user is a member of the club if (userClub.Responsibility == (int)Responsibility.Manager || userClub.Responsibility == (int)Responsibility.Executor) { aManageClub.Visible = true; } else { aManageClub.Visible = false; } } else { //user is not a member of the club aManageClub.Visible = false; btnGetStrip.Visible = false; } } } else { Response.Redirect("ClubPortal.aspx"); } } else { Response.Redirect("ClubPortal.aspx"); } }
protected void linkButtonSave_Click(object sender, EventArgs e) { if (fuLogo.PostedFile.ContentLength != 0) { var logoName = fuLogo.FileName; if (logoName.ToLower().LastIndexOf(".gif") != logoName.Length - 4 && logoName.ToLower().LastIndexOf(".jpg") != logoName.Length - 4 && logoName.ToLower().LastIndexOf(".png") != logoName.Length - 4) { //invalid logo file var invalidAlert = "alert('请上传扩展名为gif,jpg或png的文件!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "invalid_logo_file", invalidAlert, true); LoadPageData(); return; } if (fuLogo.FileBytes.LongLength > 100 * 1024) { var fileLengthAlert = "alert('请上传小于100K的文件!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "file_too_large", fileLengthAlert, true); LoadPageData(); return; } } //validate assignment var club = ClubLogic.GetClubInfo(ClubID); //check manager if (tbManager.Text != club.ManagerUserName) { //check new manager existance in discuz if (Users.GetUserId(tbManager.Text) <= 0) { //alert var script = "alert('会长用户在系统中不存在!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "user_not_exist", script, true); LoadPageData(); return; } var managerID = Users.GetUserId(tbManager.Text); //check if the new manager is a member of the club, if not, alert if (ClubLogic.GetActiveUserClub(managerID, ClubID) == null) { var script = "alert('新会长必须为该球会成员!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "user_not_member", script, true); LoadPageData(); return; } } //check executor if (tbExecutor.Text == string.Empty) { //change current executor to normal member var users = ClubLogic.GetClubLeads(ClubID); foreach (var userClub in users) { if (userClub.Responsibility == (int)Responsibility.Executor) { //save no executor UserClubLogic.ChangeResponsibility(userClub.Userid.Value, userClub.UserName, ClubID, Responsibility.Member, username); } } } else { //check each executor existance var executors = tbExecutor.Text.Split('|'); //check club max executor count if (executors.Length > ClubLogic.GetClubExecutorQuota(ClubID)) { //alert var script = "alert('干事数超过限额!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "executor_count_exceed", script, true); LoadPageData(); return; } foreach (var executor in executors) { var executorName = executor.Trim(); if (executorName == club.ManagerUserName) { //alert var script = "alert('干事不能为该球会会长!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "user_not_manager", script, true); LoadPageData(); return; } if (Users.GetUserId(executorName) <= 0) { //alert var script = "alert('干事用户在系统中不存在!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "user_not_exist", script, true); LoadPageData(); return; } var executorID = Users.GetUserId(executorName); if (ClubLogic.GetActiveUserClub(executorID, ClubID) == null) { var script = "alert('干事必须为该球会成员!');"; ClientScript.RegisterClientScriptBlock(typeof(string), "user_not_member", script, true); LoadPageData(); return; } } var leaders = ClubLogic.GetClubLeads(ClubID); //save executor foreach (var executor in executors) { var executorName = executor.Trim(); var executorID = Users.GetUserId(executorName); if (leaders.Exists(delegate(UserClub uc) { return(uc.Userid == executorID); })) { // current executor has been an executor already } else { UserClubLogic.ChangeResponsibility(executorID, executorName, ClubID, Responsibility.Executor, username); } } foreach (var leader in leaders) { if (leader.Responsibility.Value != (int)Responsibility.Manager) { if (Array.Exists(executors, delegate(string executor) { return(executor == leader.UserName); })) { //current leader is in the new leader list } else { UserClubLogic.ChangeResponsibility(leader.Userid.Value, leader.UserName, ClubID, Responsibility.Member, username); } } } } //update info ClubLogic.UpdateClubInfo(ClubID, fuLogo.PostedFile, tbSlogan.Text, tbDesc.Text, bool.Parse(rblAppliable.SelectedValue), null); var scriptSaved = "alert('信息已保存');"; ClientScript.RegisterClientScriptBlock(typeof(string), "saved", scriptSaved, true); LoadPageData(); }
protected void Page_Load(object sender, EventArgs e) { if (ClubID > 0) { //output club info var club = ClubLogic.GetClubInfo(ClubID); if (club != null) { var ra = new RankAlgorithm(club); var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.AppendFormat("<RankChart ClubID=\"{0}\" RankPoint=\"{1}\">", club.ID, club.RankScore); xmlContent.AppendFormat("<RankItem name=\"会员数\" value=\"{0}\" />", ra.MemberCountRank); xmlContent.AppendFormat("<RankItem name=\"总财富\" value=\"{0}\" />", ra.ClubFortuneRank); xmlContent.AppendFormat("<RankItem name=\"总积分\" value=\"{0}\" />", ra.MemberCreditRank); xmlContent.AppendFormat("<RankItem name=\"总RP值\" value=\"{0}\" />", ra.MemberRPRank); xmlContent.AppendFormat("<RankItem name=\"装备数\" value=\"{0}\" /></RankChart>", ra.MemberEquipmentRank); Response.Write(xmlContent.ToString()); } } else if (UserID > 0) { //output player info and public video info var player = PlayerStrip.GetPlayerInfo(UserID); if (player != null) { var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); var playerLv = player.Shirt; if (player.Shorts < playerLv) { playerLv = player.Shorts; } if (player.Sock < playerLv) { playerLv = player.Sock; } xmlContent.AppendFormat("<UserItems username=\"{0}\" userid=\"{1}\" userlv=\"{2}\" ", player.UserName, player.UserID, ((playerLv > ConfigGlobal.PlayerMaxLv) ? ConfigGlobal.PlayerMaxLv + "+" : playerLv.ToString())); var CardCount = PlayerStrip.GetMyNumbers(UserID).Count; var VideoCount = UserVideo.GetUserVideosByUserID(UserID).Count; var InactiveCount = PlayerStrip.GetMyNumbers(UserID) .FindAll(delegate(Card c) { return(!c.ArsenalPlayerGuid.HasValue); }) .Count; xmlContent.AppendFormat( "ShirtCount=\"{0}\" ShortsCount=\"{1}\" SockCount=\"{2}\" CardCount=\"{3}\" VideoCount=\"{4}\">", player.Shirt, player.Shorts, player.Sock, CardCount - InactiveCount, VideoCount + InactiveCount); xmlContent.AppendFormat("<UserVideo>"); //DataView dv = Service.UserVideo.GetUserPublicVideo(UserID); var list = UserVideo.GetUserVideosByUserID(UserID) .FindAll(delegate(UserVideo uv) { return(uv.IsPublic); }); foreach (var uv in list) { object _value; var v = Video.Cache.Load(uv.VideoGuid); if (v != null) { var p = Player.Cache.Load(v.GoalPlayerGuid.Value); if (p != null) { xmlContent.Append("<VideoItem "); // build UserVideo xml info foreach ( var properInfo in uv.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { // remove the property VideoGuid of UserVideo if (!properInfo.Name.Equals("VideoGuid")) { _value = properInfo.GetValue(uv, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } } // build ArsenalVideo xml info foreach ( var properInfo in v.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { _value = properInfo.GetValue(v, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } // build ArsenalPlayer xml info foreach ( var properInfo in p.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { _value = properInfo.GetValue(p, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } xmlContent.Append("></VideoItem>"); } } } xmlContent.Append("</UserVideo>"); xmlContent.Append("<UserCard>"); var cards = PlayerStrip.GetMyNumbers(UserID); cards.RemoveAll(delegate(Card un) { return(!un.ArsenalPlayerGuid.HasValue); }); foreach (var c in cards) { xmlContent.Append("<CardItem "); xmlContent.AppendFormat("UserNumberID=\"{0}\" IsActive=\"{1}\" ", c.ID, c.IsActive); var p = Player.Cache.Load(c.ArsenalPlayerGuid.Value); object _value; foreach ( var properInfo in p.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { _value = properInfo.GetValue(p, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } xmlContent.Append("></CardItem>"); } xmlContent.Append("</UserCard>"); xmlContent.Append("</UserItems>"); Response.Write(xmlContent.ToString()); } } else if (PlayerGuid != null) { //output arsenal player info //DataRow rowInfo = Arsenal_Player.Cache.GetInfo(new Guid(PlayerGuid)); var p = Player.Cache.Load(new Guid(PlayerGuid)); object _value; if (p != null) { var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.Append("<PlayerInfo "); foreach (var properInfo in p.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { _value = properInfo.GetValue(p, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } xmlContent.Append("></PlayerInfo>"); Response.Write(xmlContent.ToString()); } } else if (CardID > 0) { var c = PlayerStrip.GetUserNumber(CardID); if (c != null) { //output arsenal player info if (c.ArsenalPlayerGuid.HasValue) { //DataRow rowInfo = Arsenal_Player.Cache.GetInfo(c.ArsenalPlayerGuid.Value); var p = Player.Cache.Load(c.ArsenalPlayerGuid.Value); object _value; if (p != null) { var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.AppendFormat("<CardInfo CardID=\"{0}\" ", CardID); foreach ( var properInfo in p.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance) ) { _value = properInfo.GetValue(p, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } xmlContent.Append("></CardInfo>"); Response.Write(xmlContent.ToString()); } } else { var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.AppendFormat("<CardInfo CardID=\"{0}\" Legend=\"True\" />", CardID); Response.Write(xmlContent.ToString()); } } } else if (UserVideoID > 0) { //output video info //DataRow rowInfo = Service.UserVideo.GetVideoInfoByUserVideoID(UserVideoID); try { var uv = new UserVideo(); uv.UserVideoID = UserVideoID; uv.Select(); object _value; var v = Video.Cache.Load(uv.VideoGuid); if (v != null) { var p = Player.Cache.Load(v.GoalPlayerGuid.Value); if (p != null) { var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.Append("<VideoInfo "); // build UserVideo xml info foreach ( var properInfo in uv.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { // remove the property VideoGuid of UserVideo if (!properInfo.Name.Equals("VideoGuid")) { _value = properInfo.GetValue(uv, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } } // build ArsenalVideo xml info foreach ( var properInfo in v.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance) ) { _value = properInfo.GetValue(v, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } // build ArsenalPlayer xml info foreach ( var properInfo in p.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance) ) { _value = properInfo.GetValue(p, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } xmlContent.Append("></VideoInfo>"); Response.Write(xmlContent.ToString()); } } } catch { } } else if (VideoGuid != null) { //DataRow rowInfo = Service.UserVideo.GetVideoInfoByVideoGuid(new Guid(VideoGuid)); object _value; var v = Video.Cache.Load(new Guid(VideoGuid)); if (v != null) { var p = Player.Cache.Load(v.GoalPlayerGuid.Value); if (p != null) { var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.Append("<VideoInfo "); // build ArsenalVideo xml info foreach ( var properInfo in v.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { _value = properInfo.GetValue(v, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } // build ArsenalPlayer xml info foreach ( var properInfo in p.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) { _value = properInfo.GetValue(p, null); if (_value == null) { _value = string.Empty; } xmlContent.AppendFormat("{0}=\"{1}\" ", properInfo.Name, HttpUtility.HtmlAttributeEncode(_value.ToString())); } xmlContent.Append("></VideoInfo>"); Response.Write(xmlContent.ToString()); } } } else if (CurrArsenalPlayer) { var list = Player.Cache.PlayerList.FindAll(p => !p.IsLegend && !p.IsLoan && p.SquadNumber >= 0); list.Sort((p1, p2) => p1.SquadNumber - p2.SquadNumber); var xmlContent = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); xmlContent.Append("<CurrArsenalPlayer>"); foreach (var p in list) { xmlContent.AppendFormat( "<PlayerInfo Guid=\"{0}\" DisplayName=\"{1}\" SquadNumber=\"{2}\" FaceURL=\"{3}\" />", p.ID, p.DisplayName, p.SquadNumber, p.FaceURL); } xmlContent.Append("</CurrArsenalPlayer>"); Response.Write(xmlContent.ToString()); } }
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; } } } }
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(); } }