I'm new to asp.net,can any one help me how to write the search criteria in asp.net....please check the below links because I want to write a code like this.
so can any body help me out?
https://career4.successfactors.com/career?company=Mindtree...In this page after clicking on button it should be redirect to next page with details like
https://career4.successfactors.com/career?company=Mindtree&career_ns=job_listing_summary&navBarLevel=JOB_SEARCH&_s.crb=kpstbNLArk2XYgsXDE%2f0rlswGrc%3d
can any one help me how to write the code for search criteria for each textbox and dropdown?
birju gohelPosted Feb 13, 2015, 2:42 AM
////////////////////////////////////////////////
ALTER PROCEDURE [dbo].[DailyReportGrid_Criteria]
@Criteria varchar(max)
AS
declare @Condition as varchar(max)
SET @Condition =''
BEGIN
SET @Condition ='
With a as (
select Count(ClientMaster.ClientId) as ClientEntry,ClientMaster.DataEnterDate,
COUNT(FolloupMaster.intclientfolloupid)as FollowEntry,DataEnterDate,FolloupMaster,
Count(LeadMaster.intLeadId) as LeadEntry,LeadMaster.dtleadDate,
COUNT(QuotationMasterNew.QuotationId) as QuotationEntry,QuotationMasterNew.SubmitDate,
COUNT(InvoiceMasterNew.InvoiceId) as InvoiceEntry,InvoiceMasterNew.InvoiceDate,
COUNT(PaymentMaster.PaymentId) as PaymentEntry,PaymentMaster.PaymentDueDate
from
ClientMaster,
FolloupMaster,
LeadMaster,
QuotationMasterNew,
InvoiceMasterNew,
PaymentMaster
)
select EmployeeMaster.intEmployeeID,
(EmployeeMaster.strFirstName + '' '' + isnull(EmployeeMaster.strMiddleName, '''') + '' '' + EmployeeMaster.strLastName) as FullName,
a.ClientEntry,a.FollowEntry,a.LeadEntry,a.QuotationEntry,a.InvoiceEntry,a.PaymentEntry,
ClientMaster.DataEnterDate,FolloupMaster.dtFollowDate,LeadMaster.dtleadDate,QuotationMasterNew.SubmitDate,InvoiceMasterNew.InvoiceDate,PaymentMaster.PaymentDueDate
--a.DataEnterDate,a.dtFollowDate,a.dtleadDate,a.SubmitDate,a.InvoiceDate,a.PaymentDueDate
from a,EmployeeMaster,ClientMaster,FolloupMaster,LeadMaster,QuotationMasterNew,InvoiceMasterNew,PaymentMaster ' + '' + @Criteria + ''
print @Condition
exec(@Condition)
END
//////////////////////////////////////////////
Cs Code In Button Click Event To Write Code .............................
////////////////////////////////////////////
string SearchCriteria = " WHERE 1=1 ";
if (Session["Role"].Equals("Admin"))
{
if (ddlEmployee.SelectedIndex != 0 && ddlEmployee.SelectedIndex != -1)
{
SearchCriteria = SearchCriteria + " AND EmployeeMaster.intEmployeeId=" + Convert.ToInt16(ddlEmployee.SelectedValue) + "";
}
}
else if (Session["Role"].Equals("Operator"))
{
SearchCriteria = SearchCriteria + " AND EmployeeMaster.intEmployeeId=" + Convert.ToInt16(ddlEmployee.SelectedValue) + "";
}
//if (ddlEmployee.SelectedIndex != 0)
//{
// SearchCriteria = SearchCriteria + " AND EmployeeMaster.intEmployeeID=" + Convert.ToInt16(ddlEmployee.SelectedValue) + "";
//}
if (ddlCompanyName.SelectedIndex != 0)
{
SearchCriteria = SearchCriteria + " AND InvoiceMAsterNew.CompanyId=" + Convert.ToInt16(ddlCompanyName.SelectedValue) + "";
}
if (txtTodate.Text != "")
{
SearchCriteria = SearchCriteria + " AND InvoiceMAsterNew.InvoiceDate>='" + txtTodate.Text.ToString() + "'";
}
if (txtFromdate.Text != "")
{
SearchCriteria = SearchCriteria + " AND InvoiceMAsterNew.InvoiceDate<='" + txtFromdate.Text.ToString() + "'";
}
Session["criteria"] = SearchCriteria.ToString();
Session["criteria"] = Session["criteria"].ToString().Replace("''", "'");
Response.Redirect("InvoiceSummaryReportResult.aspx");
////////////////////////////////////
birju gohelPosted Feb 13, 2015, 2:40 AM