/// <summary>
        /// Save all to database (direct)
        /// </summary>
        /// <param name="companyId">companyId</param>        
        public void Save(int companyId)
        {
            ActualCostsAddTDS hotelChanges = (ActualCostsAddTDS)Data.GetChanges();

            if (hotelChanges != null)
            {
                if (hotelChanges.HotelCosts.Rows.Count > 0)
                {
                    ActualCostsAddHotelCostsGateway actualCostsAddHotelCostsGateway = new ActualCostsAddHotelCostsGateway(hotelChanges);

                    foreach (ActualCostsAddTDS.HotelCostsRow row in (ActualCostsAddTDS.HotelCostsDataTable)hotelChanges.HotelCosts)
                    {
                        // Insert new hotel cost
                        if ((!row.Deleted) && (!row.InDatabase))
                        {
                            int projectId = row.ProjectID;
                            int refId = row.RefID;
                            int hotelId = row.HotelID;

                            decimal rateUsd = 0; if (!row.IsRateUsdNull()) rateUsd = row.RateUsd;
                            string comment = ""; if (!row.IsCommentNull()) comment = row.Comment;

                            ActualCostsHotelCosts actualCostsHotelCosts = new ActualCostsHotelCosts(null);
                            actualCostsHotelCosts.InsertDirect(projectId, refId, hotelId, row.Date, row.RateCad, rateUsd, comment, row.Deleted, row.COMPANY_ID);
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Save
        /// </summary>
        /// <param name="companyId">companyId</param>
        public void Save(int companyId)
        {
            ActualCostsInformationTDS hotelCostsInformationChanges = (ActualCostsInformationTDS)Data.GetChanges();

            if (hotelCostsInformationChanges.HotelCostsBasicInformation.Rows.Count > 0)
            {
                ActualCostsInformationHotelCostsBasicInformationGateway actualCostsInformationHotelCostsBasicInformationGateway = new ActualCostsInformationHotelCostsBasicInformationGateway(hotelCostsInformationChanges);

                // Update employee
                foreach (ActualCostsInformationTDS.HotelCostsBasicInformationRow row in (ActualCostsInformationTDS.HotelCostsBasicInformationDataTable)hotelCostsInformationChanges.HotelCostsBasicInformation)
                {
                    // Insert new hours
                    if ((!row.Deleted) && (!row.InDatabase))
                    {
                        string comment = ""; if (!row.IsCommentNull()) comment = row.Comment;
                        ActualCostsHotelCosts actualCostsHotelCosts = new ActualCostsHotelCosts(null);
                        actualCostsHotelCosts.InsertDirect(row.ProjectID, row.RefID, row.HotelID, row.Date, row.RateCad, row.RateUsd, comment, row.Deleted, row.COMPANY_ID);
                    }

                    // Update hours
                    if ((!row.Deleted) && (row.InDatabase))
                    {
                        int projectId = row.ProjectID;
                        int refId = row.RefID;
                        bool originalDeleted = false;
                        int originalCompanyId = companyId;

                        // Original values
                        int originalHotelId = actualCostsInformationHotelCostsBasicInformationGateway.GetHotelIDOriginal(projectId, refId);
                        DateTime originalDate = actualCostsInformationHotelCostsBasicInformationGateway.GetDateOriginal(projectId, refId);
                        decimal originalRateCad = actualCostsInformationHotelCostsBasicInformationGateway.GetRateCadOriginal(projectId, refId);
                        decimal originalRateUsd = actualCostsInformationHotelCostsBasicInformationGateway.GetRateUsdOriginal(projectId, refId);
                        string originalComment = actualCostsInformationHotelCostsBasicInformationGateway.GetCommentOriginal(projectId, refId);

                        // New values
                        int newHotelId = actualCostsInformationHotelCostsBasicInformationGateway.GetHotelID(projectId, refId);
                        DateTime newDate = actualCostsInformationHotelCostsBasicInformationGateway.GetDate(projectId, refId);
                        decimal newRateCad = actualCostsInformationHotelCostsBasicInformationGateway.GetRateCad(projectId, refId);
                        decimal newRateUsd = actualCostsInformationHotelCostsBasicInformationGateway.GetRateUsd(projectId, refId);
                        string newComment = actualCostsInformationHotelCostsBasicInformationGateway.GetComment(projectId, refId);

                        ActualCostsHotelCosts actualCostsHotelCosts = new ActualCostsHotelCosts(null);
                        actualCostsHotelCosts.UpdateDirect(projectId, refId, originalHotelId, originalDate, originalRateCad, originalRateUsd, originalComment, originalDeleted, originalCompanyId, projectId, refId, newHotelId, newDate, newRateCad, newRateUsd, newComment, originalDeleted, originalCompanyId);
                    }

                    // Delete hours
                    if ((row.Deleted) && (row.InDatabase))
                    {
                        ActualCostsHotelCosts actualCostsHotelCosts = new ActualCostsHotelCosts(null);
                        actualCostsHotelCosts.DeleteDirect(row.ProjectID, row.RefID, row.COMPANY_ID);
                    }
                }
            }
        }