using System;
//using System.Collections;
//using System.ComponentModel;
//using System.Data;
//using System.Drawing;
//using System.Web;
//using System.Web.SessionState;
//using System.Web.UI;
//using System.Web.UI.WebControls;
//using System.Web.UI.HtmlControls;
namespace ZipCode
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox oTextBox;
protected System.Web.UI.WebControls.Label oLabel;
protected System.Web.UI.WebControls.DataGrid oDataGrid;
protected System.Web.UI.WebControls.Button oButton;
public WebForm1()
{
Page.Init += new System.EventHandler(Page_Init);
System.Net.GlobalProxySelection.Select =
new System.Net.WebProxy("http://129.234.4.10:8080");
//System.Net.GlobalProxySelection.Select =
// System.Net.WebProxy.GetDefaultProxy();
//oLabel.Text = System.Net.GlobalProxySelection.Select.ToString();
}
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
private void Page_Init(object sender, EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
}
#region Web Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.oTextBox.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
this.oButton.Click += new System.EventHandler(this.oButton_Click);
this.oDataGrid.SelectedIndexChanged += new System.EventHandler(this.oDataGrid_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void oButton_Click(object sender, System.EventArgs e)
{
ZipToCityProxy.ZipcodeLookupService tZipcodeLookupService = new ZipToCityProxy.ZipcodeLookupService();
try
{
oLabel.Text = tZipcodeLookupService.ZipTo1CityAndState(oTextBox.Text);
}
catch
{
oLabel.Text = "Exception 1";
}
ZipToWeatherProxy.WeatherRetriever tWeatherRetriever = new ZipToWeatherProxy.WeatherRetriever();
ZipToWeatherProxy.CurrentWeather tCurrentWeather;
try
{
tCurrentWeather = tWeatherRetriever.GetWeather(oTextBox.Text);
oLabel.Text += " has a temperature of " + tCurrentWeather.CurrentTemp + " degrees Fahrenheit.";
oLabel.Text += " The condition is " + tCurrentWeather.Conditions + ".";
}
catch
{
oLabel.Text += " Exception 2";
}
ZipToMusicTeachersProxy.SearchMusicTeachers tSearchMusicTeachers = new ZipToMusicTeachersProxy.SearchMusicTeachers();
try
{
System.Data.DataSet tDataSet = tSearchMusicTeachers.FindMusicTeachers(oTextBox.Text, "", "", "", 12, 3);
oDataGrid.DataSource = tDataSet.Tables[1].DefaultView;
oDataGrid.DataBind();
}
catch
{
oLabel.Text += " Exception 3";
}
}
private void oTextBox_TextChanged(object sender, System.EventArgs e)
{
}
private void TextBox1_TextChanged(object sender, System.EventArgs e)
{
}
private void oDataGrid_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
}
}