/// <summary>
        /// SaveFll
        /// </summary>
        /// <param name="workId">workId</param>
        /// <param name="assetIdLateral">assetIdLateral</param>
        /// <param name="companyId">companyId</param>
        /// <param name="opened">opened</param>
        /// <param name="brushed">brushed</param>
        public void SaveFll(int workId, int assetIdLateral, int companyId, DateTime? opened, DateTime? brushed)
        {
            // ... ... Modifications at M1
            WorkFullLengthLiningM1LateralGateway workFullLengthLiningM1LateralGateway = new WorkFullLengthLiningM1LateralGateway();
            workFullLengthLiningM1LateralGateway.LoadByWorkIdLateral(workId, assetIdLateral, companyId);

            if (workFullLengthLiningM1LateralGateway.Table.Rows.Count > 0)
            {
                // ... .... ... Load original data
                string originalVideoDistance = workFullLengthLiningM1LateralGateway.GetVideoDistance(workId, assetIdLateral);
                string originalClockPosition = workFullLengthLiningM1LateralGateway.GetClockPosition(workId, assetIdLateral);
                string originalDistanceToCentre = workFullLengthLiningM1LateralGateway.GetDistanceToCentre(workId, assetIdLateral);
                string originalTimeOpened = workFullLengthLiningM1LateralGateway.GetTimeOpened(workId, assetIdLateral);
                string originalReverseSetup = workFullLengthLiningM1LateralGateway.GetReverseSetup(workId, assetIdLateral);
                DateTime? originalReinstate = workFullLengthLiningM1LateralGateway.GetReinstate(workId, assetIdLateral);
                string originalComments = workFullLengthLiningM1LateralGateway.GetComments(workId, assetIdLateral);
                bool originalDeleted = workFullLengthLiningM1LateralGateway.GetDeleted(workId, assetIdLateral);
                int originalCompanyId = workFullLengthLiningM1LateralGateway.GetCompanyId(workId, assetIdLateral);
                string originalClientInspectionNo = workFullLengthLiningM1LateralGateway.GetClientInspectionNo(workId, assetIdLateral);
                DateTime? originalV1Inspection = workFullLengthLiningM1LateralGateway.GetV1Inspection(workId, assetIdLateral);
                bool originalRequiresRoboticPrep = workFullLengthLiningM1LateralGateway.GetRequiresRoboticPrep(workId, assetIdLateral);
                DateTime? originalRequiresRoboticPrepDate = workFullLengthLiningM1LateralGateway.GetRequiresRoboticPrepDate(workId, assetIdLateral);
                bool originalHoldClientIssue = workFullLengthLiningM1LateralGateway.GetHoldClientIssue(workId, assetIdLateral);
                bool originalHoldLFSIssue = workFullLengthLiningM1LateralGateway.GetHoldLFSIssue(workId, assetIdLateral);
                bool originalLinelateral = workFullLengthLiningM1LateralGateway.GetLineLateral(workId, assetIdLateral);
                bool originalDyeTestReq = workFullLengthLiningM1LateralGateway.GetDyeTestReq(workId, assetIdLateral);
                DateTime? originalDyeTestComplete = null; if (workFullLengthLiningM1LateralGateway.GetDyeTestComplete(workId, assetIdLateral).HasValue) originalDyeTestComplete = workFullLengthLiningM1LateralGateway.GetDyeTestComplete(workId, assetIdLateral);
                string originalContractYear = workFullLengthLiningM1LateralGateway.GetContractYear(workId, assetIdLateral);

                // New data
                string newTimeOpened = ""; if (opened.HasValue) newTimeOpened = opened.Value.ToString();
                DateTime? newReinstate = null; if (brushed.HasValue) newReinstate = brushed;

                // Update work
                WorkFullLengthLiningM1Lateral workFullLengthLiningM1Lateral = new WorkFullLengthLiningM1Lateral(null);
                workFullLengthLiningM1Lateral.UpdateDirect(workId, assetIdLateral, originalVideoDistance, originalClockPosition, originalDistanceToCentre, originalTimeOpened, originalReverseSetup, originalReinstate, originalComments, originalDeleted, originalCompanyId, originalClientInspectionNo, originalV1Inspection, originalRequiresRoboticPrep, originalRequiresRoboticPrepDate, originalHoldClientIssue, originalHoldLFSIssue, originalLinelateral, originalDyeTestReq, originalDyeTestComplete, originalContractYear, workId, assetIdLateral, originalVideoDistance, originalClockPosition, originalDistanceToCentre, newTimeOpened, originalReverseSetup, newReinstate, originalComments, originalDeleted, originalCompanyId, originalClientInspectionNo, originalV1Inspection, originalRequiresRoboticPrep, originalRequiresRoboticPrepDate, originalHoldClientIssue, originalHoldLFSIssue, originalLinelateral, originalDyeTestReq, originalDyeTestComplete, originalContractYear);
            }
        }
예제 #2
0
        /// <summary>
        /// UpdateFLLaterals
        /// </summary>
        /// <param name="currentProjectId">currentProjectId</param>
        /// <param name="lateral_assetId">lateral_assetId</param>
        /// <param name="companyId">companyId</param>
        /// <param name="v1Inspection">v1Inspection</param>
        /// <param name="clientInspectionNo">clientInspectionNo</param>
        /// <param name="section_">section_</param>
        /// <param name="requiresRoboticPrep">requiresRoboticPrep</param>
        /// <param name="requiresRoboticPrepCompleted">requiresRoboticPrepCompleted</param>
        /// <param name="holdClientIssue">holdClientIssue</param>
        /// <param name="holdLFSIssue">holdLFSIssue</param>
        /// <param name="dyeTestReq">dyeTestReq</param>
        /// <param name="dyeTestComplete">dyeTestComplete</param>
        private void UpdateFLLaterals(int currentProjectId, int lateral_assetId, int companyId, DateTime? v1Inspection, string clientInspectionNo, int section_, bool requiresRoboticPrep, DateTime? requiresRoboticPrepCompleted, bool holdClientIssue, bool holdLFSIssue, bool dyeTestReq, DateTime? dyeTestComplete, string contractYear)
        {
            // Load work id
            WorkGateway workGateway = new WorkGateway();
            workGateway.LoadByProjectIdAssetIdWorkType(currentProjectId, section_, "Full Length Lining", companyId);
            if (workGateway.Table.Rows.Count > 0)
            {
                // ... ... Get WorkId for Full Length Lining
                int workIdFll = workGateway.GetWorkId(section_, "Full Length Lining", currentProjectId);

                // ... ... Modifications at M1
                WorkFullLengthLiningM1LateralGateway workFullLengthLiningM1LateralGateway = new WorkFullLengthLiningM1LateralGateway();
                workFullLengthLiningM1LateralGateway.LoadByWorkIdLateral(workIdFll, lateral_assetId, companyId);
                if (workFullLengthLiningM1LateralGateway.Table.Rows.Count > 0)
                {
                    // ... .... ... Load original data
                    string originalVideoDistance = workFullLengthLiningM1LateralGateway.GetVideoDistance(workIdFll, lateral_assetId);
                    string originalClockPosition = workFullLengthLiningM1LateralGateway.GetClockPosition(workIdFll, lateral_assetId);
                    string originalDistanceToCentre = workFullLengthLiningM1LateralGateway.GetDistanceToCentre(workIdFll, lateral_assetId);
                    string originalTimeOpened = workFullLengthLiningM1LateralGateway.GetTimeOpened(workIdFll, lateral_assetId);
                    string originalReverseSetup = workFullLengthLiningM1LateralGateway.GetReverseSetup(workIdFll, lateral_assetId);
                    DateTime? originalReinstate = workFullLengthLiningM1LateralGateway.GetReinstate(workIdFll, lateral_assetId);
                    string originalComments = workFullLengthLiningM1LateralGateway.GetComments(workIdFll, lateral_assetId);
                    bool originalDeleted = workFullLengthLiningM1LateralGateway.GetDeleted(workIdFll, lateral_assetId);
                    int originalCompanyId = workFullLengthLiningM1LateralGateway.GetCompanyId(workIdFll, lateral_assetId);
                    string originalClientInspectionNo = workFullLengthLiningM1LateralGateway.GetClientInspectionNo(workIdFll, lateral_assetId);
                    DateTime? originalV1Inspection = workFullLengthLiningM1LateralGateway.GetV1Inspection(workIdFll, lateral_assetId);
                    bool originalRequiresRoboticPrep = workFullLengthLiningM1LateralGateway.GetRequiresRoboticPrep(workIdFll, lateral_assetId);
                    DateTime? originalRequiresRoboticPrepDate = workFullLengthLiningM1LateralGateway.GetRequiresRoboticPrepDate(workIdFll, lateral_assetId);
                    bool originalHoldClientIssue = workFullLengthLiningM1LateralGateway.GetHoldClientIssue(workIdFll, lateral_assetId);
                    bool originalHoldLFSIssue = workFullLengthLiningM1LateralGateway.GetHoldLFSIssue(workIdFll, lateral_assetId);
                    bool originalLinelateral = workFullLengthLiningM1LateralGateway.GetLineLateral(workIdFll, lateral_assetId);
                    bool originalDyeTestReq = workFullLengthLiningM1LateralGateway.GetDyeTestReq(workIdFll, lateral_assetId);
                    DateTime? originalDyeTestComplete = null; if (workFullLengthLiningM1LateralGateway.GetDyeTestComplete(workIdFll, lateral_assetId).HasValue) originalDyeTestComplete = workFullLengthLiningM1LateralGateway.GetDyeTestComplete(workIdFll, lateral_assetId);
                    string originalContractYear = workFullLengthLiningM1LateralGateway.GetContractYear(workIdFll, lateral_assetId);

                    // New data
                    DateTime? newV1Inspection = v1Inspection;
                    string newClientInspectionNo = clientInspectionNo;
                    bool newRequiresRoboticPrep = requiresRoboticPrep;
                    bool newHoldClientIssue = holdClientIssue;
                    bool newHoldLFSIssue = holdLFSIssue;
                    DateTime? newRequiresRoboticPrepCompleted = null; if (requiresRoboticPrepCompleted.HasValue) newRequiresRoboticPrepCompleted = requiresRoboticPrepCompleted;
                    bool newDyeTestReq = dyeTestReq;
                    DateTime? newDyeTestComplete = null; if (dyeTestComplete.HasValue) newDyeTestComplete = dyeTestComplete;
                    string newContractYear = contractYear;

                    // Update work
                    WorkFullLengthLiningM1Lateral workFullLengthLiningM1Lateral = new WorkFullLengthLiningM1Lateral(null);
                    workFullLengthLiningM1Lateral.UpdateDirect(workIdFll, lateral_assetId, originalVideoDistance, originalClockPosition, originalDistanceToCentre, originalTimeOpened, originalReverseSetup, originalReinstate, originalComments, originalDeleted, originalCompanyId, originalClientInspectionNo, originalV1Inspection, originalRequiresRoboticPrep, originalRequiresRoboticPrepDate, originalHoldClientIssue, originalHoldLFSIssue, originalLinelateral, originalDyeTestReq, originalDyeTestComplete, originalContractYear, workIdFll, lateral_assetId, originalVideoDistance, originalClockPosition, originalDistanceToCentre, originalTimeOpened, originalReverseSetup, originalReinstate, originalComments, originalDeleted, originalCompanyId, newClientInspectionNo, newV1Inspection, newRequiresRoboticPrep, newRequiresRoboticPrepCompleted, newHoldClientIssue, newHoldLFSIssue, originalLinelateral, newDyeTestReq, newDyeTestComplete, newContractYear);
                }
            }
        }