<asp:Repeater ID="Repeater2" runat="server" onitemcommand="Repeater2_ItemCommand">
<ItemTemplate>
<div class="archive_content">
<div class="archive_heading"><span><%# Eval("organisation_name")%> - <%# Eval("search_state") %></span></div>
<div class="archive_inner_content" style="width:777px;"> <asp:Image ID="Image1" style="height:48px;width:47px; border: 1px solid #999999;float: left;margin-right: 12px;" ImageUrl='<%# "GetOrganisationLogo.ashx?OrgID="+ Eval("organisation_id") %>' runat="server"></asp:Image> <span><strong> Website url -</strong><a href="<%# Eval("website")%>"><%# Eval("website")%></a></span><span><strong>Phone No. -</strong> <a href="#" style="cursor:text;"><%# Eval("landline_no")%></a> <span><strong>Email -</strong><a href="#"><%# Eval("email_id")%></a></span><asp:Label ID="Label1" runat="server" CssClass="test" Text='<%# Eval("description").ToString().Substring(0,200)%>'></asp:Label>
<%--<a href="SubmitInfo.aspx" class="read_more">Read More</a> </div>--%>
<asp:LinkButton ID="ReadMoreLinkButton" CommandName="Click" CommandArgument='<%#Eval("organisation_id") %>' CssClass="read_more" Text='Read More' OnClick="ReadMoreLinkButton_Click" runat="server">Read More</asp:LinkButton>
</div>
<div><br /><br /><br /><br /><br /><br /><br /><br /> </div>
</ItemTemplate>
</asp:Repeater>
protected void search_Button_Click1(object sender, EventArgs e)
{
searchtxts = SearchTextBox1.Text.ToString();
// Label1.Visible = true;
// Response.Redirect("/StudyLinksIndia/Register/Presentation/archive.aspx?city_id=" + search_city_id + "&org_type_id=" + search_organisation_type_id + "&state_id=" + search_state_id + "&searchtxt=" + searchtxts + "&stateBoxTxt=" + SearchTextBox1.Text.ToString());
//if (!IsPostBack)
//{
// DataTable dt = getImagesName();
// Repeater1.DataSource = dt;
// Repeater1.DataBind();
//}
int states = search_state_id;
int citys = search_city_id;
int orgtype = search_organisation_type_id;
string searchtxt = searchtxts;
//states = Convert.ToInt32(Request.QueryString["state_id"]);
//citys = Convert.ToInt32(Request.QueryString["city_id"]);
//orgtype = Convert.ToInt32(Request.QueryString["org_type_id"]);
//searchtxts = Convert.ToString(Request.QueryString["searchtxt"]);
//stateBoxTxt = Convert.ToString(Request.QueryString["stateBoxTxt"]);
if (states == 0 && citys == 0 && orgtype == 0 && searchtxts == "" )
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "Enter Some Data To Search";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else if (states == 0 && citys == 0 && orgtype == 0 && searchtxts != "")
{
communicator2 obj = new communicator2();
DataTable dt2 = new DataTable();
dt2 = obj.alldataSearch(searchtxts);
if (dt2.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
Repeater2.DataSource = dt2;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
else if (stateBoxTxt != "" && states == 0 && orgtype != 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
//else if (states == 0 && citys == 0 && orgtype == 0 && searchtxts == "")
//{
// communicator2 obj = new communicator2();
// DataTable dt3 = new DataTable();
// dt3 = obj.selectAllData();
// if (dt3.Rows.Count == 0)
// {
// ScriptManager.RegisterStartupScript(this, this.GetType(), "redirect",
// "alert('Record Not Found'); window.location='" +
// Request.ApplicationPath + "/Default.aspx';", true);
// }
// else
// {
// GridView1.DataSource = dt3;
// GridView1.DataBind();
// }
//}
//proc not change
else if (states != 0 && citys == 0 && orgtype != 0 && searchtxts == "")
{
communicator2 obj = new communicator2();
DataTable dt4 = new DataTable();
dt4 = obj.searchAccToState(states, orgtype);
if (dt4.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt4;
//GridView1.DataBind();
Repeater2.DataSource = dt4;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
//proc not change
else if (states != 0 && citys == 0 && orgtype == 0 && searchtxts == "")
{
communicator2 obj = new communicator2();
DataTable dt5 = new DataTable();
dt5 = obj.searchAccToState(states);
if (dt5.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt5;
//GridView1.DataBind();
Repeater2.DataSource = dt5;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
//proc not change
else if (states != 0 && citys != 0 && orgtype == 0 && searchtxts == "")
{
communicator2 obj = new communicator2();
DataTable dt6 = new DataTable();
dt6 = obj.Search_AccTo_StateAndCity(states, citys);
if (dt6.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt6;
//GridView1.DataBind();
Repeater2.DataSource = dt6;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
//proc not change
else if (states != 0 && citys != 0 && orgtype != 0 && searchtxts != "")
{
communicator2 obj1 = new communicator2();
DataTable dt = new DataTable();
dt = obj1.Search_AccTo_condition(states, citys, orgtype, searchtxts);
if (dt.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt;
//GridView1.DataBind();
Repeater2.DataSource = dt;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
//proc not change
else if (states != 0 && citys == 0 && orgtype == 0 && searchtxts != "")
{
communicator2 obj = new communicator2();
DataTable dt7 = new DataTable();
dt7 = obj.Search_accTo_searchTxt_and_State(states, searchtxts);
if (dt7.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt7;
//GridView1.DataBind();
Repeater2.DataSource = dt7;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
//proc not change
else if (states != 0 && citys != 0 && orgtype == 0 && searchtxts != "")
{
communicator2 obj = new communicator2();
DataTable dt8 = new DataTable();
dt8 = obj.search_accTo_serchTxt_and_state_and_city(states, citys, searchtxts);
if (dt8.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt8;
//GridView1.DataBind();
Repeater2.DataSource = dt8;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
else if (states == 0 && citys == 0 && orgtype != 0 && searchtxts == "")
{
communicator2 obj = new communicator2();
DataTable dt8 = new DataTable();
dt8 = obj.selectOrgType(orgtype);
if (dt8.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt8;
//GridView1.DataBind();
Repeater2.DataSource = dt8;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
else if (states == 0 && citys == 0 && orgtype != 0 && searchtxts != "")
{
communicator2 obj = new communicator2();
DataTable dt8 = new DataTable();
dt8 = obj.Search_AccTo_serchTxt_and_Organisation(orgtype, searchtxts);
if (dt8.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt8;
//GridView1.DataBind();
Repeater2.DataSource = dt8;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
else if (states == 0 && citys != 0 && orgtype == 0 && searchtxts == "")
{
communicator2 obj = new communicator2();
DataTable dt9 = new DataTable();
dt9 = obj.Search_accTo_city(citys);
if (dt9.Rows.Count == 0)
{
//Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
//GridView1.DataSource = dt9;
//GridView1.DataBind();
Repeater2.DataSource = dt9;
Repeater2.DataBind();
LabelMsg.Text = "";
}
}
else if (stateBoxTxt != "" && states == 0 && orgtype != 0)
{
// Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
else
{
// Response.Redirect("../../Default.aspx");
LabelMsg.Text = "No Record Found";
Repeater2.DataSource = null;
Repeater2.DataBind();
}
LocationtextBox.Text = "";
State_textBox.Text = "";
Interested_textBox.Text = "";
SearchTextBox1.Text = "";
search_city_id = 0;
search_state_id = 0;
search_organisation_type_id = 0;
Repeater2.DataSource="";
}
protected void State_textBox_TextChanged(object sender, EventArgs e)
{
LocationtextBox.Text = "";
SearchTextBox1.Text = "";
Interested_textBox.Text = "";
string statename = State_textBox.Text.ToString();
savedetails2 obj = new savedetails2();
DataTable dt6 = new DataTable();
dt6 = obj.get_search_state_id(statename);
if (dt6.Rows.Count == 0)
{
search_state_id = 0;
}
else
{
search_state_id = Convert.ToInt32(dt6.Rows[0]["search_state_id"]);
}
}
protected void LocationtextBox_TextChanged(object sender, EventArgs e)
{
string citytxt = LocationtextBox.Text.ToString();
savedetails2 obj = new savedetails2();
DataTable dt7 = new DataTable();
dt7 = obj.get_search_city_id(citytxt);
if (dt7.Rows.Count == 0)
{
search_city_id = 0;
}
else
{
search_city_id = Convert.ToInt32(dt7.Rows[0]["search_city_id"]);
}
}
protected void Interested_textBox_TextChanged(object sender, EventArgs e)
{
string interestType = Interested_textBox.Text.ToString();
savedetails2 obj = new savedetails2();
DataTable dt8 = new DataTable();
dt8 = obj.Get_search_organisation_type_id(interestType);
if (dt8.Rows.Count == 0)
{
search_organisation_type_id = 0;
}
else
{
search_organisation_type_id = Convert.ToInt32(dt8.Rows[0]["search_organisation_type_id"]);
}
}
public DataTable getImagesName()
{
connection con = new connection();
con.getconnectionstring();
SqlCommand sqlcmd;
sqlcmd = new SqlCommand("getImageName", connection.con);
sqlcmd.CommandType = CommandType.StoredProcedure;
DataTable ds = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(sqlcmd);
da.Fill(ds);
return ds;
}