本文整理匯總了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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];
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
//.........這裏部分代碼省略.........