/// <summary>
        /// DeleteAllDirect
        /// </summary>
        /// <param name="employeeId">employeeId</param>
        /// <param name="companyId">companyId</param>
        public void DeleteAllDirect(int employeeId, int companyId)
        {
            // Delete exceptions
            EmployeeCostHistoryExceptions employeeCostHistoryExceptions = new EmployeeCostHistoryExceptions(null);
            employeeCostHistoryExceptions.DeleteAllDirect(employeeId, companyId);

            // Delete costs
            EmployeeCostHistoryGateway employeeCostHistoryGateway = new EmployeeCostHistoryGateway(null);
            employeeCostHistoryGateway.DeleteAll(employeeId, companyId);
        }
        /// <summary>
        /// Save all employee cost exception to database (direct)
        /// </summary>
        /// <param name="companyId">companyId</param>
        public void Save(int companyId, int employeeId)
        {
            EmployeeInformationTDS costExceptionsInformationChanges = (EmployeeInformationTDS)Data.GetChanges();

            if (costExceptionsInformationChanges.CostExceptionsInformation.Rows.Count > 0)
            {
                EmployeeInformationCostExceptionsInformationGateway employeeInformationCostExceptionsInformationGateway = new EmployeeInformationCostExceptionsInformationGateway(costExceptionsInformationChanges);

                foreach (EmployeeInformationTDS.CostExceptionsInformationRow row in (EmployeeInformationTDS.CostExceptionsInformationDataTable)costExceptionsInformationChanges.CostExceptionsInformation)
                {
                    // Insert new costs exceptions
                    if ((!row.Deleted) && (!row.InDatabase))
                    {
                        EmployeeCostHistoryExceptions employeeCostHistoryExceptions = new EmployeeCostHistoryExceptions(null);
                        employeeCostHistoryExceptions.InsertDirect(row.CostID, row.RefID, employeeId, row.Work_, row.UnitOfMeasurement, row.PayRateCad, row.BurdenRateCad, row.TotalCostCad, row.PayRateUsd, row.BurdenRateUsd, row.TotalCostUsd, row.Deleted, row.COMPANY_ID, row.BenefitFactorCad, row.BenefitFactorUsd, row.HealthBenefitUsd);
                    }

                    // Update costs exceptions
                    if ((!row.Deleted) && (row.InDatabase))
                    {
                        int costId = row.CostID;
                        int refId = row.RefID;
                        bool originalDeleted = row.Deleted;
                        int originalCompanyId = companyId;

                        // original values
                        string originalWork = employeeInformationCostExceptionsInformationGateway.GetWork_Original(costId, refId);
                        string originalUnitOfMeasurement = employeeInformationCostExceptionsInformationGateway.GetUnitOfMeasurementOriginal(costId, refId);
                        decimal originalPayRateCad = employeeInformationCostExceptionsInformationGateway.GetPayRateCadOriginal(costId, refId);
                        decimal originalBurdenRateCad = employeeInformationCostExceptionsInformationGateway.GetBurdenRateCadOriginal(costId, refId);
                        decimal originalTotalCostCad = employeeInformationCostExceptionsInformationGateway.GetTotalCostCadOriginal(costId, refId);
                        decimal originalPayRateUsd = employeeInformationCostExceptionsInformationGateway.GetPayRateUsdOriginal(costId, refId);
                        decimal originalBurdenRateUsd = employeeInformationCostExceptionsInformationGateway.GetBurdenRateUsdOriginal(costId, refId);
                        decimal originalTotalCostUsd = employeeInformationCostExceptionsInformationGateway.GetTotalCostUsdOriginal(costId, refId);
                        decimal originalBenefitFactorCad = employeeInformationCostExceptionsInformationGateway.GetBenefitFactorCadOriginal(costId, refId);
                        decimal originalBenefitFactorUsd = employeeInformationCostExceptionsInformationGateway.GetBenefitFactorUsdOriginal(costId, refId);
                        decimal originalHealthBenefitUsd = employeeInformationCostExceptionsInformationGateway.GetHealthBenefitUsdOriginal(costId, employeeId);

                        // new values
                        string newWork = employeeInformationCostExceptionsInformationGateway.GetWork_(costId, refId);
                        string newUnitOfMeasurement = employeeInformationCostExceptionsInformationGateway.GetUnitOfMeasurement(costId, refId);
                        decimal newPayRateCad = employeeInformationCostExceptionsInformationGateway.GetPayRateCad(costId, refId);
                        decimal newBurdenRateCad = employeeInformationCostExceptionsInformationGateway.GetBurdenRateCad(costId, refId);
                        decimal newTotalCostCad = employeeInformationCostExceptionsInformationGateway.GetTotalCostCad(costId, refId);
                        decimal newPayRateUsd = employeeInformationCostExceptionsInformationGateway.GetPayRateUsd(costId, refId);
                        decimal newBurdenRateUsd = employeeInformationCostExceptionsInformationGateway.GetBurdenRateUsd(costId, refId);
                        decimal newTotalCostUsd = employeeInformationCostExceptionsInformationGateway.GetTotalCostUsd(costId, refId);
                        decimal newBenefitFactorCad = employeeInformationCostExceptionsInformationGateway.GetBenefitFactorCad(costId, refId);
                        decimal newBenefitFactorUsd = employeeInformationCostExceptionsInformationGateway.GetBenefitFactorUsd(costId, refId);
                        decimal newHealthBenefitUsd = employeeInformationCostExceptionsInformationGateway.GetHealthBenefitUsd(costId, employeeId);

                        EmployeeCostHistoryExceptions employeeCostHistoryExceptions = new EmployeeCostHistoryExceptions(null);
                        employeeCostHistoryExceptions.UpdateDirect(costId, refId, employeeId, originalWork, originalUnitOfMeasurement, originalPayRateCad, originalBurdenRateCad, originalTotalCostCad, originalPayRateUsd, originalBurdenRateUsd, originalTotalCostUsd, originalDeleted, originalCompanyId, originalBenefitFactorCad, originalBenefitFactorUsd, originalHealthBenefitUsd, costId, refId, employeeId, newWork, newUnitOfMeasurement, newPayRateCad, newBurdenRateCad, newTotalCostCad, newPayRateUsd, newBurdenRateUsd, newTotalCostUsd, originalDeleted, originalCompanyId, newBenefitFactorCad, newBenefitFactorUsd, newHealthBenefitUsd);
                    }

                    // Deleted costs exceptions
                    if ((row.Deleted) && (row.InDatabase))
                    {
                        EmployeeCostHistoryExceptions employeeCostHistoryExceptions = new EmployeeCostHistoryExceptions(null);
                        employeeCostHistoryExceptions.DeleteDirect(row.CostID, row.RefID, row.COMPANY_ID);
                    }
                }
            }
        }