// ////////////////////////////////////////////////////////////////////////
        // PRIVATE METHODS
        //
        /// <summary>
        /// GetNewRefId
        /// </summary>
        /// <param name="projectId">projectId</param>
        /// <param name="companyId">companyId</param>
        /// <returns>New ID</returns>
        public int GetNewRefId(int projectId, int companyId)
        {
            //SubcontractorHoursAddTDS dataSet = new SubcontractorHoursAddTDS();
            //dataSet.SubcontractorHours.Merge(this.Table, true);
            //SubcontractorHoursAddSubcontractorHours model = new SubcontractorHoursAddSubcontractorHours(dataSet);

            //if (dataSet.SubcontractorHours.Rows.Count <= 0)
            //{
            //    model.LoadAllByProjectId(projectId, companyId);
            //}

            //// Store tables
            //this.Table = (SubcontractorHoursAddTDS.SubcontractorHoursDataTable)model.Table;

            int newRefId = 0;

            if (Table.Rows.Count == 0)
            {
                SubcontractorHoursAddSubcontractorHoursGateway rr = new SubcontractorHoursAddSubcontractorHoursGateway();
                rr.LoadAllByProjectId(projectId, companyId);

                foreach (SubcontractorHoursAddTDS.SubcontractorHoursRow row1 in (SubcontractorHoursAddTDS.SubcontractorHoursDataTable)rr.Table)
                {
                    if (newRefId < row1.RefID)
                    {
                        newRefId = row1.RefID;
                    }
                }
            }
            else
            {
                foreach (SubcontractorHoursAddTDS.SubcontractorHoursRow row2 in (SubcontractorHoursAddTDS.SubcontractorHoursDataTable)Table)
                {
                    if (newRefId < row2.RefID)
                    {
                        newRefId = row2.RefID;
                    }
                }

            }

            newRefId++;

            return newRefId;
        }
 // ////////////////////////////////////////////////////////////////////////
 // PUBLIC METHODS - DATASET
 //
 /// <summary>
 /// LoadAllByProjectId
 /// </summary>
 /// <param name="projectId">projectId</param>
 /// <param name="companyId">companyId</param>
 public void LoadAllByProjectId(int projectId, int companyId)
 {
     SubcontractorHoursAddSubcontractorHoursGateway subcontractorHoursAddSubcontractorHoursGateway = new SubcontractorHoursAddSubcontractorHoursGateway(Data);
     subcontractorHoursAddSubcontractorHoursGateway.LoadAllByProjectId(projectId, companyId);
 }