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;
using System.Data.SqlClient;
using Anu.PCMS.DLL.DataBaseManager;
namespace PCMS.Pages
{
///
/// Summary description for Display.
///
public class Display : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.Label Label4;
protected System.Web.UI.WebControls.Label Label6;
protected System.Data.SqlClient.SqlConnection dispSQL;
protected System.Web.UI.WebControls.TextBox txtName;
protected System.Web.UI.WebControls.TextBox txtAddress;
protected System.Web.UI.WebControls.TextBox txtMobile;
protected System.Web.UI.WebControls.TextBox txtOffice;
protected System.Web.UI.WebControls.Label Label7;
protected System.Web.UI.WebControls.TextBox txtHome;
protected System.Web.UI.WebControls.TextBox txtDOB;
protected System.Web.UI.WebControls.TextBox txtEmail;
protected System.Web.UI.WebControls.HyperLink Hyperlink4;
protected System.Web.UI.WebControls.HyperLink Hyperlink5;
protected System.Web.UI.WebControls.HyperLink Hyperlink6;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.HyperLink HyperLink1;
protected System.Web.UI.WebControls.Label Label5;
private void Page_Load(object sender, System.EventArgs e)
{
try
{
DataBaseManager pcmsDB=new DataBaseManager(dispSQL.ConnectionString);
pcmsDB.GetSingleRecord(Int32.Parse(Request.QueryString["ID"]));
txtName.Text=pcmsDB.Name;
txtAddress.Text=pcmsDB.Name;
txtHome.Text=pcmsDB.HomePhone.ToString();
txtOffice.Text=pcmsDB.OfficePhone.ToString();
txtMobile.Text=pcmsDB.Mobile.ToString();
txtDOB.Text=pcmsDB.DOB;
txtEmail.Text=pcmsDB.Email;
}
catch (Exception ex)
{
Response.Redirect("Error.aspx?Error="+ ex);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.dispSQL = new System.Data.SqlClient.SqlConnection();
//
// dispSQL
//
this.dispSQL.ConnectionString = "data source=AV;initial catalog=PCM;integrated security=SSPI;persist security info" +
"=False;workstation id=AV;packet size=4096";
this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void txtName_TextChanged(object sender, System.EventArgs e)
{
}
private void Button1_Click(object sender, System.EventArgs e)
{
Response.Redirect("../main.aspx");
}
private void Button2_Click(object sender, System.EventArgs e)
{
Response.Redirect("Edit.aspx?ID="+Request.QueryString["ID"].ToString());
}
private void Button3_Click(object sender, System.EventArgs e)
{
Response.Redirect("Delete.aspx?ID="+Request.QueryString["ID"].ToString());
}
}
}