/// GetNewRefId /// </summary> /// <param name="employeeId">employeeId</param> /// <param name="companyId">companyId</param> /// <returns>New ID</returns> public int GetNewRefId(int employeeId, int companyId) { int newRefId = 0; if (Table.Rows.Count == 0) { EmployeeInformationTypeHistoryInformationGateway rr = new EmployeeInformationTypeHistoryInformationGateway(); rr.LoadAllByEmployeeId(employeeId, companyId); foreach (EmployeeInformationTDS.TypeHistoryInformationRow row1 in (EmployeeInformationTDS.TypeHistoryInformationDataTable)rr.Table) { if (newRefId < row1.RefID) { newRefId = row1.RefID; } } } else { foreach (EmployeeInformationTDS.TypeHistoryInformationRow row2 in (EmployeeInformationTDS.TypeHistoryInformationDataTable)Table) { if (newRefId < row2.RefID) { newRefId = row2.RefID; } } } newRefId++; return newRefId; }
// //////////////////////////////////////////////////////////////////////// // PUBLIC METHODS // /// <summary> /// LoadAllByEmployeeId /// </summary> /// <param name="employeeId">employeeId</param> /// <param name="companyId">companyId</param> public void LoadAllByEmployeeId(int employeeId, int companyId) { EmployeeInformationTypeHistoryInformationGateway employeeInformationTypeHistoryInformationGateway = new EmployeeInformationTypeHistoryInformationGateway(Data); employeeInformationTypeHistoryInformationGateway.LoadAllByEmployeeId(employeeId, companyId); }