protected void btnRetrieve_Click(object sender, EventArgs e) { DsktpData DtopData = new DsktpData(); if (!string.IsNullOrEmpty(txtSSNo.Text)) { if (DtopData.checkExistRecord(txtSSNo.Text)) { string ssn = txtSSNo.Text; clearPage(); SpDepRecord dRec = new SpDepRecord(); dRec = DtopData.getSpDepData(ssn); bindSpDepRecord(dRec); DataSet ds = DtopData.getSpDepElections(ssn); grvElections.DataSource = ds; grvElections.DataBind(); int empno = Convert.ToInt32(txtXrefEmpno.Text); DataSet ds2 = DtopData.getSpDepNotes(empno, ssn); grvNotes.DataSource = ds2; grvNotes.DataBind(); } else { clearPage(); infoDiv1.Visible = true; lblInfo.Text = "There were no records returned for the search criteria."; } } }
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.checkExistRecord(txtSSNo.Text)) { string ssn = txtSSNo.Text; clearPage(); SpDepRecord dRec = new SpDepRecord(); dRec = DtopData.getSpDepData(ssn); bindSpDepRecord(dRec); DataSet ds = DtopData.getSpDepElections(ssn); grvElections.DataSource = ds; grvElections.DataBind(); int empno = Convert.ToInt32(txtXrefEmpno.Text); DataSet ds2 = DtopData.getSpDepNotes(empno, ssn); grvNotes.DataSource = ds2; grvNotes.DataBind(); } else { infoDiv1.Visible = true; lblInfo.Text = "There were no records returned for the search criteria."; } } } }