/// <summary>
        /// Update
        /// </summary>
        /// <param name="teamProjectTimeId">teamProjectTimeId</param>
        /// <param name="teamProjectTimeIdForReplace">teamProjectTimeIdForReplace</param>
        /// <param name="teamProjectTime2TDSToSave">teamProjectTime2TDSToSave</param>
        public void Update(int teamProjectTimeId, int teamProjectTimeIdForReplace, TeamProjectTime2TDS teamProjectTime2TDSToSave)
        {
            // Update existing row
            TeamProjectTime2TDS.LFS_TEAM_PROJECT_TIMERow masterRow = GetRow(teamProjectTimeId);

            int companiesId = masterRow.CompaniesID;
            int projectId = masterRow.ProjectID;
            DateTime date_ = masterRow.Date_;
            DateTime? startTime = null; if (!masterRow.IsNull("StartTime")) startTime = masterRow.StartTime;
            DateTime? endTime = null; if (!masterRow.IsNull("EndTime")) endTime = masterRow.EndTime;
            double? offset = null; if (!masterRow.IsNull("Offset")) offset = masterRow.Offset;
            string workingDetails = ""; if (!masterRow.IsNull("WorkingDetails")) workingDetails = masterRow.WorkingDetails;
            string location = ""; if (!masterRow.IsNull("Location")) location = masterRow.Location;
            Int64? mealsCountry = null; if (!masterRow.IsNull("MealsCountry")) mealsCountry = masterRow.MealsCountry;
            String mealsAllowanceType = ""; if (!masterRow.IsNull("MealsAllowanceType")) mealsAllowanceType = masterRow.MealsAllowanceType;
            decimal mealsAllowance = masterRow.MealsAllowance;
            int? unitId = null; if (!masterRow.IsNull("UnitID")) unitId = masterRow.UnitID;
            int? towedUnitId = null; if (!masterRow.IsNull("TowedUnitID")) towedUnitId = masterRow.TowedUnitID;
            string comments = ""; if (!masterRow.IsNull("Comments")) comments = masterRow.Comments;
            string type = "Template";
            string state = "Done";
            int loginId = masterRow.LoginID;
            bool deleted = false;
            string work_ = masterRow.Work_;
            string function_ = masterRow.Function_;
            bool fairWage = masterRow.FairWage;

            // ... Load existing row
            TeamProjectTime2Gateway teamProjectTime2Gateway = new TeamProjectTime2Gateway(teamProjectTime2TDSToSave);
            teamProjectTime2Gateway.LoadByTeamProjectTimeId(teamProjectTimeIdForReplace);

            // ... Replace existing row
            TeamProjectTime2 teamProjectTime2ToSave = new TeamProjectTime2(teamProjectTime2TDSToSave);
            teamProjectTime2ToSave.Update(teamProjectTimeIdForReplace, teamProjectTime2Gateway.GetTemplateName(teamProjectTimeIdForReplace), companiesId, projectId, date_, startTime, endTime, offset, workingDetails, location, mealsCountry, mealsAllowanceType, mealsAllowance, unitId, towedUnitId, comments, type, state, loginId, deleted, work_, function_, fairWage);

            // Update or delete detail rows
            TeamProjectTime2Detail teamProjectTime2Detail = new TeamProjectTime2Detail(Data);
            teamProjectTime2Detail.Update(teamProjectTimeId, teamProjectTimeIdForReplace, teamProjectTime2TDSToSave);
        }