private void UpdateDatabase()
        {
            try
            {
                SectionGateway sectionGateway = new SectionGateway(sectionTDS);
                sectionGateway.Update();

                sectionTDS.AcceptChanges();
                flatSectionJlinerTDS.AcceptChanges();
                Session["flatSectionJlinerTDS"] = flatSectionJlinerTDS;

                // Update IssueWithLaterals field
                Section section = new Section(sectionTDS);
                section.UpdateIssueWithLaterals();
                sectionGateway.Update2();
                sectionTDS.AcceptChanges();
            }
            catch (Exception ex)
            {
                string url = string.Format("./../../error_page.aspx?error={0}", ex.Message.Replace('\n', ' '));
                Response.Redirect(url);
            }
        }
        /// <summary>
        /// Save to Section and Jliner rows
        /// </summary>
        /// <param name="sectionTDS">sectionTDS</param>
        public void Save(SectionTDS sectionTDS)
        {
            FlatSectionJlinerTDS flatSectionJlinerChanges = (FlatSectionJlinerTDS)Data.GetChanges();
            if (flatSectionJlinerChanges.FlatSectionJliner.Rows.Count > 0)
            {
                SectionGateway sectionGateway = new SectionGateway(sectionTDS);
                LiquiForce.LFSLive.BL.CWP.Section.Section section = new LiquiForce.LFSLive.BL.CWP.Section.Section(sectionTDS);
                JlinerGateway jlinerGateway = new JlinerGateway(sectionTDS);
                Jliner jliner = new Jliner(sectionTDS);
                JlinerCommentGateway jlinerCommentGateway = new JlinerCommentGateway(sectionTDS);
                JlinerComments jlinerComments = new JlinerComments(jlinerCommentGateway.Data);
                JlinerHistoryGateway jlinerHistoryGateway = new JlinerHistoryGateway(sectionTDS);
                JlinerHistory jlinerHistory = new JlinerHistory(jlinerHistoryGateway.Data);

                sectionGateway.ClearBeforeFill = false;
                jlinerGateway.ClearBeforeFill = false;
                jlinerCommentGateway.ClearBeforeFill = false;
                jlinerHistoryGateway.ClearBeforeFill = false;

                foreach (FlatSectionJlinerTDS.FlatSectionJlinerRow flatSectionJlinerRow in (FlatSectionJlinerTDS.FlatSectionJlinerDataTable)flatSectionJlinerChanges.FlatSectionJliner)
                {
                    // Load section and jliner
                    // ... Load section
                    try
                    {
                        //... Search section row
                        sectionGateway.GetRow(flatSectionJlinerRow.ID);
                    }
                    catch
                    {
                        //... Load section and section's jliners
                        sectionGateway.LoadById(flatSectionJlinerRow.ID, flatSectionJlinerRow.COMPANY_ID);
                        jlinerGateway.LoadByIdCompanyId(flatSectionJlinerRow.ID, flatSectionJlinerRow.COMPANY_ID);
                        jlinerCommentGateway.LoadById(flatSectionJlinerRow.ID, flatSectionJlinerRow.COMPANY_ID);
                        jlinerHistoryGateway.LoadById(flatSectionJlinerRow.ID, flatSectionJlinerRow.COMPANY_ID);
                    }

                    // Update

                    // ... Update jliner
                    string address = ""; if (!flatSectionJlinerRow.IsNull("Address")) address = flatSectionJlinerRow.Address;
                    DateTime? pipeLocated = null; if (!flatSectionJlinerRow.IsNull("PipeLocated")) pipeLocated = flatSectionJlinerRow.PipeLocated;
                    DateTime? servicesLocated = null; if (!flatSectionJlinerRow.IsNull("ServicesLocated")) servicesLocated = flatSectionJlinerRow.ServicesLocated;
                    DateTime? coInstalled = null; if (!flatSectionJlinerRow.IsNull("CoInstalled")) coInstalled = flatSectionJlinerRow.CoInstalled;
                    DateTime? backfilledConcrete = null; if (!flatSectionJlinerRow.IsNull("BackfilledConcrete")) backfilledConcrete = flatSectionJlinerRow.BackfilledConcrete;
                    DateTime? backfilledSoil = null; if (!flatSectionJlinerRow.IsNull("BackfilledSoil")) backfilledSoil = flatSectionJlinerRow.BackfilledSoil;
                    DateTime? grouted = null; if (!flatSectionJlinerRow.IsNull("Grouted")) grouted = flatSectionJlinerRow.Grouted;
                    DateTime? cored = null; if (!flatSectionJlinerRow.IsNull("Cored")) cored = flatSectionJlinerRow.Cored;
                    DateTime? prepped = null; if (!flatSectionJlinerRow.IsNull("Prepped")) prepped = flatSectionJlinerRow.Prepped;
                    DateTime? measured = null; if (!flatSectionJlinerRow.IsNull("Measured")) measured = flatSectionJlinerRow.Measured;
                    string linerSize = ""; if (!flatSectionJlinerRow.IsNull("LinerSize")) linerSize = flatSectionJlinerRow.LinerSize;
                    DateTime? inProcess = null; if (!flatSectionJlinerRow.IsNull("Inprocess")) inProcess = flatSectionJlinerRow.InProcess;
                    DateTime? inStock = null; if (!flatSectionJlinerRow.IsNull("InStock")) inStock = flatSectionJlinerRow.InStock;
                    DateTime? delivered = null; if (!flatSectionJlinerRow.IsNull("Delivered")) delivered = flatSectionJlinerRow.Delivered;
                    DateTime? preVideo = null; if (!flatSectionJlinerRow.IsNull("PreVideo")) preVideo = flatSectionJlinerRow.PreVideo;
                    DateTime? linerInstalled = null; if (!flatSectionJlinerRow.IsNull("LinerInstalled")) linerInstalled = flatSectionJlinerRow.LinerInstalled;
                    DateTime? finalVideo = null; if (!flatSectionJlinerRow.IsNull("FinalVideo")) finalVideo = flatSectionJlinerRow.FinalVideo;
                    double? distanceFromUSMH = null; if (!flatSectionJlinerRow.IsNull("DistanceFromUSMH")) distanceFromUSMH = flatSectionJlinerRow.DistanceFromUSMH;
                    double? distanceFromDSMH = null; if (!flatSectionJlinerRow.IsNull("DistanceFromDSMH")) distanceFromDSMH = flatSectionJlinerRow.DistanceFromDSMH;
                    string history = ""; if (!flatSectionJlinerRow.IsNull("History")) history = flatSectionJlinerRow.History;
                    string map = "";
                    string issue = flatSectionJlinerRow.Issue;
                    decimal? cost = null; if (!flatSectionJlinerRow.IsNull("Cost")) cost = flatSectionJlinerRow.Cost;
                    bool deleted = flatSectionJlinerRow.Deleted;

                    // ... Delete all comments and history for a jliner
                    if (deleted)
                    {
                        jlinerComments.DeleteAllCommentsForAJliner(flatSectionJlinerRow.ID, flatSectionJlinerRow.RefID, flatSectionJlinerRow.COMPANY_ID);
                        jlinerHistory.DeleteAllHistoryForAJliner(flatSectionJlinerRow.ID, flatSectionJlinerRow.RefID, flatSectionJlinerRow.COMPANY_ID);
                    }

                    DateTime? videoInspection = null; if (!flatSectionJlinerRow.IsNull("VideoInspection")) videoInspection = flatSectionJlinerRow.VideoInspection;
                    bool coRequired = flatSectionJlinerRow.CoRequired;
                    bool pitRequired = flatSectionJlinerRow.PitRequired;
                    string coPitLocation = ""; if (!flatSectionJlinerRow.IsNull("CoPitLocation")) coPitLocation = flatSectionJlinerRow.CoPitLocation;
                    bool postContractDigRequired = flatSectionJlinerRow.PostContractDigRequired;
                    DateTime? coCutDown = null; if (!flatSectionJlinerRow.IsNull("CoCutDown")) coCutDown = flatSectionJlinerRow.CoCutDown;
                    DateTime? finalRestoration = null; if (!flatSectionJlinerRow.IsNull("FinalRestoration")) finalRestoration = flatSectionJlinerRow.FinalRestoration;
                    string clientLateralId = ""; if (!flatSectionJlinerRow.IsNull("ClientLateralID")) clientLateralId = flatSectionJlinerRow.ClientLateralID;
                    string videoLengthToPropertyLine = ""; if (!flatSectionJlinerRow.IsNull("VideoLengthToPropertyLine")) videoLengthToPropertyLine = flatSectionJlinerRow.VideoLengthToPropertyLine;
                    bool liningThruCo = flatSectionJlinerRow.LiningThruCo;
                    string hamiltonInspectionNumber = ""; if (!flatSectionJlinerRow.IsNull("HamiltonInspectionNumber")) hamiltonInspectionNumber = flatSectionJlinerRow.HamiltonInspectionNumber;
                    DateTime? noticeDelivered = null; if (!flatSectionJlinerRow.IsNull("NoticeDelivered")) noticeDelivered = flatSectionJlinerRow.NoticeDelivered;

                    jliner.Update(flatSectionJlinerRow.ID, flatSectionJlinerRow.RefID, flatSectionJlinerRow.COMPANY_ID, flatSectionJlinerRow.DetailID, address, pipeLocated, servicesLocated, coInstalled, backfilledConcrete, backfilledSoil, grouted, cored, prepped, measured, linerSize, inProcess, inStock, delivered, preVideo, linerInstalled, finalVideo, distanceFromUSMH, distanceFromDSMH,map, issue, cost, deleted, videoInspection, coRequired, pitRequired, coPitLocation, postContractDigRequired, coCutDown, finalRestoration, clientLateralId, videoLengthToPropertyLine, liningThruCo, hamiltonInspectionNumber, noticeDelivered);

                    // ... Update section
                    section.UpdateJliners(flatSectionJlinerRow.ID, flatSectionJlinerRow.COMPANY_ID);
                }
            }
        }
        /// <summary>
        /// Save all sections & works to database (direct)
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="companyId">companyId</param>
        public void Save(Guid id, int companyId)
        {
            JlinerAddTDS jlinerAddChanges = (JlinerAddTDS)Data.GetChanges();

            if (jlinerAddChanges.MasterArea.Rows.Count > 0)
            {
                JlinerAddMasterAreaGateway jlinerAddMasterAreaGateway = new JlinerAddMasterAreaGateway(jlinerAddChanges);

                foreach (JlinerAddTDS.MasterAreaRow row in (JlinerAddTDS.MasterAreaDataTable)jlinerAddChanges.MasterArea)
                {
                    // Update laterals
                    if (!row.Deleted)
                    {
                        // original values
                        string originalRecordId = jlinerAddMasterAreaGateway.GetRecordIDOriginal(id, companyId);
                        string originalClientId = jlinerAddMasterAreaGateway.GetClientIDOriginal(id, companyId);
                        int? originalCompaniesId = jlinerAddMasterAreaGateway.GetCOMPANIES_IDOriginal(id, companyId);
                        string originalSubArea = jlinerAddMasterAreaGateway.GetSubAreaOriginal(id, companyId);
                        string originalStreet = jlinerAddMasterAreaGateway.GetStreetOriginal(id, companyId);
                        string originalUsmh = jlinerAddMasterAreaGateway.GetUSMHOriginal(id, companyId);
                        string originalDsmh = jlinerAddMasterAreaGateway.GetDSMHOriginal(id, companyId);
                        string originalSize_ = jlinerAddMasterAreaGateway.GetSize_Original(id, companyId);
                        string originalScaledLength = jlinerAddMasterAreaGateway.GetScaledLengthOriginal(id, companyId);
                        DateTime? originalP1Date = jlinerAddMasterAreaGateway.GetP1DateOriginal(id, companyId);
                        string originalActualLength = jlinerAddMasterAreaGateway.GetActualLengthOriginal(id, companyId);
                        double? originalLiveLats = jlinerAddMasterAreaGateway.GetLiveLatsOriginal(id, companyId);
                        string originalCXIsRemoved = jlinerAddMasterAreaGateway.GetCXIsRemovedOriginal(id, companyId);
                        DateTime? originalM1Date = jlinerAddMasterAreaGateway.GetM1DateOriginal(id, companyId);
                        DateTime? originalM2Date = jlinerAddMasterAreaGateway.GetM2DateOriginal(id, companyId);
                        DateTime? originalInstallDate = jlinerAddMasterAreaGateway.GetInstallDateOriginal(id, companyId);
                        DateTime? originalFinalVideo = jlinerAddMasterAreaGateway.GetFinalVideoOriginal(id, companyId);
                        string originalComments = jlinerAddMasterAreaGateway.GetCommentsOriginal(id, companyId);
                        bool originalIssueIdentified = jlinerAddMasterAreaGateway.GetIssueIdentifiedOriginal(id, companyId);
                        bool originalIssueResolved = jlinerAddMasterAreaGateway.GetIssueResolvedOriginal(id, companyId);
                        bool originalFullLengthLining = jlinerAddMasterAreaGateway.GetFullLengthLiningOriginal(id, companyId);
                        bool originalSubcontractorLining = jlinerAddMasterAreaGateway.GetSubcontractorLiningOriginal(id, companyId);
                        bool originalOutOfScopeInArea = jlinerAddMasterAreaGateway.GetOutOfScopeInAreaOriginal(id, companyId);
                        bool originalIssueGivenToBayCity = jlinerAddMasterAreaGateway.GetIssueGivenToBayCityOriginal(id, companyId);
                        int? originalConfirmedSize = jlinerAddMasterAreaGateway.GetConfirmedSizeOriginal(id, companyId);
                        decimal? originalInstallRate = jlinerAddMasterAreaGateway.GetInstallRateOriginal(id, companyId);
                        DateTime? originalDeadlineDate = jlinerAddMasterAreaGateway.GetDeadlineDateOriginal(id, companyId);
                        DateTime? originalProposedLiningDate = jlinerAddMasterAreaGateway.GetProposedLiningDateOriginal(id, companyId);
                        bool originalSalesIssue = jlinerAddMasterAreaGateway.GetSalesIssueOriginal(id, companyId);
                        bool originalLFSIssue = jlinerAddMasterAreaGateway.GetLFSIssueOriginal(id, companyId);
                        bool originalClientIssue = jlinerAddMasterAreaGateway.GetClientIssueOriginal(id, companyId);
                        bool originalInvestigationIssue = jlinerAddMasterAreaGateway.GetInvestigationIssueOriginal(id, companyId);
                        bool originalPointLining = jlinerAddMasterAreaGateway.GetPointLiningOriginal(id, companyId);
                        bool originalGrouting = jlinerAddMasterAreaGateway.GetGroutingOriginal(id, companyId);
                        bool originalLateralLining = jlinerAddMasterAreaGateway.GetLateralLiningOriginal(id, companyId);
                        DateTime? originalVacExDate = jlinerAddMasterAreaGateway.GetVacExDateOriginal(id, companyId);
                        DateTime? originalPusherDate = jlinerAddMasterAreaGateway.GetPusherDateOriginal(id, companyId);
                        DateTime? originalLinerOrdered = jlinerAddMasterAreaGateway.GetLinerOrderedOriginal(id, companyId);
                        DateTime? originalRestoration = jlinerAddMasterAreaGateway.GetRestorationOriginal(id, companyId);
                        DateTime? originalGroutDate = jlinerAddMasterAreaGateway.GetGroutDateOriginal(id, companyId);
                        bool originalJLiner = jlinerAddMasterAreaGateway.GetJLinerOriginal(id, companyId);
                        bool originalRehabAssessment = jlinerAddMasterAreaGateway.GetRehabAssessmentOriginal(id, companyId);
                        int? originalEstimatedJoints = jlinerAddMasterAreaGateway.GetEstimatedJointsOriginal(id, companyId);
                        int? originalJointsTestSealed = jlinerAddMasterAreaGateway.GetJointsTestSealedOriginal(id, companyId);
                        DateTime? originalPreFlushDate = jlinerAddMasterAreaGateway.GetPreFlushDateOriginal(id, companyId);
                        DateTime? originalPreVideoDate = jlinerAddMasterAreaGateway.GetPreVideoDateOriginal(id, companyId);
                        string originalUSMHMN = jlinerAddMasterAreaGateway.GetUSMHOriginal(id, companyId);
                        string originalDSMHMN = jlinerAddMasterAreaGateway.GetDSMHOriginal(id, companyId);
                        string originalUSMHDepth = jlinerAddMasterAreaGateway.GetUSMHDepthOriginal(id, companyId);
                        string originalDSMHDepth = jlinerAddMasterAreaGateway.GetDSMHDepthOriginal(id, companyId);
                        string originalMeasurementsTakenBy = jlinerAddMasterAreaGateway.GetMeasurementsTakenByOriginal(id, companyId);
                        string originalSteelTapeThruPipe = jlinerAddMasterAreaGateway.GetSteelTapeThruPipeOriginal(id, companyId);
                        double? originalUSMHAtMouth1200 = jlinerAddMasterAreaGateway.GetUSMHAtMouth1200Original(id, companyId);
                        double? originalUSMHAtMouth100 = jlinerAddMasterAreaGateway.GetUSMHAtMouth100Original(id, companyId);
                        double? originalUSMHAtMouth200 = jlinerAddMasterAreaGateway.GetUSMHAtMouth200Original(id, companyId);
                        double? originalUSMHAtMouth300 = jlinerAddMasterAreaGateway.GetUSMHAtMouth300Original(id, companyId);
                        double? originalUSMHAtMouth400 = jlinerAddMasterAreaGateway.GetUSMHAtMouth400Original(id, companyId);
                        double? originalUSMHAtMouth500 = jlinerAddMasterAreaGateway.GetUSMHAtMouth500Original(id, companyId);
                        double? originalDSMHAtMouth1200 = jlinerAddMasterAreaGateway.GetDSMHAtMouth1200Original(id, companyId);
                        double? originalDSMHAtMouth100 = jlinerAddMasterAreaGateway.GetDSMHAtMouth100Original(id, companyId);
                        double? originalDSMHAtMouth200 = jlinerAddMasterAreaGateway.GetDSMHAtMouth200Original(id, companyId);
                        double? originalDSMHAtMouth300 = jlinerAddMasterAreaGateway.GetDSMHAtMouth300Original(id, companyId);
                        double? originalDSMHAtMouth400 = jlinerAddMasterAreaGateway.GetDSMHAtMouth400Original(id, companyId);
                        double? originalDSMHAtMouth500 = jlinerAddMasterAreaGateway.GetDSMHAtMouth500Original(id, companyId);
                        string originalHydrantAddress = jlinerAddMasterAreaGateway.GetHydrantAddressOriginal(id, companyId);
                        string originalDistanceToInversionMH = jlinerAddMasterAreaGateway.GetDistanceToInversionMHOriginal(id, companyId);
                        bool originalRampsRequired = jlinerAddMasterAreaGateway.GetRampsRequiredOriginal(id, companyId);
                        string originalDegreeOfTrafficControl = jlinerAddMasterAreaGateway.GetDegreeOfTrafficControlOriginal(id, companyId);
                        bool originalStandarBypass = jlinerAddMasterAreaGateway.GetStandarBypassOriginal(id, companyId);
                        string originalHydroWireDetails = jlinerAddMasterAreaGateway.GetHydroWireDetailsOriginal(id, companyId);
                        string originalPipeMaterialType = jlinerAddMasterAreaGateway.GetPipeMaterialTypeOriginal(id, companyId);
                        int? originalCappedLaterals = jlinerAddMasterAreaGateway.GetCappedLateralsOriginal(id, companyId);
                        bool originalRoboticPrepRequired = jlinerAddMasterAreaGateway.GetRoboticPrepRequiredOriginal(id, companyId);
                        bool originalPipeSizeChange = jlinerAddMasterAreaGateway.GetPipeSizeChangeOriginal(id, companyId);
                        string originalM1Comments = jlinerAddMasterAreaGateway.GetM1CommentsOriginal(id, companyId);
                        string originalVideoDoneFrom = jlinerAddMasterAreaGateway.GetVideoDoneFromOriginal(id, companyId);
                        string originalToManhole = jlinerAddMasterAreaGateway.GetToManholeOriginal(id, companyId);
                        string originalCutterDescriptionDuringMeasuring = jlinerAddMasterAreaGateway.GetCutterDescriptionDuringMeasuringOriginal(id, companyId);
                        bool originalFullLengthPointLiner = jlinerAddMasterAreaGateway.GetFullLengthPointLinerOriginal(id, companyId);
                        bool originalBypassRequired = jlinerAddMasterAreaGateway.GetBypassRequiredOriginal(id, companyId);
                        string originalRoboticDistances = jlinerAddMasterAreaGateway.GetRoboticDistancesOriginal(id, companyId);
                        string originalTrafficControlDetails = jlinerAddMasterAreaGateway.GetTrafficControlDetailsOriginal(id, companyId);
                        string originalLineWithID = jlinerAddMasterAreaGateway.GetLineWithIDOriginal(id, companyId);
                        bool originalSchoolZone = jlinerAddMasterAreaGateway.GetSchoolZoneOriginal(id, companyId);
                        bool originalRestaurantArea = jlinerAddMasterAreaGateway.GetRestaurantAreaOriginal(id, companyId);
                        bool originalCarwashLaundromat = jlinerAddMasterAreaGateway.GetCarwashLaundromatOriginal(id, companyId);
                        bool originalHydroPulley = jlinerAddMasterAreaGateway.GetHydroPulleyOriginal(id, companyId);
                        bool originalFridgeCart = jlinerAddMasterAreaGateway.GetFridgeCartOriginal(id, companyId);
                        bool originalTwoInchPump = jlinerAddMasterAreaGateway.GetTwoInchPumpOriginal(id, companyId);
                        bool originalSixInchBypass = jlinerAddMasterAreaGateway.GetSixInchBypassOriginal(id, companyId);
                        bool originalScaffolding = jlinerAddMasterAreaGateway.GetScaffoldingOriginal(id, companyId);
                        bool originalWinchExtension = jlinerAddMasterAreaGateway.GetWinchExtensionOriginal(id, companyId);
                        bool originalExtraGenerator = jlinerAddMasterAreaGateway.GetExtraGeneratorOriginal(id, companyId);
                        bool originalGreyCableExtension = jlinerAddMasterAreaGateway.GetGreyCableExtensionOriginal(id, companyId);
                        bool originalEasementMats = jlinerAddMasterAreaGateway.GetEasementMatsOriginal(id, companyId);
                        string originalMeasurementType = jlinerAddMasterAreaGateway.GetMeasurementTypeOriginal(id, companyId);
                        bool originalDropPipe = jlinerAddMasterAreaGateway.GetDropPipeOriginal(id, companyId);
                        string originalDropPipeInvertDepth = jlinerAddMasterAreaGateway.GetDropPipeInvertDepthOriginal(id, companyId);
                        bool originalDeleted = row.Deleted;
                        string originalMeasuredFromManhole = jlinerAddMasterAreaGateway.GetMeasuredFromManholeOriginal(id, companyId);
                        string originalMainLined = jlinerAddMasterAreaGateway.GetMainLinedOriginal(id, companyId);
                        string originalBenchingIssue = jlinerAddMasterAreaGateway.GetBenchingIssueOriginal(id, companyId);
                        bool originalArchived = jlinerAddMasterAreaGateway.GetArchivedOriginal(id, companyId);
                        double? originalScaledLength1 = jlinerAddMasterAreaGateway.GetScaledLength1Original(id, companyId);
                        string originalHistory = jlinerAddMasterAreaGateway.GetHistoryOriginal(id, companyId);
                        int? originalNumLats = jlinerAddMasterAreaGateway.GetNumLatsOriginal(id, companyId);
                        int? originalNotLinedYet = jlinerAddMasterAreaGateway.GetNotLinedYetOriginal(id, companyId);
                        bool originalAllMeasured = jlinerAddMasterAreaGateway.GetAllMeasuredOriginal(id, companyId);
                        string originalCity = jlinerAddMasterAreaGateway.GetCityOriginal(id, companyId);
                        string originalProvState = jlinerAddMasterAreaGateway.GetProvStateOriginal(id, companyId);
                        string originalIssueWithLaterals = jlinerAddMasterAreaGateway.GetIssueWithLateralsOriginal(id, companyId);
                        int? originalNotMeasuredYet = jlinerAddMasterAreaGateway.GetNotMeasuredYetOriginal(id, companyId);
                        int? originalNotDeliveredYet = jlinerAddMasterAreaGateway.GetNotDeliveredYetOriginal(id, companyId);

                        // new values
                        int? newNumLats = jlinerAddMasterAreaGateway.GetNumLats(id,companyId);
                        int? newNotLinedYet = jlinerAddMasterAreaGateway.GetNotLinedYet(id,companyId);
                        bool newAllMeasured = false;
                        if (newNumLats == 0)
                        {
                            newAllMeasured = jlinerAddMasterAreaGateway.GetAllMeasured(id,companyId);
                        }
                        int? newNotMeasuredYet = jlinerAddMasterAreaGateway.GetNotMeasuredYet(id,companyId);
                        int? newNotDeliveredYet = jlinerAddMasterAreaGateway.GetNotDeliveredYet(id,companyId);

                         LiquiForce.LFSLive.BL.CWP.Section.Section section = new LiquiForce.LFSLive.BL.CWP.Section.Section(null);
                         section.UpdateDirect(id, companyId, originalRecordId, originalClientId, originalCompaniesId, originalSubArea, originalStreet, originalUsmh, originalDsmh, originalSize_, originalScaledLength, originalP1Date, originalActualLength, originalLiveLats, originalCXIsRemoved, originalM1Date, originalM2Date, originalInstallDate, originalFinalVideo, originalComments, originalIssueIdentified, originalIssueResolved, originalFullLengthLining, originalSubcontractorLining, originalOutOfScopeInArea, originalIssueGivenToBayCity, originalConfirmedSize, originalInstallRate, originalDeadlineDate, originalProposedLiningDate, originalSalesIssue, originalLFSIssue, originalClientIssue, originalInvestigationIssue, originalPointLining, originalGrouting, originalLateralLining, originalVacExDate, originalPusherDate, originalLinerOrdered, originalRestoration, originalGroutDate, originalJLiner, originalRehabAssessment, originalEstimatedJoints, originalJointsTestSealed, originalPreFlushDate, originalPreVideoDate, originalUSMHMN, originalDSMHMN, originalUSMHDepth, originalDSMHDepth, originalMeasurementsTakenBy, originalSteelTapeThruPipe, originalUSMHAtMouth1200, originalUSMHAtMouth100, originalUSMHAtMouth200, originalUSMHAtMouth300, originalUSMHAtMouth400, originalUSMHAtMouth500, originalDSMHAtMouth1200, originalDSMHAtMouth100, originalDSMHAtMouth200, originalDSMHAtMouth300, originalDSMHAtMouth400, originalDSMHAtMouth500, originalHydrantAddress, originalDistanceToInversionMH, originalRampsRequired, originalDegreeOfTrafficControl, originalStandarBypass, originalHydroWireDetails, originalPipeMaterialType, originalCappedLaterals, originalRoboticPrepRequired, originalPipeSizeChange, originalM1Comments, originalVideoDoneFrom, originalToManhole, originalCutterDescriptionDuringMeasuring, originalFullLengthPointLiner, originalBypassRequired, originalRoboticDistances, originalTrafficControlDetails, originalLineWithID, originalSchoolZone, originalRestaurantArea, originalCarwashLaundromat, originalHydroPulley, originalFridgeCart, originalTwoInchPump, originalSixInchBypass, originalScaffolding, originalWinchExtension, originalExtraGenerator, originalGreyCableExtension, originalEasementMats, originalMeasurementType, originalDropPipe, originalDropPipeInvertDepth, originalDeleted, originalMeasuredFromManhole, originalMainLined, originalBenchingIssue, originalArchived, originalScaledLength1, originalHistory, originalNumLats, originalNotLinedYet, originalAllMeasured, originalCity, originalProvState, originalIssueWithLaterals, originalNotMeasuredYet, originalNotDeliveredYet, id, companyId, originalRecordId, originalClientId, originalCompaniesId, originalSubArea, originalStreet, originalUsmh, originalDsmh, originalSize_, originalScaledLength, originalP1Date, originalActualLength, originalLiveLats, originalCXIsRemoved, originalM1Date, originalM2Date, originalInstallDate, originalFinalVideo, originalComments, originalIssueIdentified, originalIssueResolved, originalFullLengthLining, originalSubcontractorLining, originalOutOfScopeInArea, originalIssueGivenToBayCity, originalConfirmedSize, originalInstallRate, originalDeadlineDate, originalProposedLiningDate, originalSalesIssue, originalLFSIssue, originalClientIssue, originalInvestigationIssue, originalPointLining, originalGrouting, originalLateralLining, originalVacExDate, originalPusherDate, originalLinerOrdered, originalRestoration, originalGroutDate, originalJLiner, originalRehabAssessment, originalEstimatedJoints, originalJointsTestSealed, originalPreFlushDate, originalPreVideoDate, originalUSMHMN, originalDSMHMN, originalUSMHDepth, originalDSMHDepth, originalMeasurementsTakenBy, originalSteelTapeThruPipe, originalUSMHAtMouth1200, originalUSMHAtMouth100, originalUSMHAtMouth200, originalUSMHAtMouth300, originalUSMHAtMouth400, originalUSMHAtMouth500, originalDSMHAtMouth1200, originalDSMHAtMouth100, originalDSMHAtMouth200, originalDSMHAtMouth300, originalDSMHAtMouth400, originalDSMHAtMouth500, originalHydrantAddress, originalDistanceToInversionMH, originalRampsRequired, originalDegreeOfTrafficControl, originalStandarBypass, originalHydroWireDetails, originalPipeMaterialType, originalCappedLaterals, originalRoboticPrepRequired, originalPipeSizeChange, originalM1Comments, originalVideoDoneFrom, originalToManhole, originalCutterDescriptionDuringMeasuring, originalFullLengthPointLiner, originalBypassRequired, originalRoboticDistances, originalTrafficControlDetails, originalLineWithID, originalSchoolZone, originalRestaurantArea, originalCarwashLaundromat, originalHydroPulley, originalFridgeCart, originalTwoInchPump, originalSixInchBypass, originalScaffolding, originalWinchExtension, originalExtraGenerator, originalGreyCableExtension, originalEasementMats, originalMeasurementType, originalDropPipe, originalDropPipeInvertDepth, originalDeleted, originalMeasuredFromManhole, originalMainLined, originalBenchingIssue, originalArchived, originalScaledLength1, originalHistory, newNumLats, newNotLinedYet, newAllMeasured, originalCity, originalProvState, originalIssueWithLaterals, newNotMeasuredYet, newNotDeliveredYet);

                    }
                }
            }
        }