<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Resume_search.ascx.cs" Inherits="RecruitmentApps.Resume_search.Resume_search" %>
<div>
<br />
<asp:Label ID="lblkeywords" runat="server" Text="Keywords :" Font-Bold="True"></asp:Label>
<asp:TextBox ID="txtkeywords" runat="server" Width="250px" BackColor="#66FFFF"></asp:TextBox>
<asp:Label ID="lbljcl" runat="server" Text="Current Location:" Font-Bold="True"></asp:Label>
<asp:DropDownList ID="ddllocation" runat="server" AppendDataBoundItems="True" CausesValidation="True" DataTextField="ddllocation" DataValueField="ddllocation1" Width="140" BackColor="#66FFFF" OnSelectedIndexChanged="ddllocation_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="0">--Select--</asp:ListItem>
<asp:ListItem value="1">Hyderabad</asp:ListItem>
<asp:ListItem value="2">Banglore</asp:ListItem>
<asp:ListItem value="3">Delhi</asp:ListItem>
<asp:ListItem value="4">Kolkata</asp:ListItem>
<asp:ListItem value="5">Guragon</asp:ListItem>
<asp:ListItem value="6">Chennai</asp:ListItem>
<asp:ListItem value="7">Pune</asp:ListItem>
<asp:ListItem value="8">Mumbai</asp:ListItem>
</asp:DropDownList>
<%--<asp:RequiredFieldValidator ID="drplocrfv" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="Drploc" SetFocusOnError="True" InitialValue="0">*</asp:RequiredFieldValidator>--%>
<br />
<br />
<asp:Label ID="lblexp" runat="server" Text="Experience :" Font-Bold="True"></asp:Label>
Min<asp:DropDownList ID="ddlminexp" runat="server" Width="100" BackColor="#66FFFF" OnSelectedIndexChanged="ddlminexp_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="0">0</asp:ListItem>
<asp:ListItem value="1">1</asp:ListItem>
<asp:ListItem value="2">2</asp:ListItem>
<asp:ListItem value="3">3</asp:ListItem>
<asp:ListItem value="4">4</asp:ListItem>
<asp:ListItem value="5">5</asp:ListItem>
<asp:ListItem value="6">6</asp:ListItem>
<asp:ListItem value="7">7</asp:ListItem>
<asp:ListItem value="8">8</asp:ListItem>
<asp:ListItem value="9">9</asp:ListItem>
<asp:ListItem value="10">10</asp:ListItem>
<asp:ListItem value="11">11</asp:ListItem>
<asp:ListItem value="12">12</asp:ListItem>
<asp:ListItem value="13">13</asp:ListItem>
<asp:ListItem value="14">14</asp:ListItem>
</asp:DropDownList>
Max<asp:DropDownList ID="ddlmaxexp" runat="server" Width="100" BackColor="#66FFFF" OnSelectedIndexChanged="ddlmaxexp_SelectedIndexChanged">
<asp:ListItem Selected="True" Value="0">0</asp:ListItem>
<asp:ListItem value="1">1</asp:ListItem>
<asp:ListItem value="2">2</asp:ListItem>
<asp:ListItem value="3">3</asp:ListItem>
<asp:ListItem value="4">4</asp:ListItem>
<asp:ListItem value="5">5</asp:ListItem>
<asp:ListItem value="6">6</asp:ListItem>
<asp:ListItem value="7">7</asp:ListItem>
<asp:ListItem value="8">8</asp:ListItem>
<asp:ListItem value="9">9</asp:ListItem>
<asp:ListItem value="10">10</asp:ListItem>
<asp:ListItem value="11">11</asp:ListItem>
<asp:ListItem value="12">12</asp:ListItem>
<asp:ListItem value="13">13</asp:ListItem>
<asp:ListItem value="14">14</asp:ListItem>
<asp:ListItem value="15">15</asp:ListItem>
</asp:DropDownList>
<asp:Button ID="Search" runat="server" Text="Get Resumes" Width="98px" Height="22" Font-Bold="True" ForeColor="Black" OnClick="GetResumebtn_Click" BackColor="#FFCC99" BorderColor="#FF9900" />
<br />
<br />
<%--<asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="D:\Sharepoint Projects\Recruitment\Recruitment\Images\smallpic.png" NavigateUrl="C:\Users\Vanu\Videos\">HyperLink</asp:HyperLink>--%>
<br />
<br />
Candidate Resume Information
<asp:GridView ID="EmpGridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="EmpGridView1_RowCommand" Width="930px" BackColor="#99FFCC" BorderColor="#6600FF" BorderStyle="Groove" >
<%-- <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
OnRowCancelingEdit="GridView1_RowCancelingEdit"
OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating"
OnRowDataBound="GridView1_RowDataBound" Width="774px" OnSelectedIndexChanged="EmpGridView1_SelectedIndexChanged">--%>
<Columns>
<%--<asp:TemplateField HeaderText="Sr.No">
<ItemTemplate> <%#Container.DataItemIndex+1 %> </ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="ResumeID">
<ItemTemplate>
<asp:Label ID="lbljobid" runat="server" Text='<%# Eval("ResumeID") %>' >
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="ResumeTitle">
<ItemTemplate>
<asp:Label ID="lblresumetitle" runat="server" Text='<%# Eval("Resume_Title") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label ID="lbl2" runat="server" Width="100" allign="center" Text='<%# Eval("First_Name") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Email Address">
<ItemTemplate>
<asp:Label ID="lbl3" runat="server" Text='<%# Eval
("Email") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Mobile No">
<ItemTemplate>
<asp:Label ID="lbl4" runat="server" Width="120" Text='<%# Eval
("Mobile_No") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Key skills">
<ItemTemplate>
<asp:Label ID="lbl5" runat="server" Width="100" Text='<%# Eval("Key_skills") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Location">
<ItemTemplate>
<asp:Label ID="lbl6" runat="server" Width="100" Text='<%# Eval
("Current_location") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Gender">
<ItemTemplate>
<asp:Label ID="lbl7" runat="server" Text='<%#
Eval("Gender") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Experience">
<ItemTemplate>
<asp:Label ID="lbl8" runat="server" Width="50" font-allign="center" Text='<%# Eval("Total_Years_Exp") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Resume">
<ItemTemplate>
<asp:Label ID="lblupload" runat="server" Visible="false" Text='<%# Eval("Resume_Upload") %>'>
</asp:Label>
<asp:HyperLink ID="resumehlink" runat="server" ImageUrl="../_Layouts/word_2010.png">
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:TemplateField HeaderText="Resume1">
<ItemTemplate>
<asp:LinkButton ID="lnkrs" runat="server" Text="download1" OnClick="lnkrs_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:TemplateField HeaderText="Download">
<ItemTemplate>
<%--<asp:HyperLink ID="resumehlink" runat="server" ImageUrl="../_Layouts/word_2010.png" NavigateUrl='<%# Eval("Resume_Title") %>' Text='<%# Eval("Resume_Title") %>'>
</asp:HyperLink>--%>
<asp:Button ID="Download" runat="server" Text="Download" CommandArgument='<%# Eval("ResumeID") %>' CommandName="Downloadcmd" CausesValidation="false" BackColor="#9966FF" ForeColor="White" OnClick="Downloadbtn_click" OnClientClick="javascript:setFormSubmitToFalse()" />
<script>
function setFormSubmitToFalse() {
setTimeout(function () { _spFormOnSubmitCalled = false; }, 3000);
return true;
}
</script>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<asp:Label ID="lbldisplay" runat="server" Text="Label" Width="200" Visible="false"></asp:Label>
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace RecruitmentApps.Resume_search
{
[ToolboxItemAttribute(false)]
public partial class Resume_search : WebPart
{
// Uncomment the following SecurityPermission attribute only when doing Performance Profiling on a farm solution
// using the Instrumentation method, and then remove the SecurityPermission attribute when the code is ready
// for production. Because the SecurityPermission attribute bypasses the security check for callers of
// your constructor, it's not recommended for production purposes.
// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Assert, UnmanagedCode = true)]
public Resume_search()
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
InitializeControl();
}
protected void Page_Load(object sender, EventArgs e)
{
txtkeywords.Focus();
}
protected void GetResumebtn_Click(object sender, EventArgs e)
{
string connstring = "Persist Security Info=False;Integrated Security=true;Initial Catalog=Recruitment;server=(local)";
SqlConnection scon = new SqlConnection(connstring);
// string query = "select ResumeID, Resume_Title, First_Name, Email, Mobile_No, Current_location, Gender, Key_skills, Job_Type, Total_experience, Resume_Upload, Total_Years_Exp from Candidate10 where Current_location='" + ddllocation.SelectedItem.Text + "' and Total_Years_Exp between " + ddlminexp.SelectedItem.Value + " and " + ddlmaxexp.SelectedItem.Value + " and key_skills like '%" + txtkeywords.Text + "%'";
string query = "select ResumeID, Resume_Title, First_Name, Email, Mobile_No, Current_location, Gender, Key_skills, Job_Type, Total_experience, Resume_Upload, Total_Years_Exp from Candidate10 where Current_location='" + ddllocation.SelectedItem.Text + "' and Total_Years_Exp between " + ddlminexp.SelectedItem.Value + " and " + ddlmaxexp.SelectedItem.Value + " and key_skills like '%" + txtkeywords.Text + "%'";
scon.Open();
SqlCommand cmd = new SqlCommand(query, scon);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
EmpGridView1.DataSource = ds;
EmpGridView1.DataBind();
}
protected void EmpGridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "Downloadcmd")
{
GridViewRow row = (GridViewRow)(((Button)e.CommandSource).NamingContainer);
int selIndex = row.RowIndex;
string lbluploadpath = (row.FindControl("lblupload") as Label).Text; //THIS IS FOR LABEL
string URL = lbluploadpath;
System.IO.FileInfo file = new System.IO.FileInfo(URL);
if (file.Exists)
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AppendHeader("Content-Disposition:", "attachment; filename=" + file.Name);
HttpContext.Current.Response.AppendHeader("Content-Length", file.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.TransmitFile(file.FullName);
HttpContext.Current.Response.End();
//HttpContext.Current.Response.Flush();
}
}
catch
{
HttpContext.Current.Response.Write("<script>alert('try to re click download button')</script>");
}
//}
//catch (Exception err)
//{
//}
//else
//{
// HttpContext.Current.Response.Write("NO FILE PRESENT");
//}
}
protected void Downloadbtn_click(object sender, EventArgs e)
{
// Button btn = (Button)sender;
// GridViewRow row = (GridViewRow)btn.NamingContainer;
// // HttpContext.Current.Response.Redirect("http://venu-pc:19773/SitePages/DisplayResume.aspx", true);
}
//Trim using and with replce input below
//string input = "Hello! world!";
// string output = Regex.Replace(input, "(world)!", "$1", RegexOptions.Multiline | RegexOptions.Singleline);
// result: "Hello! world"
protected void EmpGridView1_SelectedIndexChanged1(object sender, EventArgs e)
{
}
protected void ddlminexp_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void ddlmaxexp_SelectedIndexChanged(object sender, EventArgs e)
{
}
protected void ddllocation_SelectedIndexChanged(object sender, EventArgs e)
{
}
}
}
No comments:
Post a Comment