/// <summary>
        /// Save all Bondings Costing Sheet
        /// </summary>
        /// <param name="companyId">companyId</param>
        /// <param name="costingSheetId">costingSheetId</param>
        public void Save(int companyId, int costingSheetId)
        {
            ProjectCostingSheetAddTDS changes = (ProjectCostingSheetAddTDS)Data.GetChanges();

            if (changes.BondingsInformation.Rows.Count > 0)
            {
                foreach (ProjectCostingSheetAddTDS.BondingsInformationRow row in (ProjectCostingSheetAddTDS.BondingsInformationDataTable)changes.BondingsInformation)
                {
                    // Insert new costing sheet Bondings
                    if ((!row.Deleted) && (!row.InDatabase))
                    {
                        ProjectCostingSheetBondings projectCostingSheetBondings = new ProjectCostingSheetBondings(null);
                        projectCostingSheetBondings.InsertDirect(costingSheetId, row.BondingCompanyID, row.RefID, row.Rate, row.Deleted, row.COMPANY_ID, row.StartDate, row.EndDate, row.Comment);
                    }
                }
            }
        }
        /// <summary>
        /// Save all Bondings Costing Sheets
        /// </summary>
        /// <param name="companyId">companyId</param>
        /// <param name="costingSheetId">costingSheetId</param>
        public void Save(int companyId, int costingSheetId)
        {
            ProjectCostingSheetInformationTDS bondingsInformationChanges = (ProjectCostingSheetInformationTDS)Data.GetChanges();

            if (bondingsInformationChanges.BondingsInformation.Rows.Count > 0)
            {
                ProjectCostingSheetInformationBondingsInformationGateway projectCostingSheetInformationBondingsInformationGateway = new ProjectCostingSheetInformationBondingsInformationGateway(bondingsInformationChanges);

                foreach (ProjectCostingSheetInformationTDS.BondingsInformationRow row in (ProjectCostingSheetInformationTDS.BondingsInformationDataTable)bondingsInformationChanges.BondingsInformation)
                {
                    // Insert new costing sheet Bondings
                    if ((!row.Deleted) && (!row.InDatabase))
                    {
                        ProjectCostingSheetBondings bondings = new ProjectCostingSheetBondings(null);
                        bondings.InsertDirect(costingSheetId, row.BondingCompanyID, row.RefID, row.Rate, row.Deleted, row.COMPANY_ID, row.StartDate, row.EndDate, row.Comment);
                    }

                    // Update costing sheet Bondings
                    if ((!row.Deleted) && (row.InDatabase))
                    {
                        int bondingCompanyId = row.BondingCompanyID;
                        int refId = row.RefID;
                        bool deleted = false;

                        //original values
                        decimal originalRate = projectCostingSheetInformationBondingsInformationGateway.GetRateOriginal(costingSheetId, bondingCompanyId, refId);
                        DateTime originalStartDate = projectCostingSheetInformationBondingsInformationGateway.GetStartDateOriginal(costingSheetId, bondingCompanyId, refId);
                        DateTime originalEndDate = projectCostingSheetInformationBondingsInformationGateway.GetEndDateOriginal(costingSheetId, bondingCompanyId, refId);

                        //original values
                        decimal newRate = projectCostingSheetInformationBondingsInformationGateway.GetRate(costingSheetId, bondingCompanyId, refId);
                        DateTime newStartDate = projectCostingSheetInformationBondingsInformationGateway.GetStartDate(costingSheetId, bondingCompanyId, refId);
                        DateTime newEndDate = projectCostingSheetInformationBondingsInformationGateway.GetEndDate(costingSheetId, bondingCompanyId, refId);

                        ProjectCostingSheetBondings bondings = new ProjectCostingSheetBondings(null);
                        //bondings.UpdateDirect(costingSheetId, bondingCompanyId, refId, originalRate, deleted, companyId, originalStartDate, originalEndDate, newRate, deleted, companyId, newStartDate, newEndDate);
                    }

                    // Delete costing sheet Bondings
                    if ((row.Deleted) && (row.InDatabase))
                    {
                        /*ProjectCostingSheetBondings bondings = new ProjectCostingSheetBondings(null);
                        bondings.DeleteDirect(row.CostingSheetID, row.BondingCompanyID, row.RefID, row.COMPANY_ID);*/
                    }
                }
            }
        }