当前位置: 首页>>代码示例>>C#>>正文


C# QueryBuilder.QueryForCompanyFilters方法代码示例

本文整理汇总了C#中WMS.CustomClass.QueryBuilder.QueryForCompanyFilters方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.QueryForCompanyFilters方法的具体用法?C# QueryBuilder.QueryForCompanyFilters怎么用?C# QueryBuilder.QueryForCompanyFilters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WMS.CustomClass.QueryBuilder的用法示例。


在下文中一共展示了QueryBuilder.QueryForCompanyFilters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindGridViewEmployee

 private void BindGridViewEmployee(string search)
 {
     FiltersModel fm = Session["FiltersModel"] as FiltersModel;
     List<EmpView> _View = new List<EmpView>();
     List<EmpView> _TempView = new List<EmpView>();
     User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
     QueryBuilder qb = new QueryBuilder();
     string query = qb.QueryForCompanyFilters(LoggedInUser);
     DataTable dt = qb.GetValuesfromDB("select * from EmpView " + query);
     _View = dt.ToList<EmpView>().AsQueryable().SortBy("EmpNo").ToList();
     if (fm.CompanyFilter.Count > 0)
     {
         foreach (var comp in fm.CompanyFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.CompanyID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.DivisionFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.DivisionFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.DivID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.DepartmentFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.DepartmentFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.DeptID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.SectionFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.SectionFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.SecID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.TypeFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.TypeFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.TypeID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.LocationFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.LocationFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.LocID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.ShiftFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.ShiftFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.ShiftID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     if (fm.CrewFilter.Count > 0)
     {
         _TempView.Clear();
         foreach (var comp in fm.CrewFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.CrewID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     GridViewEmployee.DataSource = _View.Where(aa => aa.EmpName.ToUpper().Contains(search.ToUpper()) ||aa.EmpNo.ToUpper().Contains(search.ToUpper())).ToList();
     GridViewEmployee.DataBind();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:92,代码来源:StepFiveFilter.aspx.cs

示例2: BindGridViewCrew

 private void BindGridViewCrew(string search)
 {
     FiltersModel fm = Session["FiltersModel"] as FiltersModel;
     List<ViewCrew> _View = new List<ViewCrew>();
     List<ViewCrew> _TempView = new List<ViewCrew>();
     User LoggedInUser = HttpContext.Current.Session["LoggedUser"] as User;
     QueryBuilder qb = new QueryBuilder();
     string query = qb.QueryForCompanyFilters(LoggedInUser);
     DataTable dt = qb.GetValuesfromDB("select * from ViewCrew " + query);
     _View = dt.ToList<ViewCrew>();
     if (fm.CompanyFilter.Count > 0)
     {
         foreach (var comp in fm.CompanyFilter)
         {
             short _compID = Convert.ToInt16(comp.ID);
             _TempView.AddRange(_View.Where(aa => aa.CompanyID == _compID).ToList());
         }
         _View = _TempView.ToList();
     }
     GridViewCrew.DataSource = _View.Where(aa => aa.CrewName.ToUpper().Contains(search.ToUpper())).ToList();
     GridViewCrew.DataBind();
 }
开发者ID:qq5013,项目名称:WMS-Fatima,代码行数:22,代码来源:StepFourFilter.aspx.cs


注:本文中的WMS.CustomClass.QueryBuilder.QueryForCompanyFilters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。