0% found this document useful (0 votes)
6 views4 pages

Display Vacancies

The document describes steps to display vacancy details in an HR user module. It involves creating a stored procedure to get vacancy data, defining business logic methods, designing an ASPX page with a grid to display data, and calling the data method on page load.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Display Vacancies

The document describes steps to display vacancy details in an HR user module. It involves creating a stored procedure to get vacancy data, defining business logic methods, designing an ASPX page with a grid to display data, and calling the data method on page load.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Project: HROR

HR User Module

Display Vacancies

• Add Web form and save with “frmDisplayVacancies.aspx “ under “HRUser.Master”, design as per
requirements

Change Password Requirements

• Create stored procedure “sp_Vacancies_Get”

• Define business method Vacancies_Get () in BAL_ Vacancies class

• Design Display Vacancies page

• Call above method from Page_Load()

Create the following stored procedure which will receive Branch ID and gives all Vacancies details

CREATE PROCEDURE sp_Vacancies_Get

@BId int

AS

BEGIN

SELECT

tblVacancies.VacancyId,

tblDesignation.DesignationName,

Faculty: Suresh Naidu Thota Page 1


Project: HROR
tblVacancies.NoOfVacancies,

tblVacancies.VacancyDate,

tblVacancies.Priority

FROM tblVacancies,tblDesignation

WHERE tblVacancies.BranchId = @BId

AND tblDesignation.DesignationId = tblVacancies.DesignationId

END

Define the following business method in BAL_Vacancies.cs

public SqlDataReader Vacancies_Get(int BId)


{
SqlParameter[] Params = new SqlParameter[1];

Params[0] = new SqlParameter("@BId", SqlDbType.Int);


Params[0].Value = BId;

SqlDataReader dr = SqlHelper.ExecuteReader(clsConnection.GetConString(),
CommandType.StoredProcedure, "sp_Vacancies_Get", Params);
return dr;
} //End of Vacancies_Get()

Write the following statements in frmDisplay.aspx (Design)

<table bgcolor="Silver" class="style1">


<tr>
<td style="font-family: Verdana; font-size: large; font-weight: bold">
&nbsp;</td>
</tr>
<tr>
<td style="font-family: Verdana; font-size: large; font-weight: bold">
&nbsp;</td>
</tr>
<tr>
<td align="center"
style="font-family: Verdana; font-size: large; font-weight: bold">
&nbsp;</td>
</tr>
<tr>
<td align="center"
style="font-family: Verdana; font-size: large; font-weight: bold">
Vacancies Informations</td>
</tr>
<tr>
<td style="font-family: Verdana; font-size: large; font-weight: bold"
align="left">
&nbsp;</td>
</tr>
<tr>

Faculty: Suresh Naidu Thota Page 2


Project: HROR
<td style="font-family: Verdana; font-size: large; font-weight: bold"
align="right">
<asp:LinkButton ID="lbBack" runat="server"
onclick="lbBack_Click">&lt;&lt;Back</asp:LinkButton>
</td>
</tr>
<tr>
<td style="font-family: Verdana; font-size: large; font-weight: bold"
align="left">
&nbsp;</td>
</tr>
<tr>
<td align="center"
style="font-family: Verdana; font-size: large; font-weight: bold">
<asp:GridView ID="gvVacanciesDetails" runat="server" PageSize="5">
<RowStyle BackColor="#3399FF" />
<HeaderStyle BackColor="#993399" />
<AlternatingRowStyle BackColor="#00FF99" />
</asp:GridView>
<br />
</td>
</tr>
<tr>
<td align="center">
<asp:Label ID="lblErrMsg" runat="server" Font-Bold="True" Font-Names="Verdana"
ForeColor="Red"></asp:Label>
</td>
</tr>
<tr>
<td align="center">
&nbsp;</td>
</tr>
<tr>
<td align="center">
&nbsp;</td>
</tr>
<tr>
<td align="center">
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
</tr>
<tr>

Faculty: Suresh Naidu Thota Page 3


Project: HROR
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
</tr>
</table>

Write the following code in the frmDisplayVacancies.aspx.cs

protected void Page_Load(object sender, EventArgs e)


{
try
{
BAL_Vacancies obj = new BAL_Vacancies();

int BId = Convert.ToInt32(Session["BranchId"]);

SqlDataReader dr = obj.Vacancies_Get(BId);
if (dr != null)
{
gvVacanciesDetails.DataSource = dr;
gvVacanciesDetails.DataBind();
}
else
{
gvVacanciesDetails.EmptyDataText = "No vacancies available";
}
}
catch (Exception ex)
{
lblErrMsg.Text = ex.Message;
}
}
protected void lbBack_Click(object sender, EventArgs e)
{
Response.Redirect("frmCreateVacancies.aspx");
}

Faculty: Suresh Naidu Thota Page 4

You might also like