本文整理汇总了C#中BAL.ClsBAL.GetDestinations方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.GetDestinations方法的具体用法?C# ClsBAL.GetDestinations怎么用?C# ClsBAL.GetDestinations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.GetDestinations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetDestinations
public static String GetDestinations(String sourceId)
{
try
{
ClsBAL objBAL = new ClsBAL();
DataSet ObjDataset = objBAL.GetDestinations(sourceId);
StringBuilder sbDestinations = new StringBuilder();
if (ObjDataset != null)
{
if (ObjDataset.Tables.Count > 0)
{
DataTable dtDestinations = ObjDataset.Tables[0];
HttpContext.Current.Session["sesDTDestinations"] = dtDestinations;
sbDestinations.Append("<select id=\"ddldestinationsDiv\" name=\"ddldestinationsDiv\" style=\"width:130px;\" >");
sbDestinations.Append("<option value=''>----------</option>");
if (dtDestinations.Rows.Count > 0)
{
foreach (DataRow item in dtDestinations.Rows)
{
sbDestinations.Append("<option value=" + item["ID"].ToString() + ">" + item["DestinationName"].ToString() + "</option>");
}
}
sbDestinations.Append("</select>");
}
}
return sbDestinations.ToString();
}
catch (Exception ex)
{
throw ex;
}
}
示例2: ddlSources_SelectedIndexChanged
protected void ddlSources_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
ddlDestinations.Items.Clear();
ddlDestinations.Items.Insert(0, "----------");
if (ddlSources.SelectedIndex != 0 && ddlSources.SelectedItem.Value != "----------")
{
string str = ddlSources.SelectedItem.Value.ToString();
objBAL = new ClsBAL();
objDataSet = objBAL.GetDestinations(str);
if (objDataSet != null)
{
if (objDataSet.Tables.Count > 0)
{
if (objDataSet.Tables[0].Rows.Count > 0)
{
Session["sesDTDestinations"] = objDataSet.Tables[0];
ddlDestinations.Items.Clear();
ddlDestinations.DataSource = objDataSet.Tables[0];
ddlDestinations.DataTextField = "DestinationName";
ddlDestinations.DataValueField = "ID";
ddlDestinations.DataBind();
ddlDestinations.Items.Insert(0, "----------");
}
}
}
}
}
catch (Exception)
{
throw;
}
}