本文整理汇总了C#中WMS.CustomClass.QueryBuilder.QueryForLocReport方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.QueryForLocReport方法的具体用法?C# QueryBuilder.QueryForLocReport怎么用?C# QueryBuilder.QueryForLocReport使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WMS.CustomClass.QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.QueryForLocReport方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindGridViewLocation
private void BindGridViewLocation(string search)
{
FiltersModel fm = Session["FiltersModel"] as FiltersModel;
List<Location> _View = new List<Location>();
List<Location> _TempView = new List<Location>();
TAS2013Entities db = new TAS2013Entities();
User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
QueryBuilder qb = new QueryBuilder();
string query = qb.QueryForLocReport(LoggedInUser);
List<City> city = db.Cities.ToList();
DataTable dt = qb.GetValuesfromDB("select * from Location " + query+" order by LocName asc");
_View = dt.ToList<Location>();
if (fm.RegionFilter.Count > 0)
{
_TempView.Clear();
foreach (var region in fm.RegionFilter)
{
short regionID = Convert.ToInt16(region.ID);
foreach (var c in city.Where(aa => aa.RegionID == regionID))
{
_TempView.AddRange(_View.Where(aa => aa.CityID == c.CityID).ToList());
}
}
_View = _TempView.ToList();
}
if (fm.CityFilter.Count > 0)
{
_TempView.Clear();
foreach (var citi in fm.CityFilter)
{
short _compID = Convert.ToInt16(citi.ID);
_TempView.AddRange(_View.Where(aa => aa.CityID == _compID).ToList());
}
_View = _TempView.ToList();
}
GridViewLocation.DataSource = _View.Where(aa => aa.LocName.ToUpper().Contains(search.ToUpper())).ToList();
GridViewLocation.DataBind();
}