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