Example #1
0
    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[4].Text);
            txtSSNo.Text = dssn;

            DsktpData DtopData = new DsktpData();
            if (!string.IsNullOrEmpty(txtSSNo.Text))
            {
                if (DtopData.checkExistRetRecord(txtSSNo.Text))
                {
                    string ssn = txtSSNo.Text;

                    clearPage();
                    RetPartRecord dRec = new RetPartRecord();
                    dRec = DtopData.getRetPartData(ssn);
                    bindRetPartRecord(dRec);
                    DataSet ds = DtopData.searchRetElects(ssn);
                    grvElections.DataSource = ds;
                    grvElections.DataBind();

                    int     empno = Convert.ToInt32(txtEmpNo.Text);
                    DataSet ds2   = DtopData.searchRetPayHist(ssn);
                    grvPayments.DataSource = ds2;
                    grvPayments.DataBind();

                    DataSet ds3 = DtopData.searchRetPayrollHist(ssn);
                    grvDeductions.DataSource = ds3;
                    grvDeductions.DataBind();
                }
                else
                {
                    infoDiv1.Visible = true;
                    lblInfo.Text     = "There were no records returned for the search criteria.";
                }
            }
        }
    }
Example #2
0
    protected void btnRetrieve_Click(object sender, EventArgs e)
    {
        DsktpData DtopData = new DsktpData();

        if (!string.IsNullOrEmpty(txtSSNo.Text))
        {
            if (DtopData.checkExistRetRecord(txtSSNo.Text))
            {
                string ssn = txtSSNo.Text;

                clearPage();
                RetPartRecord rRec = new RetPartRecord();
                rRec = DtopData.getRetPartData(ssn);
                bindRetPartRecord(rRec);

                DataSet ds = DtopData.searchRetElects(ssn);
                grvElections.DataSource = ds;
                grvElections.DataBind();

                int     empno = Convert.ToInt32(txtEmpNo.Text);
                DataSet ds2   = DtopData.searchRetPayHist(ssn);
                grvPayments.DataSource = ds2;
                grvPayments.DataBind();

                DataSet ds3 = DtopData.searchRetPayrollHist(ssn);
                grvDeductions.DataSource = ds3;
                grvDeductions.DataBind();
            }
            else
            {
                clearPage();
                infoDiv1.Visible = true;
                lblInfo.Text     = "There were no records returned for the search criteria.";
            }
        }
    }