protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Select") { int index = Convert.ToInt32(e.CommandArgument); GridViewRow gvr = GridView1.Rows[index]; string dssn = Server.HtmlDecode(gvr.Cells[3].Text); txtSSNo.Text = dssn; DsktpData DtopData = new DsktpData(); if (!string.IsNullOrEmpty(txtSSNo.Text)) { if (DtopData.checkExistTowerRecord(txtSSNo.Text)) { string ssn = txtSSNo.Text; clearPage(); TowerEmpRecord dRec = new TowerEmpRecord(); dRec = DtopData.getTowerEmpData(ssn); bindTowerRecord(dRec); } else { clearPage(); infoDiv1.Visible = true; lblInfo.Text = "There were no records returned for the search criteria."; } } } }
protected void bindTowerRecord(TowerEmpRecord pRec1) { lblEmpHeading.Text = "Employee - " + pRec1.LastName + ", " + pRec1.FirstName; txtFirstName.Text = pRec1.FirstName; txtLastName.Text = pRec1.LastName; txtAddr1.Text = pRec1.Address1; txtAddr2.Text = pRec1.Address2; txtCity.Text = pRec1.City; txtState.Text = pRec1.State; txtZip.Text = pRec1.Zip; txtDDOB.Text = (pRec1.DDOB.ToShortDateString() == "1/1/0001" ? "" : pRec1.DDOB.ToShortDateString()); txtPhone.Text = pRec1.Phone; txtDfname.Text = pRec1.DFname; txtDlname.Text = pRec1.DLname; txtRelCd.Text = pRec1.DRelCode; txtHealthInd.Text = pRec1.HealthInd; txtSSNo.Text = pRec1.SSN.PadLeft(9, '0'); }
protected void btnRetrieve_Click(object sender, EventArgs e) { DsktpData DtopData = new DsktpData(); if (!string.IsNullOrEmpty(txtSSNo.Text)) { if (DtopData.checkExistTowerRecord(txtSSNo.Text)) { string ssn = txtSSNo.Text; clearPage(); TowerEmpRecord dRec = new TowerEmpRecord(); dRec = DtopData.getTowerEmpData(ssn); bindTowerRecord(dRec); } else { clearPage(); infoDiv1.Visible = true; lblInfo.Text = "There were no records returned for the search criteria."; } } }