Click here to Skip to main content
15,881,173 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionVisual Studio Team Suite UNIT TESTING Pin
Satish_S10-Aug-11 20:55
Satish_S10-Aug-11 20:55 
AnswerRe: Visual Studio Team Suite UNIT TESTING Pin
R. Giskard Reventlov10-Aug-11 22:50
R. Giskard Reventlov10-Aug-11 22:50 
GeneralRe: Visual Studio Team Suite UNIT TESTING Pin
Richard MacCutchan10-Aug-11 22:56
mveRichard MacCutchan10-Aug-11 22:56 
GeneralRe: Visual Studio Team Suite UNIT TESTING Pin
Shameel11-Aug-11 4:59
professionalShameel11-Aug-11 4:59 
AnswerMy Vote of 1 Pin
Keith Barrow10-Aug-11 23:13
professionalKeith Barrow10-Aug-11 23:13 
QuestionHow to take Multiple instance of same Web User Control on Same PAge ...? Pin
_Tushar Patil10-Aug-11 0:47
_Tushar Patil10-Aug-11 0:47 
AnswerRe: How to take Multiple instance of same Web User Control on Same PAge ...? Pin
Shameel10-Aug-11 2:22
professionalShameel10-Aug-11 2:22 
GeneralRe: How to take Multiple instance of same Web User Control on Same PAge ...? Pin
_Tushar Patil10-Aug-11 2:24
_Tushar Patil10-Aug-11 2:24 
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public delegate void SendDataFromSearchControl(int iSelectedCustId);

public partial class SearchControl : System.Web.UI.UserControl
{
#region members
public event SendDataFromSearchControl Event_Selected;
string cmdSearchCustomer;
string select_what, select_from_database, search_text, search_listbox_value_field,condition_name,matching_condition;
bool flaglstbox = false;
#endregion

#region Properties
public string SELECT_WHAT
{
get
{
return ViewState["select_what"].ToString();
}
set
{
ViewState["select_what"] = value;
}

}
public string SELECT_FROM_DATABASE
{
get
{
return ViewState["select_from_database"].ToString();
}
set
{
ViewState["select_from_database"] = value;
}

}
public string SEARCH_TEXT
{
get
{
return ViewState["search_text"].ToString();

}
set
{
ViewState["search_text"] = value;
}
}
public string SEARCH_LISTBOX_VALUE_FIELD
{

get
{
return ViewState["search_listbox_value_field"].ToString();

}
set
{
ViewState["search_listbox_value_field"] = value;
}

}


public string Condition_Name
{

get
{
return ViewState["Condition_Name"].ToString();

}
set
{
ViewState["Condition_Name"] = value;
}

}
public string Matching_Condition
{

get
{
return ViewState["Matching_Condition"].ToString();

}
set
{
ViewState["Matching_Condition"] = value;
}

}

#endregion


protected void Page_Load(object sender, EventArgs e)
{
select_what = SELECT_WHAT;
select_from_database = SELECT_FROM_DATABASE;
search_text = SEARCH_TEXT;
search_listbox_value_field = SEARCH_LISTBOX_VALUE_FIELD;
condition_name = Condition_Name;
matching_condition = Matching_Condition;

}


#region Events

protected void lstcust_SelectedIndexChanged(object sender, EventArgs e)
{


}
protected void btnsearch_Click(object sender, EventArgs e)
{
if (txrsearch.Text == "")
{
// cmdSearchCustomer = "select " + search_listbox_value_field + " ," + select_what + " from " + select_from_database + " ORDER BY " + select_what + " ASC And "+condition_name+"="+matching_condition+"";

cmdSearchCustomer = "select " + search_listbox_value_field + " ," + select_what + " from " + select_from_database + " Where " + condition_name + "='"+matching_condition+"' ORDER BY " + select_what + " ASC";
}
else
{
cmdSearchCustomer = "select " + search_listbox_value_field + " ," + select_what + " from " + select_from_database + " where " + search_text + " like '" + txrsearch.Text + "%' And "+condition_name+"='"+matching_condition+"' ORDER BY " + select_what + " ASC";
}


DataSet ds = MIS_DAL.Fill(cmdSearchCustomer);
if (ds.Tables[0].Rows.Count > 0)
{
lstcust.Items.Clear();
lstcust.AppendDataBoundItems = true;

lstcust.DataSource = ds.Tables[0];
lstcust.DataTextField = select_what;
lstcust.DataValueField = search_listbox_value_field;
lstcust.DataBind();

}
else
{
Alert.Show("No Customer Found");


}




}
protected void txrsearch_TextChanged(object sender, EventArgs e)
{


}
protected void btnreturn_Click(object sender, EventArgs e)
{

}

protected void lstcust_SelectedIndexChanged1(object sender, EventArgs e)
{
Session["flaglstbox"] =(bool) true;

}
protected void btnselect_Click1(object sender, EventArgs e)
{
if ((bool)Session["flaglstbox"] == true)
{

if (Event_Selected != null)
{
this.Event_Selected(int.Parse(lstcust.SelectedItem.Value));
// Event_Selected(int.Parse(lstcust.SelectedItem.Value));
}
lstcust.Items.Clear();
txrsearch.Text = "";
}
else
{

}

}
protected void btncancel_Click(object sender, EventArgs e)
{
lstcust.Items.Clear();
txrsearch.Text = "";
}

#endregion

}
GeneralRe: How to take Multiple instance of same Web User Control on Same PAge ...? Pin
Shameel10-Aug-11 4:24
professionalShameel10-Aug-11 4:24 
GeneralRe: How to take Multiple instance of same Web User Control on Same PAge ...? Pin
Not Active10-Aug-11 5:46
mentorNot Active10-Aug-11 5:46 
GeneralRe: How to take Multiple instance of same Web User Control on Same PAge ...? Pin
Not Active10-Aug-11 6:04
mentorNot Active10-Aug-11 6:04 
GeneralRe: How to take Multiple instance of same Web User Control on Same PAge ...? Pin
Shameel10-Aug-11 9:36
professionalShameel10-Aug-11 9:36 
QuestionNUnitTest Pin
Satish_S9-Aug-11 23:55
Satish_S9-Aug-11 23:55 
AnswerRe: NUnitTest Pin
Shameel10-Aug-11 2:20
professionalShameel10-Aug-11 2:20 
QuestionASP:Menu Text labels Pin
Christopher Hill9-Aug-11 6:20
Christopher Hill9-Aug-11 6:20 
AnswerRe: ASP:Menu Text labels Pin
Morgs Morgan9-Aug-11 20:45
Morgs Morgan9-Aug-11 20:45 
GeneralRe: ASP:Menu Text labels Pin
Christopher Hill10-Aug-11 4:33
Christopher Hill10-Aug-11 4:33 
GeneralRe: ASP:Menu Text labels Pin
Morgs Morgan10-Aug-11 5:07
Morgs Morgan10-Aug-11 5:07 
QuestionWith out SQL identity column inserting the datas, via asp.net Pin
Member 38798819-Aug-11 1:02
Member 38798819-Aug-11 1:02 
AnswerRe: With out SQL identity column inserting the datas, via asp.net Pin
Not Active9-Aug-11 1:51
mentorNot Active9-Aug-11 1:51 
AnswerRe: With out SQL identity column inserting the datas, via asp.net Pin
Morgs Morgan9-Aug-11 20:40
Morgs Morgan9-Aug-11 20:40 
AnswerRe: With out SQL identity column inserting the datas, via asp.net Pin
Tech Code Freak11-Aug-11 1:56
Tech Code Freak11-Aug-11 1:56 
Questioni want to make download link. Pin
buffering838-Aug-11 21:07
buffering838-Aug-11 21:07 
AnswerRe: i want to make download link. Pin
Shameel8-Aug-11 23:58
professionalShameel8-Aug-11 23:58 
AnswerRe: i want to make download link. Pin
Pravin Patil, Mumbai9-Aug-11 1:08
Pravin Patil, Mumbai9-Aug-11 1:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.