protected void gvClubStrip_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var bh = e.Row.DataItem as BingoHistory; var br = new BingoResult(bh.Result, bh.ResultDetail); var finalResult = string.Empty; switch (br.Result) { case BingoResultType.Strip: if (br.ResultDetail == "strip") { finalResult = "<span class=\"ClubSys_Strip SHIRT\">球衣</span><span class=\"ClubSys_Strip SHORTS\">球裤</span><span class=\"ClubSys_Strip SOCK\">球袜</span>"; } else if (br.ResultDetail.Contains("strips")) { finalResult = "<span class=\"ClubSys_Strip SHIRT\">球衣</span><span class=\"ClubSys_Strip SHORTS\">球裤</span><span class=\"ClubSys_Strip SOCK\">球袜</span><span class=\"ClubSys_Strip RATE\">×5</span>"; } else { finalResult = BingoUtil.ShowBothBingoDetail( ("<span class=\"ClubSys_Strip " + br.ResultDetail.ToUpper() + "\">{0}</span>"), br); } break; case BingoResultType.Card: if (br.ResultDetail == "legend") { finalResult = "<span class=\"ClubSys_Strip VIDEO\">视频</span>"; } else { finalResult = $"<span class=\"ClubSys_Strip CARD\">{Player.Cache.Load(new Guid(br.ResultDetail)).DisplayName}</span>"; } break; case BingoResultType.Cash: finalResult = "<span class=\"ClubSys_Strip CASH\">枪手币: " + br.ResultDetail + "</span>"; break; case BingoResultType.Both: finalResult = BingoUtil.ShowBothBingoDetail( "<span class=\"ClubSys_Strip " + br.ResultDetail.Substring(0, br.ResultDetail.IndexOf("+")).ToUpper() + "\">{0}</span> <span class=\"ClubSys_Strip CASH\">枪手币: {1}</span>", br); break; } var ltrlStrip = e.Row.FindControl("ltrlStrip") as Literal; ltrlStrip.Text = finalResult; } }
private void BindClubHistory() { if (history == null) { history = ClubLogic.GetUserClubHistory(username); foreach (var ch in history) { var actionType = (ClubHistoryActionType)Enum.Parse(typeof(ClubHistoryActionType), ch.ActionType); switch (actionType) { case ClubHistoryActionType.JoinClub: ch.AdditionalData = "ClubSys_Agree"; break; case ClubHistoryActionType.RejectJoinClub: ch.AdditionalData = "ClubSys_Disagree"; break; case ClubHistoryActionType.LeaveClub: ch.AdditionalData = "ClubSys_Disagree"; break; case ClubHistoryActionType.MandatoryLeaveClub: ch.AdditionalData = "ClubSys_Disagree"; break; case ClubHistoryActionType.Nominated: ch.AdditionalData = "ClubSys_Agree"; break; case ClubHistoryActionType.Dismiss: ch.AdditionalData = "ClubSys_Disagree"; break; case ClubHistoryActionType.LuckyPlayer: ch.AdditionalData = "ClubSys_Agree"; ch.ActionDescription = $"<em>{ch.ActionDescription}</em>"; break; case ClubHistoryActionType.TransferExtcredit: ch.AdditionalData = "ClubSys_Agree"; ch.ActionDescription = $"<em>{ch.ActionDescription}</em>"; break; default: ch.AdditionalData = "ClubSys_Agree"; break; } ch.AdditionalData2 = ClubLogic.TranslateClubHistoryActionType(actionType); } var bingoHistory = PlayerStrip.GetUserBingoHistory(userid); foreach (var bh in bingoHistory) { var current = new Entity.ClubHistory(); var br = new BingoResult(bh.Result, bh.ResultDetail); current.OperatorUserName = username; current.ClubID = bh.ClubID; current.AdditionalData2 = string.Empty; current.ActionDate = bh.ActionDate; switch (br.Result) { case BingoResultType.Strip: current.AdditionalData = "ClubSys_Agree"; if (br.ResultDetail == "strip") { current.ActionDescription = "获得一套球衣装备"; } else if (br.ResultDetail == "strips") { current.ActionDescription = "获得五套球衣装备"; } else { current.ActionDescription = BingoUtil.ShowBothBingoDetail("获得一件{0}", br); } break; case BingoResultType.Card: current.AdditionalData = "ClubSys_Agree"; if (br.ResultDetail == "legend") { current.ActionDescription = "获得一张视频卡"; } else { current.ActionDescription = $"获得球员卡: {Player.Cache.Load(new Guid(br.ResultDetail)).DisplayName}"; } break; case BingoResultType.Cash: current.AdditionalData = "ClubSys_Agree"; current.ActionDescription = "获得枪手币: " + br.ResultDetail; break; case BingoResultType.Both: current.AdditionalData = "ClubSys_Agree"; current.ActionDescription = BingoUtil.ShowBothBingoDetail("获得一件{0}和枪手币: {1}", br); break; default: current.AdditionalData = "ClubSys_Disagree"; current.ActionDescription = "什么都没获得"; break; } if (br.Result != BingoResultType.Null) { current.ActionDescription = $"<em>{current.ActionDescription}</em>"; } history.Add(current); } var playerHistory = PlayerLog.GetUserPlayerHistory(userid); foreach (var ph in playerHistory) { var current = new Entity.ClubHistory(); current.OperatorUserName = username; current.ClubID = ClubLogic.GetActiveUserClubs(userid)[0].ID.Value; current.AdditionalData = "ClubSys_Star"; current.ActionDescription = $"<em>{ph.TypeDesc}</em>"; current.ActionDate = ph.ActionDate; history.Add(current); } history.Sort(new ClubHistoryComparer()); } gvHistoryLog.DataSource = history; gvHistoryLog.DataBind(); }
private void BindStripHistory() { if (_list == null) { _list = PlayerStrip.GetClubBingoHistory(ClubID); foreach (var bh in _list) { var br = new BingoResult(bh.Result, bh.ResultDetail); switch (br.Result) { case BingoResultType.Strip: if (br.ResultDetail == "strip") { bh.AdditionalData = "<span class=\"ClubSys_Strip SHIRT\">球衣</span><span class=\"ClubSys_Strip SHORTS\">球裤</span><span class=\"ClubSys_Strip SOCK\">球袜</span>"; } else if (br.ResultDetail.Contains("strips")) { bh.AdditionalData = "<span class=\"ClubSys_Strip SHIRT\">球衣</span><span class=\"ClubSys_Strip SHORTS\">球裤</span><span class=\"ClubSys_Strip SOCK\">球袜</span><span class=\"ClubSys_Strip RATE\">×5</span>"; } else { bh.AdditionalData = BingoUtil.ShowBothBingoDetail( ("<span class=\"ClubSys_Strip " + br.ResultDetail.ToUpper() + "\">{0}</span>"), br); } break; case BingoResultType.Card: if (br.ResultDetail == "legend") { bh.AdditionalData = "<span class=\"ClubSys_Strip VIDEO\">视频</span>"; } else { bh.AdditionalData = $"<span class=\"ClubSys_Strip CARD\">{Player.Cache.Load(new Guid(br.ResultDetail)).DisplayName}</span>"; } break; case BingoResultType.Cash: bh.AdditionalData = "<span class=\"ClubSys_Strip CASH\">枪手币: " + br.ResultDetail + "</span>"; break; case BingoResultType.Both: bh.AdditionalData = BingoUtil.ShowBothBingoDetail( "<span class=\"ClubSys_Strip " + br.ResultDetail.Substring(0, br.ResultDetail.IndexOf("+")).ToUpper() + "\">{0}</span><span class=\"ClubSys_Strip CASH\">枪手币: {1}</span>", br); break; } } } gvClubStrip.DataSource = _list; gvClubStrip.DataBind(); }