public void StatisticsEmployee(object source, EventArgs e) { if (CheckValid()) { try { //在此收集数据源以防底层查询很多次 List <Employee> employeesource = _IEmployeeHistoryFacade.GetEmployeeOnDutyByDepartmentAndDateTime( _ICommonStatisticsView.IStatisticsConditionView.DepartmentID, Convert.ToDateTime(_ICommonStatisticsView.IStatisticsConditionView.StatisticsTime), true, _Operator, HrmisPowers.A405, null); EmployeeStatistics EmployeeStatistics = _IEmployeeStatisticsFacade.BindEmployeeStatistics(DateTime.Now, _ICommonStatisticsView. IStatisticsConditionView. DepartmentID, _Operator, employeesource); _ICommonStatisticsView.IAgePieChartView.EmployeeStatistics = EmployeeStatistics; _ICommonStatisticsView.IGenderPieChartView.EmployeeStatistics = EmployeeStatistics; _ICommonStatisticsView.IEduBgPieChartView.EmployeeStatistics = EmployeeStatistics; _ICommonStatisticsView.IWorkTypePieChartView.EmployeeStatistics = EmployeeStatistics; _ICommonStatisticsView.IWorkAgePieChartView.EmployeeStatistics = EmployeeStatistics; ComeAndLeaveTablePresenter ComeAndLeaveTablePresenter = new ComeAndLeaveTablePresenter(_ICommonStatisticsView.IComeAndLeaveTableView, _ICommonStatisticsView.IStatisticsConditionView, _Operator); ComeAndLeaveTablePresenter.DrawChart(); _ICommonStatisticsView.IComeAndLeaveBarChartView.EmployeeComeAndLeaveList = _ICommonStatisticsView.IComeAndLeaveTableView.EmployeeComeAndLeaveList; _ICommonStatisticsView.ILeaveRateLineChartView.EmployeeComeAndLeaveList = _ICommonStatisticsView.IComeAndLeaveTableView.EmployeeComeAndLeaveList; PositionGradeTowerTablePresenter PositionGradeTowerTablePresenter = new PositionGradeTowerTablePresenter(_ICommonStatisticsView.IPositionGradeTowerTableView, _ICommonStatisticsView.IStatisticsConditionView, _Operator); PositionGradeTowerTablePresenter.DrawChart(employeesource); OtherStatisticsDataPresenter OtherStatisticsDataPresenter = new OtherStatisticsDataPresenter(_ICommonStatisticsView.IOtherStatisticsDataView, _ICommonStatisticsView.IStatisticsConditionView, _Operator); OtherStatisticsDataPresenter.BindData(employeesource, _ICommonStatisticsView.IComeAndLeaveTableView.EmployeeComeAndLeaveList[11]); } catch (ApplicationException) { //_IMonthAttendanceView.Message = "<span class='fontred'>" + ex.Message + "</span>"; } } }
public void StatisticsEmployee(object source, EventArgs e) { if (new StatisticsConditionPresenter(_IComeAndLeaveIndexView.IStatisticsConditionView, _Operator).CheckValid()) { try { ComeAndLeaveTablePresenter ComeAndLeaveTablePresenter = new ComeAndLeaveTablePresenter(_IComeAndLeaveIndexView.IComeAndLeaveTableView, _IComeAndLeaveIndexView.IStatisticsConditionView, _Operator); ComeAndLeaveTablePresenter.DrawChart(); _IComeAndLeaveIndexView.IComeAndLeaveBarChartView.EmployeeComeAndLeaveList = _IComeAndLeaveIndexView.IComeAndLeaveTableView.EmployeeComeAndLeaveList; _IComeAndLeaveIndexView.ILeaveRateLineChartView.EmployeeComeAndLeaveList = _IComeAndLeaveIndexView.IComeAndLeaveTableView.EmployeeComeAndLeaveList; } catch (ApplicationException) { //_IMonthAttendanceView.Message = "<span class='fontred'>" + ex.Message + "</span>"; } } }