本文整理汇总了C#中BAL.ClsBAL.GetAgents方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.GetAgents方法的具体用法?C# ClsBAL.GetAgents怎么用?C# ClsBAL.GetAgents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.GetAgents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAgentNames
public static string[] GetAgentNames(string prefixText)
{
try
{
DataSet ds = new DataSet();
ClsBAL objBal = new ClsBAL();
ds = objBal.GetAgents();
string filteringquery = "Username LIKE'" + prefixText + "%'";
//Select always return array,thats why we store it into array of Datarow
DataRow[] dr = ds.Tables[0].Select(filteringquery);
//create new table
DataTable dtNew = new DataTable();
//create a clone of datatable dt and store it into new datatable
dtNew = ds.Tables[0].Clone();
//fetching all filtered rows add add into new datatable
foreach (DataRow drNew in dr)
{
dtNew.ImportRow(drNew);
}
//return dtAirportCodes;
List<string> airports = new List<string>();
for (int i = 0; i < dtNew.Rows.Count; i++)
{
airports.Add(dtNew.Rows[i]["Username"].ToString().Trim());
}
return airports.ToArray();
}
catch (Exception)
{
throw;
}
}
示例2: GetAgents
DataSet GetAgents()
{
try
{
ClsBAL objbal = new ClsBAL();
return objbal.GetAgents();
}
catch (Exception ex)
{
// lblMsg.InnerHtml = ex.Message;
throw;
}
}