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


C# Searcher.EmployeeSearcher类代码示例

本文整理汇总了C#中NFramework.DBTool.Test.Searcher.EmployeeSearcher的典型用法代码示例。如果您正苦于以下问题:C# EmployeeSearcher类的具体用法?C# EmployeeSearcher怎么用?C# EmployeeSearcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EmployeeSearcher类属于NFramework.DBTool.Test.Searcher命名空间,在下文中一共展示了EmployeeSearcher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindList

 /// <summary>
 /// 查找指定条件的员工集合
 /// </summary>
 /// <param name="employeeSearcher">员工查询对象</param>
 /// <returns>返回员工实体对象集合</returns>
 public IList<Employee> FindList(EmployeeSearcher employeeSearcher)
 {
     PageList<Employee> pageList = this.FindList(employeeSearcher, null, null);
     return pageList == null ? null : pageList.RecordList;
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:10,代码来源:EmployeeDal.cs

示例2: FindEmployeeByNotLikeConditionStringTest

 public void FindEmployeeByNotLikeConditionStringTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     // 这句应该写入Dal进行控制,这里用于测试
     empSearcher.Name.ConditionString = "LOWER(" + SQLPlaceholder.ColName + ")";
     empSearcher.Name.NotLike("emp");
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     int allCount = 0;
     Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:10,代码来源:QueryTest.cs

示例3: FindEmployeeBySingleSortTest

 public void FindEmployeeBySingleSortTest()
 {
     EmployeeSearcher employeeSearcher = new EmployeeSearcher();
     employeeSearcher.Rand.SortOrder = SortOrder.Desc;
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(employeeSearcher);
     Assert.IsTrue(employeeList[0].Rand >= employeeList[1].Rand);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:7,代码来源:QueryTest.cs

示例4: FindEmployeeByNotInColumnTest

 public void FindEmployeeByNotInColumnTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     empSearcher.JoinDate.NotIn(new SearchColumn[] { empSearcher.StartWorkDate });
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     bool isSucc = employeeList == null ? false : (employeeList.Count >= 1 ? true : false);
     Assert.AreEqual(true, isSucc);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:8,代码来源:QueryTest.cs

示例5: FindEmployeeByNotInTest

 public void FindEmployeeByNotInTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     empSearcher.EmployeeCode.NotIn(QueryTest.EmployeeCodeList.ToArray());
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     int allCount = 770;
     Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:8,代码来源:QueryTest.cs

示例6: FindEmployeeByMultipleSortStringTest

 public void FindEmployeeByMultipleSortStringTest()
 {
     EmployeeSearcher employeeSearcher = new EmployeeSearcher();
     // 这句应该写入Dal进行控制,这里用于测试
     employeeSearcher.EmployeeCode.SortString = "SUBSTRING(" + SQLPlaceholder.ColName + ", 1, 6)";
     employeeSearcher.EmployeeCode.SortOrder = SortOrder.Desc;
     employeeSearcher.EmployeeCode.SortIndex = 1;
     employeeSearcher.Rand.SortOrder = SortOrder.Desc;
     employeeSearcher.Rand.SortIndex = 2;
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(employeeSearcher);
     Assert.IsTrue(employeeList[0].CompanyId.Equals(employeeList[1].CompanyId));
     Assert.IsTrue(employeeList[0].Rand >= employeeList[1].Rand);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:13,代码来源:QueryTest.cs

示例7: FindEmployeeByNotEqualConditionStringTest

 public void FindEmployeeByNotEqualConditionStringTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     // 这句应该写入Dal进行控制,这里用于测试
     empSearcher.Birthday.ConditionString = "MONTH(" + SQLPlaceholder.ColName + ")";
     empSearcher.Birthday.NotEqual(10);
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     int allCount = 779;
     Assert.AreEqual(allCount, 779);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:10,代码来源:QueryTest.cs

示例8: FindEmployeeByConditionGroupTest2

        public void FindEmployeeByConditionGroupTest2()
        {
            EmployeeSearcher employeeSearcher = new EmployeeSearcher();
            employeeSearcher.CurrCompany = new CompanySearcher();

            Group.And(Group.Or(employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[4]), employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[5]),
                               Group.Or(employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[0]), employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[1])),
                               Group.Or(employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[2]), employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[3]))),
                      Group.Or(employeeSearcher.CurrCompany.CompanyCode.Equal("10201"), employeeSearcher.CurrCompany.CompanyCode.Equal("10301"),
                               Group.Or(employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[6]), employeeSearcher.EmployeeCode.Equal(QueryTest.EmployeeCodeList[7]))));

            IList<Employee> employeeList = OrgHandler.FindEmployeeList(employeeSearcher);
            int allCount = 6;
            Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
        }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:15,代码来源:QueryTest.cs

示例9: FindEmployeeBySQLNotInTest

 public void FindEmployeeBySQLNotInTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     // SQL应该写入Dal进行控制,这里用于测试
     StringBuilder subQuery = new StringBuilder();
     subQuery.Append("SELECT ");
     subQuery.Append("  DSub.DepartmentId ");
     subQuery.Append("FROM ");
     subQuery.Append("  Department DSub ");
     subQuery.Append("WHERE ");
     subQuery.Append("  DSub.CurrCompany.CompanyCode = '10401' ");
     empSearcher.CurrDepartment = new DepartmentSearcher();
     empSearcher.CurrDepartment.DepartmentId.SQLNotIn(subQuery.ToString());
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     int allCount = 624;
     Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:17,代码来源:QueryTest.cs

示例10: FindSingle

 /// <summary>
 /// 查找指定ID的员工
 /// </summary>
 /// <param name="employeeId">员工ID</param>
 /// <param name="tran">中间事务对象</param>
 /// <returns>返回员工实体对象</returns>
 public Employee FindSingle(string employeeId, ICTransaction tran)
 {
     EmployeeSearcher employeeSearcher = new EmployeeSearcher();
     employeeSearcher.EmployeeId.Equal(employeeId);
     IList<Employee> employeeList = this.FindList(employeeSearcher);
     return (employeeList == null || employeeList.Count == 0) ? null : employeeList[0];
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:13,代码来源:EmployeeDal.cs

示例11: FindEmployeeBySQLNotInConditionStringTest

 public void FindEmployeeBySQLNotInConditionStringTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     // SQL应该写入Dal进行控制,这里用于测试
     StringBuilder subQuery = new StringBuilder();
     subQuery.Append("SELECT ");
     subQuery.Append("  DSub.DepartmentId ");
     subQuery.Append("FROM ");
     subQuery.Append("  Department DSub ");
     subQuery.Append("LEFT JOIN ");
     subQuery.Append("  Company CSub ON(CSub.CompanyId=DSub.CompanyId) ");
     subQuery.Append("WHERE ");
     subQuery.Append("  CSub.CompanyCode = '10401' ");
     empSearcher.CurrDepartment = new DepartmentSearcher();
     empSearcher.CurrDepartment.DepartmentId.ConditionString = "LOWER(" + SQLPlaceholder.ColName + ")";
     empSearcher.CurrDepartment.DepartmentId.SQLNotIn(subQuery.ToString());
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     int allCount = 624;
     Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:20,代码来源:QueryTest.cs

示例12: FindEmployeeByLessThanTest

 public void FindEmployeeByLessThanTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     empSearcher.Rand.LessThan(15);
     IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
     int allCount = 750;
     Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:8,代码来源:QueryTest.cs

示例13: FindEmployeeForPagerTest

 public void FindEmployeeForPagerTest()
 {
     EmployeeSearcher empSearcher = new EmployeeSearcher();
     empSearcher.CurrPosition = new PositionSearcher();
     empSearcher.CurrPosition.PositionCode.Equal("3102010003");
     Pager pager = new Pager();
     pager.CurrentPage = 2;
     pager.PageSize = 15;
     PageList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher, pager);
     int pageCount = 15;
     int allCount = 30;
     Assert.AreEqual(pageCount, employeeList.RecordList.Count);
     Assert.AreEqual(allCount, employeeList.TotalCount);
 }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:14,代码来源:QueryTest.cs

示例14: FindEmployeeByLikeTest

        public void FindEmployeeByLikeTest()
        {
            EmployeeSearcher empSearcher = new EmployeeSearcher();
            empSearcher.Name.Like("Emp");
            IList<Employee> employeeList = OrgHandler.FindEmployeeList(empSearcher);
            int allCount = 780;
            Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);

            empSearcher = new EmployeeSearcher();
            empSearcher.EmployeeCode.Like("510201");
            employeeList = OrgHandler.FindEmployeeList(empSearcher);
            allCount = 156;
            Assert.AreEqual(allCount, employeeList == null ? 0 : employeeList.Count);
        }
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:14,代码来源:QueryTest.cs

示例15: AddDataTest

        public void AddDataTest()
        {
            #region Clear All Data

            OrgHandler.DeleteEmployee(new EmployeeSearcher());
            OrgHandler.DeletePosition(new PositionSearcher());
            OrgHandler.DeleteDepartment(new DepartmentSearcher());
            OrgHandler.DeleteCompany(new CompanySearcher());

            #endregion

            string companyName = " Com. Ltd.";
            Company company = null;
            Department department = null;
            Position position = null;
            Employee employee = null;
            int depCode = 1;
            int posCode = 1;
            int empCode = 1;
            int empCount = 30;
            Random rand = new Random(DateTime.Now.Hour);

            string[][] companyNamePool = new string[][] {
                new string[]{"ABC","10201"},
                new string[]{"DEF","10301"},
                new string[]{"GHI","10202"},
                new string[]{"JKL","10203"},
                new string[]{"MNO","10401"}
            };

            string[] departmentNamePool = new string[]{
                "GM",
                "Finance",
                "HR",
                "Sales",
                "Marketing",
                "Executive"
            };

            string[] positionNamePool = new string[] {
                "GM",
                "Specialist"
            };

            long allEmpCount = 780;

            foreach (string[] cName in companyNamePool)
            {
                company = new Company();
                company.Name = cName[0] + companyName;
                company.CompanyCode = cName[1];
                company.CreaterId = "00000000000";
                company.UpdatorId = "00000000000";
                company.RVersion = 1;
                company.Status = 1;
                OrgHandler.AddCompany(company);
                depCode = 1;
                empCode = 1;
                posCode = 1;

                foreach (string dName in departmentNamePool)
                {
                    department = new Department();
                    department.CurrCompany = company;
                    department.Name = dName;
                    department.DepartmentCode = "2" + company.CompanyCode + string.Format("{0:0000}", depCode);
                    department.CreaterId = "00000000000";
                    department.UpdatorId = "00000000000";
                    department.RVersion = 1;
                    department.Status = 1;
                    OrgHandler.AddDepartment(department);

                    foreach (string pName in positionNamePool)
                    {
                        position = new Position();
                        position.CurrCompany = company;
                        position.CurrDepartment = department;
                        position.PositionCode = "3" + company.CompanyCode + string.Format("{0:0000}", posCode);
                        position.CreaterId = "00000000000";
                        position.UpdatorId = "00000000000";
                        position.RVersion = 1;
                        position.Status = 1;

                        if (pName.Equals("GM"))
                        {
                            if (dName.Equals("GM"))
                            {
                                position.Name = pName;
                            }
                            else
                            {
                                position.Name = dName + " " + pName;
                            }

                            empCount = 1;
                        }
                        else
                        {
                            position.Name = dName + " " + pName;

//.........这里部分代码省略.........
开发者ID:pmsun-bruce,项目名称:DBTool,代码行数:101,代码来源:QueryTest.cs


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