Ejemplo n.º 1
0
        private List <Contract> LoadAndCompareAllContractInfo(List <Contract> contractList,
                                                              List <SearchField> otherSearchFieldList, bool isSearched, string partConst)
        {
            if ((otherSearchFieldList.Count > 0 && !isSearched) ||
                (otherSearchFieldList.Count == 0 && isSearched))
            {
                switch (partConst)
                {
                //加载员工年假信息
                case ContractFieldPara.VacationPart:
                    foreach (Contract Contract in contractList)
                    {
                        if (Contract.Employee == null)
                        {
                            continue;
                        }
                        Contract.Employee.EmployeeAttendance = Contract.Employee.EmployeeAttendance ??
                                                               new EmployeeAttendance();
                        Contract.Employee.EmployeeAttendance.Vacation =
                            new GetVacation().GetLastVacationByAccountID(Contract.Employee.Account.Id);
                    }
                    break;

                //加载员工调休信息
                case ContractFieldPara.AdjustPart:
                    foreach (Contract Contract in contractList)
                    {
                        if (Contract.Employee == null)
                        {
                            continue;
                        }
                        Contract.Employee.EmployeeAttendance = Contract.Employee.EmployeeAttendance ?? new EmployeeAttendance();
                        Contract.Employee.EmployeeAttendance.MonthAttendance =
                            Contract.Employee.EmployeeAttendance.MonthAttendance ?? new MonthAttendance();
                        Contract.Employee.EmployeeAttendance.MonthAttendance.HoursofAdjustRestRemained =
                            new GetAdjustRest().GetNowAdjustRestByAccountID(Contract.Employee.Account.Id).SurplusHours;
                    }
                    break;

                default:
                    break;
                }
                if (!isSearched)
                {
                    _ContractDoSearch = new ContractDoSearch(contractList, otherSearchFieldList);
                    _ContractDoSearch.DoSearchExecute();
                    contractList = _ContractDoSearch.ContractList;
                }
            }
            return(contractList);
        }
Ejemplo n.º 2
0
 private void CheckSearchFieldListValid()
 {
     //验证表达式是否正确
     _ContractDoSearch = new ContractDoSearch(new List <Contract>(), _SearchFieldList);
     _ContractDoSearch.DoSearchExecute();
 }