Quick room leaders page to test trendy phrases with

This commit is contained in:
Greg Edwards
2014-08-06 02:35:10 -04:00
parent 228a1a5e52
commit 6768a02ec6
4 changed files with 155 additions and 0 deletions

25
gts/RoomLeaders.aspx Normal file
View File

@@ -0,0 +1,25 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="RoomLeaders.aspx.cs" Inherits="PkmnFoundations.GTS.RoomLeaders" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMain" runat="server">
<form id="theForm" runat="server">
<p>Enter the rank and room number to get leader info:</p>
<div>
Rank:
<asp:TextBox ID="txtRank" runat="server" />
</div>
<div>
Room number:
<asp:TextBox ID="txtRoom" runat="server" />
</div>
<div>
<asp:Button ID="btnGet" Text="Get" OnClick="btnGet_Click" runat="server" />
</div>
<div>
<asp:Literal ID="litResults" runat="server" />
</div>
</form>
</asp:Content>

62
gts/RoomLeaders.aspx.cs Normal file
View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PkmnFoundations.Data;
using PkmnFoundations.Structures;
using PkmnFoundations.Support;
namespace PkmnFoundations.GTS
{
public partial class RoomLeaders : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnGet_Click(object sender, EventArgs e)
{
byte rank;
byte room;
if (!Byte.TryParse(txtRank.Text, out rank) ||
!Byte.TryParse(txtRoom.Text, out room))
{
litResults.Text = "Please type numbers.";
return;
}
if (rank > 10 || rank < 1)
{
litResults.Text = "Rank must be 1-10.";
}
if (room > 50 || rank < 1)
{
litResults.Text = "Room must be 1-50.";
}
rank--;
room--;
BattleTowerProfile4[] results = DataAbstract.Instance.BattleTowerGetLeaders4(rank, room);
StringBuilder builder = new StringBuilder();
builder.Append("<ul>");
foreach (BattleTowerProfile4 profile in results)
{
builder.Append("<li>");
byte[] phrase = new byte[8];
System.Buffer.BlockCopy(profile.TrendyPhrase, 0, phrase, 0, 8);
TrendyPhrase4 tp = new TrendyPhrase4(phrase);
builder.Append(Common.HtmlEncode(tp.ToString()));
builder.Append("</li>");
}
builder.Append("</ul>");
litResults.Text = builder.ToString();
}
}
}

60
gts/RoomLeaders.aspx.designer.cs generated Normal file
View File

@@ -0,0 +1,60 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PkmnFoundations.GTS {
public partial class RoomLeaders {
/// <summary>
/// theForm control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm theForm;
/// <summary>
/// txtRank control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtRank;
/// <summary>
/// txtRoom control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtRoom;
/// <summary>
/// btnGet control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnGet;
/// <summary>
/// litResults control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litResults;
}
}

View File

@@ -72,6 +72,7 @@
<Content Include="BattleVideo.aspx" />
<Content Include="css\main.css" />
<Content Include="admin\AddDressup.aspx" />
<Content Include="RoomLeaders.aspx" />
<Content Include="test\BoxUp.aspx" />
<Content Include="test\NameDecode.aspx" />
<Content Include="test\Decode.aspx" />
@@ -134,6 +135,13 @@
<Compile Include="pkvldtprod.ashx.cs">
<DependentUpon>pkvldtprod.ashx</DependentUpon>
</Compile>
<Compile Include="RoomLeaders.aspx.cs">
<DependentUpon>RoomLeaders.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="RoomLeaders.aspx.designer.cs">
<DependentUpon>RoomLeaders.aspx</DependentUpon>
</Compile>
<Compile Include="src\GamestatsSessionPlat.cs" />
<Compile Include="src\HeaderColour.cs" />
<Compile Include="admin\AddDressup.aspx.cs">