diff --git a/web/controls/PokemonPicker.ascx b/web/controls/PokemonPicker.ascx new file mode 100644 index 00000000..dd4e3a19 --- /dev/null +++ b/web/controls/PokemonPicker.ascx @@ -0,0 +1,5 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PokemonPicker.ascx.cs" Inherits="PkmnFoundations.Web.controls.PokemonPicker" %> + +<%-- todo: implement ajax pokemon picker --%> +(todo) + \ No newline at end of file diff --git a/web/controls/PokemonPicker.ascx.cs b/web/controls/PokemonPicker.ascx.cs new file mode 100644 index 00000000..2f5aed77 --- /dev/null +++ b/web/controls/PokemonPicker.ascx.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace PkmnFoundations.Web.controls +{ + public partial class PokemonPicker : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + public String Value + { + get + { + return txtSpecies.Text; + } + set + { + txtSpecies.Text = value; + } + } + } +} \ No newline at end of file diff --git a/web/controls/PokemonPicker.ascx.designer.cs b/web/controls/PokemonPicker.ascx.designer.cs new file mode 100644 index 00000000..7edc49f6 --- /dev/null +++ b/web/controls/PokemonPicker.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PkmnFoundations.Web.controls { + + + public partial class PokemonPicker { + + /// + /// txtSpecies control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSpecies; + } +} diff --git a/web/gts/Default.aspx b/web/gts/Default.aspx index 7aa11e9c..47cfc99f 100644 --- a/web/gts/Default.aspx +++ b/web/gts/Default.aspx @@ -1,5 +1,6 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/masters/MasterPage.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="PkmnFoundations.GTS.AllPokemon" %> <%@ Register TagPrefix="pf" Namespace="PkmnFoundations.Web" Assembly="PkmnFoundations.Web" %> +<%@ Register TagPrefix="pf" TagName="PokemonPicker" Src="~/controls/PokemonPicker.ascx" %> @@ -7,7 +8,69 @@ -Generation IV + + + Please enter your search terms: + + + Species + Level + Gender + Version + + + + + + + + + to + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -38,7 +101,7 @@ -Generation V + diff --git a/web/gts/Default.aspx.cs b/web/gts/Default.aspx.cs index 8abbad4f..83ea18c7 100644 --- a/web/gts/Default.aspx.cs +++ b/web/gts/Default.aspx.cs @@ -18,13 +18,27 @@ namespace PkmnFoundations.GTS { m_pokedex = (Pokedex.Pokedex)Application["pkmncfPokedex"]; - GtsRecord4[] records4 = Database.Instance.GtsSearch4(0, 0, Genders.Either, 0, 0, 0, -1); - rptPokemon4.DataSource = records4; - rptPokemon4.DataBind(); + int species; Int32.TryParse(ppSpecies.Value, out species); + int minLevel = Convert.ToInt32(txtLevelMin.Text); + int maxLevel = Convert.ToInt32(txtLevelMax.Text); + Genders gender = (Genders)Convert.ToInt32(rbGender.SelectedValue); - GtsRecord5[] records5 = Database.Instance.GtsSearch5(0, 0, Genders.Either, 0, 0, 0, -1); - rptPokemon5.DataSource = records5; - rptPokemon5.DataBind(); + if (rbGen4.Checked) + { + GtsRecord4[] records4 = Database.Instance.GtsSearch4(0, (ushort)species, gender, (byte)minLevel, (byte)maxLevel, 0, -1); + rptPokemon4.DataSource = records4; + rptPokemon4.DataBind(); + rptPokemon4.Visible = true; + rptPokemon5.Visible = false; + } + else if (rbGen5.Checked) + { + GtsRecord5[] records5 = Database.Instance.GtsSearch5(0, (ushort)species, gender, (byte)minLevel, (byte)maxLevel, 0, -1); + rptPokemon5.DataSource = records5; + rptPokemon5.DataBind(); + rptPokemon4.Visible = false; + rptPokemon5.Visible = true; + } } private Pokedex.Pokedex m_pokedex; diff --git a/web/gts/Default.aspx.designer.cs b/web/gts/Default.aspx.designer.cs index 0648c928..256a10ca 100644 --- a/web/gts/Default.aspx.designer.cs +++ b/web/gts/Default.aspx.designer.cs @@ -21,6 +21,96 @@ namespace PkmnFoundations.GTS { /// protected global::PkmnFoundations.Web.HeaderColour HeaderColour1; + /// + /// theForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm theForm; + + /// + /// ppSpecies control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::PkmnFoundations.Web.controls.PokemonPicker ppSpecies; + + /// + /// txtLevelMin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLevelMin; + + /// + /// txtLevelMax control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLevelMax; + + /// + /// rbGender control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList rbGender; + + /// + /// rbGen4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbGen4; + + /// + /// lblGen4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGen4; + + /// + /// rbGen5 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbGen5; + + /// + /// lblGen5 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGen5; + + /// + /// btnSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSearch; + /// /// rptPokemon4 control. /// diff --git a/web/web.csproj b/web/web.csproj index a972ab24..829676ee 100644 --- a/web/web.csproj +++ b/web/web.csproj @@ -67,6 +67,7 @@ + @@ -3515,6 +3516,13 @@ LabelTextBox.ascx + + PokemonPicker.ascx + ASPXCodeBehind + + + PokemonPicker.ascx + Default.aspx ASPXCodeBehind