/// <summary>
        /// Save the entity
        /// </summary>
        /// <param name="useTransaction">Specify if transactions should be used</param>
        /// <returns></returns>
        public int Save(bool useTransaction)
        {
            try
            {
                //If the coonection is already enlisted in a transaction use parent transaction
                if (IsInTransaction())
                {
                    useTransaction = false;
                }

                if (useTransaction)
                {
                    BeginTransaction();
                }

                int newId = ApplicationConstants.INT_NULL_VALUE;
                OnPreSave();
                if (!ValidateOperation())
                {
                    throw new NotImplementedException(ApplicationMessages.EXCEPTION_IMPLEMENT_SETENTITY);
                }


                if (State == EntityState.Deleted)
                {
                    DeleteChildren();
                    dbEntity.DeleteObject(this);
                }
                if (State == EntityState.New)
                {
                    newId = dbEntity.InsertObject(this);
                    SaveChildren();
                }
                if (State == EntityState.Modified)
                {
                    dbEntity.UpdateObject(this);
                    SaveChildren();
                }
                OnPostSave();

                if (useTransaction)
                {
                    CommitTransaction();
                }

                return(newId);
            }
            catch (Exception exc)
            {
                if (useTransaction)
                {
                    RollbackTransaction();
                }

                throw new IndException(exc);
            }
        }
        public int DeleteCostCenterTest(ICostCenter costCenter, DBGenericEntity dbGenericEntity)
        {
            int rowCount = dbGenericEntity.DeleteObject(costCenter);

            return(rowCount);
        }
        /// <summary>
        /// This method is used for deleting an object from the database
        /// </summary>
        /// <param name="associate">This is the Associate object that holds all information that is required so that the delete should be made.</param>
        /// <param name="dbGenericEntity">This is the Associate Entity.</param>
        /// <returns></returns>
        private int DeleteInitialBudgetTest(IInitialBudget initialBudget, DBGenericEntity dbGenericEntity)
        {
            int rowCount = dbGenericEntity.DeleteObject(initialBudget);

            return(rowCount);
        }
        public int DeleteProjectTest(IProject project, DBGenericEntity dbGenericEntity)
        {
            int rowCount = dbGenericEntity.DeleteObject(project);

            return(rowCount);
        }
        public int DeleteWorkPackageTest(IWorkPackage workPackage, DBGenericEntity dbGenericEntity)
        {
            int rowCount = dbGenericEntity.DeleteObject(workPackage);

            return(rowCount);
        }
        /// <summary>
        /// This method is used for deleting an object from the database
        /// </summary>
        /// <param name="associate">This is the Associate object that holds all information that is required so that the delete should be made.</param>
        /// <param name="dbGenericEntity">This is the Associate Entity.</param>
        /// <returns></returns>
        private int DeleteRevisedBudgetTest(IRevisedBudget revisedBudget, DBGenericEntity dbGenericEntity)
        {
            int rowCount = dbGenericEntity.DeleteObject(revisedBudget);

            return(rowCount);
        }