/// <summary> /// ProcessDataForProject /// </summary> /// <param name="companyId">companyId</param> /// <para>Process de data from the original table for the Project Costing report </para> private void ProcessDataForProject(int companyId) { ArrayList al = new ArrayList(); ArrayList alDays = new ArrayList(); double rateAcum = 0; int linersAcum = 0; double totalHrsAcum = 0; foreach (PrintManhoursPerPhaseTDS.PrintManHoursPerPhasePLPrepRow row1 in (PrintManhoursPerPhaseTDS.PrintManHoursPerPhasePLPrepDataTable)Table) { if (row1.Phase.Contains("Prep")) { int workIdFll = GetWorkId(row1.ProjectID, row1.AssetID, "Full Length Lining", companyId); FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, row1.AssetID, companyId); if (fullLengthLiningWorkDetailsGateway.Table.Rows.Count > 0) { string totalFt = fullLengthLiningWorkDetailsGateway.GetVideoLength(workIdFll); if (totalFt != "") { Distance distOriginal = new Distance(totalFt); row1.TotalFtDouble = distOriginal.ToDoubleInEng3(); row1.RealFt = distOriginal.ToDoubleInEng3(); } else { row1.TotalFtDouble = 0; row1.RealFt = 0; } } else { row1.TotalFtDouble = 0; row1.RealFt = 0; } } if (!alDays.Contains(row1.Date)) { alDays.Add(row1.Date); totalHrsAcum = totalHrsAcum + row1.Hrs; } } foreach (PrintManhoursPerPhaseTDS.PrintManHoursPerPhasePLPrepRow row2 in (PrintManhoursPerPhaseTDS.PrintManHoursPerPhasePLPrepDataTable)Table) { if (row2.Phase.Contains("Prep")) { rateAcum = rateAcum + row2.RealFt / row2.Hrs; } else { if (row2.Phase.Contains("Install")) { linersAcum = linersAcum + row2.LinersInstalled; rateAcum = rateAcum + (row2.Hrs / row2.LinersInstalled); //row2.TotalHrs = totalHrsAcum; } else { linersAcum = linersAcum + row2.LinersReinstated; rateAcum = rateAcum + (row2.Hrs / row2.LinersReinstated); //row2.TotalHrs = totalHrsAcum; } } row2.NumPeriods = alDays.Count; } foreach (PrintManhoursPerPhaseTDS.PrintManHoursPerPhasePLPrepRow row3 in (PrintManhoursPerPhaseTDS.PrintManHoursPerPhasePLPrepDataTable)Table) { if (row3.Phase.Contains("Prep")) { row3.AverageRate = rateAcum / alDays.Count; } else { row3.AverageRate = totalHrsAcum / linersAcum; } } }
protected void Page_PreRender(object sender, EventArgs e) { // Set active toolbar mForm8 master = (mForm8)this.Master; master.ActiveToolbar = "eSewers"; // For error message hdfErrorFieldList.Value = ""; if ((tbxWetOutDataHoistHeight.Text == "OK")|| (tbxWetOutDataHoistHeight.Text == "")) { lblWetOutDataWarning.Visible = false; } else { lblWetOutDataWarning.Visible = true; } // For Video Done From MH and Measured From MH int companyId = Int32.Parse(hdfCompanyId.Value); int assetId = Int32.Parse(hdfAssetId.Value); int workId = Int32.Parse(hdfWorkId.Value); int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString()); // set visible VideoDoneFromMh and Measured From and To FullLengthLiningWorkDetailsGateway flWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); flWorkDetailsGateway.LoadByWorkIdAssetId(workId, assetId, companyId); FullLengthLiningLateralDetails flLateralDetails = new FullLengthLiningLateralDetails(); flLateralDetails.LoadForEdit(workId, assetId, companyId, currentProjectId); if (Int32.Parse(tbxLaterals.Text) > 0) { ddlM1DataVideoDoneFromMh.Visible = false; tbxM1DataVideoDoneFromMh.Visible = true; tbxM1DataVideoDoneFromMh.Text = ddlM1DataVideoDoneFromMh.SelectedValue; ddlM1DataVideoDoneToMh.Visible = false; tbxM1DataVideoDoneToMh.Visible = true; tbxM1DataVideoDoneToMh.Text = ddlM1DataVideoDoneToMh.SelectedValue; ddlM1DataMeasuredFromMh.Visible = false; tbxM1DataMeasuredFromMh.Visible = true; tbxM1DataMeasuredFromMh.Text = ddlM1DataMeasuredFromMh.SelectedValue; btnClear.Visible = false; } else { ddlM1DataVideoDoneFromMh.Visible = true; tbxM1DataVideoDoneFromMh.Visible = false; ddlM1DataVideoDoneToMh.Visible = true; tbxM1DataVideoDoneToMh.Visible = false; ddlM1DataMeasuredFromMh.Visible = true; tbxM1DataMeasuredFromMh.Visible = false; btnClear.Visible = true; } // For materials (m1) MaterialInformationGateway materialInformationGateway = new MaterialInformationGateway(); materialInformationGateway.LoadLastMaterialByAssetId(assetId, companyId); if (materialInformationGateway.Table.Rows.Count > 0) { ddlM1DataMaterial.SelectedValue = materialInformationGateway.GetLastMaterialType(assetId); } // For PreFlush Date and PreVideo Date int projectId = Int32.Parse(hdfCurrentProjectId.Value); FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workId, assetId, companyId); int? raProjectId = fullLengthLiningWorkDetailsGateway.GetRaProjectId(workId); if ((raProjectId.HasValue) && (raProjectId == projectId)) { // ... if ra data is from the same project tkrdpGeneralPreFlushDate.Visible = true; tkrdpGeneralPreVideoDate.Visible = true; tkrdpGeneralPreFlushDateReadOnly.Visible = false; tkrdpGeneralPreVideoDateReadOnly.Visible = false; } else { tkrdpGeneralPreFlushDate.Visible = false; tkrdpGeneralPreVideoDate.Visible = false; tkrdpGeneralPreFlushDateReadOnly.Visible = true; tkrdpGeneralPreVideoDateReadOnly.Visible = true; } // ... if there is no data if (tkrdpGeneralPreFlushDate.SelectedDate.HasValue) { tkrdpGeneralPreFlushDate.Calendar.Enabled = false; tkrdpGeneralPreFlushDate.DateInput.ReadOnly = true; } else { tkrdpGeneralPreFlushDate.Calendar.Enabled = true; tkrdpGeneralPreFlushDate.DateInput.ReadOnly = false; } if (tkrdpGeneralPreVideoDate.SelectedDate.HasValue) { tkrdpGeneralPreVideoDate.Calendar.Enabled = false; tkrdpGeneralPreVideoDate.DateInput.ReadOnly = true; } else { tkrdpGeneralPreVideoDate.Calendar.Enabled = true; tkrdpGeneralPreVideoDate.DateInput.ReadOnly = false; } // Hide or show the Old CWP ID field if (tbxOldCwpId.Text == "") { lblOldCwpId.Visible = false; tbxOldCwpId.Visible = false; } if (tbxFlowSectionId.Text == "") { LoadFullLengthLiningData(currentProjectId, assetId, companyId); } // Validate tools if (Convert.ToBoolean(Session["sgLFS_CWP_FULLLENGTHLINING_ADMIN"])) { tkrpbLeftMenuTools.Items[0].Items[1].Visible = true; // Resins option tkrpbLeftMenuTools.Items[0].Items[2].Visible = true; // Catalyst option tkrdpInstallDataInstallDate.Enabled = true; tkrdpInstallDataFinalVideoDate.Enabled = true; } else { tkrpbLeftMenuTools.Items[0].Items[1].Visible = false; // Resins option tkrpbLeftMenuTools.Items[0].Items[2].Visible = false; // Catalyst option tkrdpInstallDataInstallDate.Enabled = false; tkrdpInstallDataFinalVideoDate.Enabled = false; } }
// //////////////////////////////////////////////////////////////////////// // PUBLIC METHODS // /// <summary> /// LoadByWorkId /// </summary> /// <param name="workId">workId</param> /// <param name="assetId">assetId</param> /// <param name="companyId">companyId</param> public void LoadByWorkIdAssetId(int workId, int assetId, int companyId) { FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(Data); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workId, assetId, companyId); }
// //////////////////////////////////////////////////////////////////////// // PRIVATE METHODS // /// <summary> /// UpdateForReport /// </summary> /// <param name="unitType">unitType</param> private void UpdateForReport(string unitType) { FlReinstateLateralReportGateway flReinstateLateralReportGateway = new FlReinstateLateralReportGateway(Data); flReinstateLateralReportGateway.ClearBeforeFill = false; FlReinstateLateralReport flReinstateLateralReport = new FlReinstateLateralReport(Data); foreach (FlReinstateReportTDS.ReinstateSectionRow row in (FlReinstateReportTDS.ReinstateSectionDataTable)Table) { int workId = row.WorkID; FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workId, row.AssetID, row.COMPANY_ID); string measurementFromMH = "USMH"; if (fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId) != "") measurementFromMH = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId); Distance d; if (unitType == "Metric") { if (!row.IsSize_Null()) { d = new Distance(row.Size_); row.Size_ = d.ToStringInMet1(); } if (!row.IsLengthNull()) { d = new Distance(row.Length); row.Length = d.ToStringInMet1(); } } if (unitType == "Imperial") { if (!row.IsSize_Null()) { if (Distance.IsValidDistance(row.Size_)) { Distance distance = new Distance(row.Size_); switch (distance.DistanceType) { case 2: row.Size_ = distance.ToStringInEng1(); break; case 3: if (Convert.ToDouble(row.Size_) > 99) { double newSize_ = 0; newSize_ = Convert.ToDouble(row.Size_) * 0.03937; row.Size_ = Convert.ToString(Math.Ceiling(newSize_)) + "\""; } else { row.Size_ = row.Size_ + "\""; } break; case 4: row.Size_ = distance.ToStringInEng1(); break; case 5: row.Size_ = distance.ToStringInEng1(); break; } } } if (!row.IsLengthNull()) { d = new Distance(row.Length); row.Length = d.ToStringInEng2(); } } flReinstateLateralReportGateway.LoadByAssetId(row.AssetID, row.COMPANY_ID); flReinstateLateralReport.UpdateForReport(row.FlowOrderID, unitType, measurementFromMH); } }
/// <summary> /// Save a Previous FL work /// </summary> /// <param name="projectId">projectId</param> /// <param name="section_assetId">section_assetId</param> /// <param name="companyId">companyId</param> private void SavePreviousFLWork(int projectId, int section_assetId, int companyId) { // Load Previous work - Full Length Lining data (last sections work) string workType = "Full Length Lining"; WorkFullLengthLiningGateway workFullLengthLiningGateway = new WorkFullLengthLiningGateway(); workFullLengthLiningGateway.LoadTop1ByProjectIdAssetIdWorkType(projectId, section_assetId, workType, companyId); int workId = workFullLengthLiningGateway.GetWorkIdTop1(); string clientId = ""; if (workFullLengthLiningGateway.GetClientId(workId) != "") clientId = workFullLengthLiningGateway.GetClientId(workId); DateTime? proposedLiningDate = null; if (workFullLengthLiningGateway.GetProposedLiningDate(workId).HasValue) proposedLiningDate = workFullLengthLiningGateway.GetProposedLiningDate(workId); DateTime? deadlineLiningDate = null; if (workFullLengthLiningGateway.GetDeadlineLiningDate(workId).HasValue) deadlineLiningDate = workFullLengthLiningGateway.GetDeadlineLiningDate(workId); DateTime? p1Date = null; if (workFullLengthLiningGateway.GetP1Date(workId).HasValue) p1Date = workFullLengthLiningGateway.GetP1Date(workId); DateTime? m1Date = null; if (workFullLengthLiningGateway.GetM1Date(workId).HasValue) m1Date = workFullLengthLiningGateway.GetM1Date(workId); DateTime? m2Date = null; if (workFullLengthLiningGateway.GetM2Date(workId).HasValue) m2Date = workFullLengthLiningGateway.GetM2Date(workId); DateTime? installDate = null; if (workFullLengthLiningGateway.GetInstallDate(workId).HasValue) installDate = workFullLengthLiningGateway.GetInstallDate(workId); DateTime? finalVideoDate = null; if (workFullLengthLiningGateway.GetFinalVideoDate(workId).HasValue) finalVideoDate = workFullLengthLiningGateway.GetFinalVideoDate(workId); bool issueIdentified = workFullLengthLiningGateway.GetIssueIdentified(workId); bool issueLfs = workFullLengthLiningGateway.GetIssueLFS(workId); bool issueClient = workFullLengthLiningGateway.GetIssueClient(workId); bool issueSales = workFullLengthLiningGateway.GetIssueSales(workId); bool issueGivenToClient = workFullLengthLiningGateway.GetIssueGivenToClient(workId); bool issueResolved = workFullLengthLiningGateway.GetIssueResolved(workId); bool issueInvestigation = workFullLengthLiningGateway.GetIssueInvestigation(workId); // Load Previous work - Full Length Lining M1 data (last sections work) FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workId, section_assetId, companyId); string measurementTakenBy = ""; if (fullLengthLiningWorkDetailsGateway.GetMeasurementTakenBy(workId) != "") measurementTakenBy = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenBy(workId); string trafficControl = ""; if (fullLengthLiningWorkDetailsGateway.GetTrafficControl(workId) != "") trafficControl = fullLengthLiningWorkDetailsGateway.GetTrafficControl(workId); string siteDetails = ""; if (fullLengthLiningWorkDetailsGateway.GetSiteDetails(workId) != "") siteDetails = fullLengthLiningWorkDetailsGateway.GetSiteDetails(workId); string accessType = ""; if (fullLengthLiningWorkDetailsGateway.GetAccessType(workId) != "") accessType = fullLengthLiningWorkDetailsGateway.GetAccessType(workId); bool pipeSizeChange = fullLengthLiningWorkDetailsGateway.GetPipeSizeChange(workId); bool standardByPass = fullLengthLiningWorkDetailsGateway.GetStandardBypass(workId); string standardByPassComments = ""; if (fullLengthLiningWorkDetailsGateway.GetStandardBypassComments(workId) != "") standardByPassComments = fullLengthLiningWorkDetailsGateway.GetStandardBypassComments(workId); string trafficControlDetails = ""; if (fullLengthLiningWorkDetailsGateway.GetTrafficControlDetails(workId) != "") trafficControlDetails = fullLengthLiningWorkDetailsGateway.GetTrafficControlDetails(workId); string measurementType = ""; if (fullLengthLiningWorkDetailsGateway.GetMeasurementType(workId) != "") measurementType = fullLengthLiningWorkDetailsGateway.GetMeasurementType(workId); string measurementFromMH = ""; if (fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId) != "") measurementFromMH = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId); string videoDoneFromMH = ""; if (fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMh(workId) != "") videoDoneFromMH = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMh(workId); string videoDoneToMH = ""; if (fullLengthLiningWorkDetailsGateway.GetVideoDoneToMh(workId) != "") videoDoneToMH = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMh(workId); // Load Previous work - Full Length Lining M2 data (last sections work) string videoLength = ""; if (fullLengthLiningWorkDetailsGateway.GetVideoLength(workId) != "") videoLength = fullLengthLiningWorkDetailsGateway.GetVideoLength(workId); string measurementTakenBy2 = ""; if (fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2(workId) != "") measurementTakenBy2 = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2(workId); bool dropPipe = fullLengthLiningWorkDetailsGateway.GetDropPipe(workId); string dropPipeInvertDepth = ""; if (fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepth(workId) != "") dropPipeInvertDepth = fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepth(workId); int? cappedLaterals = null; if (fullLengthLiningWorkDetailsGateway.GetCappedLaterals(workId).HasValue) cappedLaterals = fullLengthLiningWorkDetailsGateway.GetCappedLaterals(workId); string lineWithID = ""; if (fullLengthLiningWorkDetailsGateway.GetLineWithId(workId) != "") lineWithID = fullLengthLiningWorkDetailsGateway.GetLineWithId(workId); string hydrantAddress = ""; if (fullLengthLiningWorkDetailsGateway.GetHydrantAddress(workId) != "") hydrantAddress = fullLengthLiningWorkDetailsGateway.GetHydrantAddress(workId); string hydroWireWithin10FtOfInversionMH = ""; if (fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMH(workId) != "") hydroWireWithin10FtOfInversionMH = fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMH(workId); string distanceToInversionMH = ""; if (fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMh(workId) != "") distanceToInversionMH = fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMh(workId); string surfaceGrade = ""; if (fullLengthLiningWorkDetailsGateway.GetSurfaceGrade(workId) != "") surfaceGrade = fullLengthLiningWorkDetailsGateway.GetSurfaceGrade(workId); bool hydroPulley = fullLengthLiningWorkDetailsGateway.GetHydroPulley(workId); bool fridgeCart = fullLengthLiningWorkDetailsGateway.GetFridgeCart(workId); bool twoPump = fullLengthLiningWorkDetailsGateway.GetTwoPump(workId); bool sixBypass = fullLengthLiningWorkDetailsGateway.GetSixBypass(workId); bool scaffolding = fullLengthLiningWorkDetailsGateway.GetScaffolding(workId); bool winchExtention = fullLengthLiningWorkDetailsGateway.GetWinchExtension(workId); bool extraGenerator = fullLengthLiningWorkDetailsGateway.GetExtraGenerator(workId); bool greyCableExtension = fullLengthLiningWorkDetailsGateway.GetGreyCableExtension(workId); bool easementMats = fullLengthLiningWorkDetailsGateway.GetEasementMats(workId); bool rampRequired = fullLengthLiningWorkDetailsGateway.GetRampRequired(workId); bool cameraSkid = fullLengthLiningWorkDetailsGateway.GetCameraSkid(workId); // Load Previous work - Full Length Lining P1 data (last sections work) int? cxisRemoved = null; if (fullLengthLiningWorkDetailsGateway.GetCxisRemoved(workId).HasValue) fullLengthLiningWorkDetailsGateway.GetCxisRemoved(workId); bool roboticPrepCompleted = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompleted(workId); DateTime? roboticPrepCompletedDate = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDate(workId); bool p1Completed = fullLengthLiningWorkDetailsGateway.GetP1Completed(workId); // Load Previous work - General work data WorkGateway workGateway = new WorkGateway(); workGateway.LoadByWorkId(workId, companyId); int? libraryCategoriesId = null; if (workGateway.GetLibraryCategoriesId(workId).HasValue) libraryCategoriesId = workGateway.GetLibraryCategoriesId(workId); string comments = workGateway.GetComments(workId); string history = workGateway.GetHistory(workId); // Save new work WorkFullLengthLining workFullLengthLining = new WorkFullLengthLining(null); int newSectionWorkId = workFullLengthLining.InsertDirectFullWork(projectId, section_assetId, libraryCategoriesId, clientId, proposedLiningDate, deadlineLiningDate, p1Date, m1Date, m2Date, installDate, finalVideoDate, issueIdentified, issueLfs, issueClient, issueSales, issueGivenToClient, issueResolved, false, companyId, issueInvestigation, comments, history, cxisRemoved, roboticPrepCompleted, roboticPrepCompletedDate, measurementTakenBy, trafficControl, siteDetails, pipeSizeChange, standardByPass, standardByPassComments, trafficControlDetails, measurementType, measurementFromMH, videoDoneFromMH, videoDoneToMH, videoLength, measurementTakenBy2, dropPipe, dropPipeInvertDepth, cappedLaterals, lineWithID, hydrantAddress, hydroWireWithin10FtOfInversionMH, distanceToInversionMH, surfaceGrade, hydroPulley, fridgeCart, twoPump, sixBypass, scaffolding, winchExtention, extraGenerator, greyCableExtension, easementMats, rampRequired, cameraSkid, accessType, p1Completed); // Load Previous work - Save fl laterals WorkFullLengthLiningM1LateralGateway workFullLengthLiningM1LateralGateway = new WorkFullLengthLiningM1LateralGateway(); workFullLengthLiningM1LateralGateway.LoadByWorkId(workId, companyId); foreach (WorkTDS.LFS_WORK_FULLLENGTHLINING_M1_LATERALRow lateralRow in (WorkTDS.LFS_WORK_FULLLENGTHLINING_M1_LATERALDataTable)workFullLengthLiningM1LateralGateway.Table) { int lateral = lateralRow.Lateral; string videoDistance = ""; if (!lateralRow.IsVideoDistanceNull()) videoDistance = lateralRow.VideoDistance; string clockPosition = ""; if (!lateralRow.IsClockPositionNull()) clockPosition = lateralRow.ClockPosition; string distanceToCentre = ""; if (!lateralRow.IsDistanceToCentreNull()) distanceToCentre = lateralRow.DistanceToCentre; string timeOpened = ""; if (!lateralRow.IsTimeOpenedNull()) timeOpened = lateralRow.TimeOpened; string reverseSetup = ""; if (!lateralRow.IsReverseSetupNull()) reverseSetup = lateralRow.ReverseSetup; DateTime? reinstate = null; if (!lateralRow.IsReinstateNull()) reinstate = lateralRow.Reinstate; string lateralComments = ""; if (!lateralRow.IsCommentsNull()) lateralComments = lateralRow.Comments; string clientInspectionNo = ""; if (!lateralRow.IsClientInspectionNoNull()) clientInspectionNo = lateralRow.ClientInspectionNo; DateTime? v1Inspection = null; if (!lateralRow.IsV1InspectionNull()) v1Inspection = lateralRow.V1Inspection; bool requiresRoboticPrep = lateralRow.RequiresRoboticPrep; DateTime? requiresRoboticPrepDate = null; if (!lateralRow.IsRequiresRoboticPrepDateNull()) requiresRoboticPrepDate = lateralRow.RequiresRoboticPrepDate; bool holdClientIssue = lateralRow.HoldClientIssue; bool holdLFSIssue = lateralRow.HoldLFSIssue; bool lineLateral = lateralRow.LineLateral; bool dyeTestReq = lateralRow.DyeTestReq; DateTime? dyeTestComplete = null; if (!lateralRow.IsDyeTestCompleteNull()) dyeTestComplete = lateralRow.DyeTestComplete; string contractYear = lateralRow.ContractYear; WorkFullLengthLiningM1Lateral workFullLengthLiningM1Lateral = new WorkFullLengthLiningM1Lateral(); workFullLengthLiningM1Lateral.InsertDirect(newSectionWorkId, lateral, videoDistance, clockPosition, distanceToCentre, timeOpened, reverseSetup, reinstate, lateralComments, false, companyId, clientInspectionNo, v1Inspection, requiresRoboticPrep, requiresRoboticPrepDate, holdClientIssue, holdLFSIssue, lineLateral, dyeTestReq, dyeTestComplete, contractYear); } // Load Previous work - Comments and History SavePreviousComments(workId, workType, companyId, newSectionWorkId); SavePreviousHistory(workId, workType, companyId, newSectionWorkId); }
protected void btnPrintLateralLocationSheet_Click(object sender, EventArgs e) { mForm7 master = (mForm7)this.Master; ScriptManager scriptManager = (ScriptManager)master.FindControl("ScriptManagerMaster7"); if (!scriptManager.IsInAsyncPostBack) { string url = ""; string client = ""; string name = ""; string project = ""; string title = "Full Length Lining Search Results"; // ... for client int currentClientId = Int32.Parse(hdfCurrentClientId.Value.ToString()); int companyId = Int32.Parse(hdfCompanyId.Value); CompaniesGateway companiesGateway = new CompaniesGateway(); companiesGateway.LoadByCompaniesId(currentClientId, companyId); client += "Client: " + companiesGateway.GetName(currentClientId); // ... for project int currentProjectId = Int32.Parse(hdfCurrentProjectId.Value.ToString()); ProjectGateway projectGateway = new ProjectGateway(); projectGateway.LoadByProjectId(currentProjectId); project = projectGateway.GetName(currentProjectId); name = client + " > Project: " + project + " (" + projectGateway.GetProjectNumber(currentProjectId) + ")"; // ... for title view if (hdfBtnOrigin.Value == "Go") { int viewId = Int32.Parse(ddlView.SelectedValue.Trim()); // ... Load name view WorkViewGateway workViewGateway = new WorkViewGateway(); workViewGateway.LoadByViewId(viewId, companyId); title = workViewGateway.GetName(viewId); } // Report call Page.Validate(); if (Page.IsValid) { PostPageChanges(); int assetId = GetAssetId(); if (assetId > 0) { WorkGateway workGateway = new WorkGateway(); workGateway.LoadByProjectIdAssetIdWorkType(Int32.Parse(hdfCurrentProjectId.Value), assetId, "Full Length Lining", Int32.Parse(hdfCompanyId.Value)); int workId = workGateway.GetWorkId(assetId, "Full Length Lining", Int32.Parse(hdfCurrentProjectId.Value)); FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workId, assetId, Int32.Parse(hdfCompanyId.Value)); string measuredFrom = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId); Response.Write("<script language='javascript'> {window.open('./../../CWP/Common/lateral_location_sheet_report.aspx?source_page=lm&project_id=" + hdfCurrentProjectId.Value + "&client_id=" + hdfCurrentClientId.Value + "&work_id=" + workId.ToString() + "&measured_from=" + measuredFrom + "&asset_id=" + assetId.ToString() + "', '_blank', 'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=800, height=680');}</script>"); } else { cvSelection.IsValid = false; } } if (url != "") Response.Redirect(url); } }
/// <summary> /// UpdateDirect /// </summary> /// <param name="countryId">countryId</param> /// <param name="provinceId">provinceId</param> /// <param name="countyId">countyId</param> /// <param name="cityId">cityId</param> /// <param name="projectId">projectId</param> /// <param name="sectionAssetId">sectionAssetId</param> /// <param name="companyId">companyId</param> public void Save(Int64? countryId, Int64? provinceId, Int64? countyId, Int64? cityId, int projectId, int sectionAssetId, int companyId) { PointRepairsTDS pointRepairsChanges = (PointRepairsTDS)Data.GetChanges(); if (pointRepairsChanges.WorkDetails.Rows.Count > 0) { PointRepairsWorkDetailsGateway pointRepairsWorkDetailsGateway = new PointRepairsWorkDetailsGateway(pointRepairsChanges); // Update sections foreach (PointRepairsTDS.WorkDetailsRow workDetailsRow in (PointRepairsTDS.WorkDetailsDataTable)pointRepairsChanges.WorkDetails) { // Unchanged values int workId = workDetailsRow.WorkID; // Original values string originalClientId = pointRepairsWorkDetailsGateway.GetClientIdOriginal(workId); string originalMeasurementTakenBy = pointRepairsWorkDetailsGateway.GetMeasurementTakenByOriginal(workId); DateTime? originalRepairConfirmationDate = pointRepairsWorkDetailsGateway.GetRepairConfirmationDateOriginal(workId); bool originalBypassRequired = pointRepairsWorkDetailsGateway.GetBypassRequiredOriginal(workId); string originalRoboticDistances = pointRepairsWorkDetailsGateway.GetRoboticDistancesOriginal(workId); DateTime? originalProposedLiningDate = pointRepairsWorkDetailsGateway.GetProposedLiningDateOriginal(workId); DateTime? originalDeadlineLiningDate = pointRepairsWorkDetailsGateway.GetDeadlineLiningDateOriginal(workId); DateTime? originalFinalVideoDate = pointRepairsWorkDetailsGateway.GetFinalVideoDateOriginal(workId); int? originalEstimatedJoints = pointRepairsWorkDetailsGateway.GetEstimatedJointsOriginal(workId); int? originalJointsTestSealed = pointRepairsWorkDetailsGateway.GetJointsTestSealedOriginal(workId); bool originalIssueIdentified = pointRepairsWorkDetailsGateway.GetIssueIdentifiedOriginal(workId); bool originalIssueLFS = pointRepairsWorkDetailsGateway.GetIssueLFSOriginal(workId); bool originalIssueClient = pointRepairsWorkDetailsGateway.GetIssueClientOriginal(workId); bool originalIssueSales = pointRepairsWorkDetailsGateway.GetIssueSalesOriginal(workId); bool originalIssueGivenToClient = pointRepairsWorkDetailsGateway.GetIssueGivenToClientOriginal(workId); bool originalIssueResolved = pointRepairsWorkDetailsGateway.GetIssueResolvedOriginal(workId); bool originalIssueInvestigation = pointRepairsWorkDetailsGateway.GetIssueInvestigationOriginal(workId); // New variables string newClientId = pointRepairsWorkDetailsGateway.GetClientId(workId); string newMeasurementTakenBy = pointRepairsWorkDetailsGateway.GetMeasurementTakenBy(workId); DateTime? newRepairConfirmationDate = pointRepairsWorkDetailsGateway.GetRepairConfirmationDate(workId); bool newBypassRequired = pointRepairsWorkDetailsGateway.GetBypassRequired(workId); string newRoboticDistances = pointRepairsWorkDetailsGateway.GetRoboticDistances(workId); DateTime? newProposedLiningDate = pointRepairsWorkDetailsGateway.GetProposedLiningDate(workId); DateTime? newDeadlineLiningDate = pointRepairsWorkDetailsGateway.GetDeadlineLiningDate(workId); DateTime? newFinalVideoDate = pointRepairsWorkDetailsGateway.GetFinalVideoDate(workId); int? newEstimatedJoints = pointRepairsWorkDetailsGateway.GetEstimatedJoints(workId); int? newJointsTestSealed = pointRepairsWorkDetailsGateway.GetJointsTestSealed(workId); bool newIssueIdentified = pointRepairsWorkDetailsGateway.GetIssueIdentified(workId); bool newIssueLFS = pointRepairsWorkDetailsGateway.GetIssueLFS(workId); bool newIssueClient = pointRepairsWorkDetailsGateway.GetIssueClient(workId); bool newIssueSales = pointRepairsWorkDetailsGateway.GetIssueSales(workId); bool newIssueGivenToClient = pointRepairsWorkDetailsGateway.GetIssueGivenToClient(workId); bool newIssueResolved = pointRepairsWorkDetailsGateway.GetIssueResolved(workId); bool newIssueInvestigation = pointRepairsWorkDetailsGateway.GetIssueInvestigation(workId); // ... RA DateTime? originalPreFlushDate = pointRepairsWorkDetailsGateway.GetPreFlushDateOriginal(workId); DateTime? originalPreVideoDate = pointRepairsWorkDetailsGateway.GetPreVideoDateOriginal(workId); // ... FLL P1 DateTime? originalP1Date = pointRepairsWorkDetailsGateway.GetP1DateOriginal(workId); int? originalCxisRemoved = pointRepairsWorkDetailsGateway.GetCxisRemovedOriginal(workId); // ... FLL M1 string originalTrafficControl = pointRepairsWorkDetailsGateway.GetTrafficControlOriginal(workId); string originalMaterial = pointRepairsWorkDetailsGateway.GetMaterialOriginal(workId); // ... FLL M2 string originalVideoLength = pointRepairsWorkDetailsGateway.GetVideoLengthOriginal(workId); // ... P1 DateTime? newP1Date = pointRepairsWorkDetailsGateway.GetP1Date(workId); int? newCxisRemoved = pointRepairsWorkDetailsGateway.GetCxisRemoved(workId); string newTrafficControl = pointRepairsWorkDetailsGateway.GetTrafficControl(workId); string newMaterial = pointRepairsWorkDetailsGateway.GetMaterial(workId); // ... M2 string newVideoLength = pointRepairsWorkDetailsGateway.GetVideoLength(workId); // ... RA DateTime? newPreFlushDate = pointRepairsWorkDetailsGateway.GetPreFlushDate(workId); DateTime? newPreVideoDate = pointRepairsWorkDetailsGateway.GetPreVideoDate(workId); // ... FLL WorkID int workIdFll = 0; if (!workDetailsRow.IsWorkIDFLLNull()) workIdFll = workDetailsRow.WorkIDFLL; int workIdRa = 0; if (!workDetailsRow.IsWorkIDRANull()) workIdRa = workDetailsRow.WorkIDRA; if (workIdFll != 0) // ... Has Fll work { FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, sectionAssetId, companyId); // Original values string originalClientIdFLL = fullLengthLiningWorkDetailsGateway.GetClientIdOriginal(workIdFll); DateTime? originalProposedLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetProposedLiningDateOriginal(workIdFll); DateTime? originalDeadlineLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetDeadlineLiningDateOriginal(workIdFll); DateTime? originalM1Date = fullLengthLiningWorkDetailsGateway.GetM1DateOriginal(workIdFll); DateTime? originalM2Date = fullLengthLiningWorkDetailsGateway.GetM2DateOriginal(workIdFll); DateTime? originalInstallDate = fullLengthLiningWorkDetailsGateway.GetInstallDateOriginal(workIdFll); DateTime? originalFinalVideoDateFLL = fullLengthLiningWorkDetailsGateway.GetFinalVideoDateOriginal(workIdFll); bool originalIssueIdentifiedFLL = fullLengthLiningWorkDetailsGateway.GetIssueIdentifiedOriginal(workIdFll); bool originalIssueLFSFLL = fullLengthLiningWorkDetailsGateway.GetIssueLFSOriginal(workIdFll); bool originalIssueClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueClientOriginal(workIdFll); bool originalIssueSalesFLL = fullLengthLiningWorkDetailsGateway.GetIssueSalesOriginal(workIdFll); bool originalIssueGivenToClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueGivenToClientOriginal(workIdFll); bool originalIssueResolvedFLL = fullLengthLiningWorkDetailsGateway.GetIssueResolvedOriginal(workIdFll); bool originalIssueInvestigationFLL = fullLengthLiningWorkDetailsGateway.GetIssueInvestigationOriginal(workIdFll); bool originalRoboticPrepCompleted = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedOriginal(workIdFll); DateTime? originalRoboticPrepCompletedDate = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDateOriginal(workIdFll); bool originalP1Completed = fullLengthLiningWorkDetailsGateway.GetP1CompletedOriginal(workIdFll); // M1 data string originalMeasurementTakenByFLL = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByOriginal(workIdFll); string originalSiteDetails = fullLengthLiningWorkDetailsGateway.GetSiteDetailsOriginal(workIdFll); bool originalPipeSizeChange = fullLengthLiningWorkDetailsGateway.GetPipeSizeChangeOriginal(workIdFll); bool originalStandardBypass = fullLengthLiningWorkDetailsGateway.GetStandardBypassOriginal(workIdFll); string originalStandardBypassComments = fullLengthLiningWorkDetailsGateway.GetStandardBypassCommentsOriginal(workIdFll); string originalTrafficControlDetails = fullLengthLiningWorkDetailsGateway.GetTrafficControlDetailsOriginal(workIdFll); string originalMeasurementType = fullLengthLiningWorkDetailsGateway.GetMeasurementTypeOriginal(workIdFll); string originalMeasurementFromMh = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMhOriginal(workIdFll); string originalVideoDoneFromMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMhOriginal(workIdFll); string originalVideoDoneToMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMhOriginal(workIdFll); string originalAccessType = fullLengthLiningWorkDetailsGateway.GetAccessTypeOriginal(workIdFll); // M2 data string originalMeasurementTakenByM2 = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2Original(workIdFll); bool originalDropPipe = fullLengthLiningWorkDetailsGateway.GetDropPipeOriginal(workIdFll); string originalDropPipeInvertDepth = fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepthOriginal(workIdFll); int? originalCappedLaterals = fullLengthLiningWorkDetailsGateway.GetCappedLateralsOriginal(workIdFll); string originalLineWithId = fullLengthLiningWorkDetailsGateway.GetLineWithIdOriginal(workIdFll); string originalHydrantAddress = fullLengthLiningWorkDetailsGateway.GetHydrantAddressOriginal(workIdFll); string originalHydroWireWithin10FtOfInversionMH = fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMHOriginal(workIdFll); string originalDistanceToInversionMh = fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMhOriginal(workIdFll); string originalSurfaceGrade = fullLengthLiningWorkDetailsGateway.GetSurfaceGradeOriginal(workIdFll); bool originalHydroPulley = fullLengthLiningWorkDetailsGateway.GetHydroPulleyOriginal(workIdFll); bool originalFridgeCart = fullLengthLiningWorkDetailsGateway.GetFridgeCartOriginal(workIdFll); bool originalTwoPump = fullLengthLiningWorkDetailsGateway.GetTwoPumpOriginal(workIdFll); bool originalSixBypass = fullLengthLiningWorkDetailsGateway.GetSixBypassOriginal(workIdFll); bool originalScaffolding = fullLengthLiningWorkDetailsGateway.GetScaffoldingOriginal(workIdFll); bool originalWinchExtension = fullLengthLiningWorkDetailsGateway.GetWinchExtensionOriginal(workIdFll); bool originalExtraGenerator = fullLengthLiningWorkDetailsGateway.GetExtraGeneratorOriginal(workIdFll); bool originalGreyCableExtension = fullLengthLiningWorkDetailsGateway.GetGreyCableExtensionOriginal(workIdFll); bool originalEasementMats = fullLengthLiningWorkDetailsGateway.GetEasementMatsOriginal(workIdFll); bool originalRampRequired = fullLengthLiningWorkDetailsGateway.GetRampRequiredOriginal(workIdFll); bool originalCameraSkid = fullLengthLiningWorkDetailsGateway.GetCameraSkidOriginal(workIdFll); // Comments string originalComments = fullLengthLiningWorkDetailsGateway.GetCommentsOriginal(workIdFll); // New variables string newClientIdFLL = fullLengthLiningWorkDetailsGateway.GetClientId(workIdFll); DateTime? newProposedLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetProposedLiningDate(workIdFll); DateTime? newDeadlineLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetDeadlineLiningDate(workIdFll); DateTime? newM1Date = fullLengthLiningWorkDetailsGateway.GetM1Date(workIdFll); DateTime? newM2Date = fullLengthLiningWorkDetailsGateway.GetM2Date(workIdFll); DateTime? newInstallDate = fullLengthLiningWorkDetailsGateway.GetInstallDate(workIdFll); DateTime? newFinalVideoDateFLL = fullLengthLiningWorkDetailsGateway.GetFinalVideoDate(workIdFll); bool newIssueIdentifiedFLL = fullLengthLiningWorkDetailsGateway.GetIssueIdentified(workIdFll); bool newIssueLFSFLL = fullLengthLiningWorkDetailsGateway.GetIssueLFS(workIdFll); bool newIssueClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueClient(workIdFll); bool newIssueSalesFLL = fullLengthLiningWorkDetailsGateway.GetIssueSales(workIdFll); bool newIssueGivenToClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueGivenToClient(workIdFll); bool newIssueResolvedFLL = fullLengthLiningWorkDetailsGateway.GetIssueResolved(workIdFll); bool newIssueInvestigationFLL = fullLengthLiningWorkDetailsGateway.GetIssueInvestigation(workIdFll); bool newRoboticPrepCompleted = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompleted(workIdFll); DateTime? newRoboticPrepCompletedDate = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDate(workIdFll); bool newP1Completed = fullLengthLiningWorkDetailsGateway.GetP1Completed(workIdFll); // M1 string newMeasurementTakenByFLL = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenBy(workIdFll); string newSiteDetails = fullLengthLiningWorkDetailsGateway.GetSiteDetails(workIdFll); bool newPipeSizeChange = fullLengthLiningWorkDetailsGateway.GetPipeSizeChange(workIdFll); bool newStandardBypass = fullLengthLiningWorkDetailsGateway.GetStandardBypass(workIdFll); string newStandardBypassComments = fullLengthLiningWorkDetailsGateway.GetStandardBypassComments(workIdFll); string newTrafficControlDetails = fullLengthLiningWorkDetailsGateway.GetTrafficControlDetails(workIdFll); string newMeasurementType = fullLengthLiningWorkDetailsGateway.GetMeasurementType(workIdFll); string newMeasurementFromMh = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll); string newVideoDoneFromMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMh(workIdFll); string newVideoDoneToMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMh(workIdFll); string newAccessType = fullLengthLiningWorkDetailsGateway.GetAccessType(workIdFll); // M2 string newMeasurementTakenByM2 = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2(workIdFll); bool newDropPipe = fullLengthLiningWorkDetailsGateway.GetDropPipe(workIdFll); string newDropPipeInvertDepth = fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepth(workIdFll); int? newCappedLaterals = fullLengthLiningWorkDetailsGateway.GetCappedLaterals(workIdFll); string newLineWithId = fullLengthLiningWorkDetailsGateway.GetLineWithId(workIdFll); string newHydrantAddress = fullLengthLiningWorkDetailsGateway.GetHydrantAddress(workIdFll); string newHydroWireWithin10FtOfInversionMH = fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMH(workIdFll); string newDistanceToInversionMh = fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMh(workIdFll); string newSurfaceGrade = fullLengthLiningWorkDetailsGateway.GetSurfaceGrade(workIdFll); bool newHydroPulley = fullLengthLiningWorkDetailsGateway.GetHydroPulley(workIdFll); bool newFridgeCart = fullLengthLiningWorkDetailsGateway.GetFridgeCart(workIdFll); bool newTwoPump = fullLengthLiningWorkDetailsGateway.GetTwoPump(workIdFll); bool newSixBypass = fullLengthLiningWorkDetailsGateway.GetSixBypass(workIdFll); bool newScaffolding = fullLengthLiningWorkDetailsGateway.GetScaffolding(workIdFll); bool newWinchExtension = fullLengthLiningWorkDetailsGateway.GetWinchExtension(workIdFll); bool newExtraGenerator = fullLengthLiningWorkDetailsGateway.GetExtraGenerator(workIdFll); bool newGreyCableExtension = fullLengthLiningWorkDetailsGateway.GetGreyCableExtension(workIdFll); bool newEasementMats = fullLengthLiningWorkDetailsGateway.GetEasementMats(workIdFll); bool newRampRequired = fullLengthLiningWorkDetailsGateway.GetRampRequired(workIdFll); bool newCameraSkid = fullLengthLiningWorkDetailsGateway.GetCameraSkid(workIdFll); // comments string newComments = fullLengthLiningWorkDetailsGateway.GetComments(workIdFll); // ... Update work UpdateFllWork(sectionAssetId, countryId, provinceId, countyId, cityId, workIdFll, originalClientIdFLL, originalProposedLiningDateFLL, originalDeadlineLiningDateFLL, originalP1Date, originalM1Date, originalM2Date, originalInstallDate, originalFinalVideoDateFLL, originalIssueIdentifiedFLL, originalIssueLFSFLL, originalIssueClientFLL, originalIssueSalesFLL, originalIssueGivenToClientFLL, originalIssueResolvedFLL, originalIssueInvestigationFLL, originalCxisRemoved, originalRoboticPrepCompleted, originalRoboticPrepCompletedDate, originalMeasurementTakenByFLL, originalTrafficControl, originalSiteDetails, originalPipeSizeChange, originalStandardBypass, originalStandardBypassComments, originalTrafficControlDetails, originalMeasurementType, originalMeasurementFromMh, originalVideoDoneFromMh, originalVideoDoneToMh, originalVideoLength, originalComments, false, companyId, originalMaterial, originalAccessType, originalP1Completed, newClientIdFLL, originalProposedLiningDateFLL, originalDeadlineLiningDateFLL, newP1Date, newM1Date, originalM2Date, originalInstallDate, originalFinalVideoDateFLL, originalIssueIdentifiedFLL, originalIssueLFSFLL, originalIssueClientFLL, originalIssueSalesFLL, originalIssueGivenToClientFLL, originalIssueResolvedFLL, originalIssueInvestigationFLL, newCxisRemoved, newRoboticPrepCompleted, newRoboticPrepCompletedDate, newMeasurementTakenByFLL, newMaterial, newTrafficControl, newSiteDetails, newPipeSizeChange, newStandardBypass, newStandardBypassComments, newTrafficControlDetails, newMeasurementType, newMeasurementFromMh, newVideoDoneFromMh, newVideoDoneToMh, newVideoLength, newComments, false, companyId, newAccessType, newP1Completed); } else { if (newP1Date.HasValue || newCxisRemoved.HasValue || newMaterial != "" || newTrafficControl != "" || newVideoLength != "") // Insert Fll work { WorkFullLengthLining workFullLengthLining = new WorkFullLengthLining(null); workIdFll = workFullLengthLining.InsertDirectEmptyWorks(projectId, sectionAssetId, null, "", null, null, null, null, null, null, null, false, false, false, false, false, false, false, companyId, false, "", ""); FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, sectionAssetId, companyId); // Original values string originalClientIdFLL = fullLengthLiningWorkDetailsGateway.GetClientIdOriginal(workIdFll); DateTime? originalProposedLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetProposedLiningDateOriginal(workIdFll); DateTime? originalDeadlineLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetDeadlineLiningDateOriginal(workIdFll); DateTime? originalM1Date = fullLengthLiningWorkDetailsGateway.GetM1DateOriginal(workIdFll); DateTime? originalM2Date = fullLengthLiningWorkDetailsGateway.GetM2DateOriginal(workIdFll); DateTime? originalInstallDate = fullLengthLiningWorkDetailsGateway.GetInstallDateOriginal(workIdFll); DateTime? originalFinalVideoDateFLL = fullLengthLiningWorkDetailsGateway.GetFinalVideoDateOriginal(workIdFll); bool originalIssueIdentifiedFLL = fullLengthLiningWorkDetailsGateway.GetIssueIdentifiedOriginal(workIdFll); bool originalIssueLFSFLL = fullLengthLiningWorkDetailsGateway.GetIssueLFSOriginal(workIdFll); bool originalIssueClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueClientOriginal(workIdFll); bool originalIssueSalesFLL = fullLengthLiningWorkDetailsGateway.GetIssueSalesOriginal(workIdFll); bool originalIssueGivenToClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueGivenToClientOriginal(workIdFll); bool originalIssueResolvedFLL = fullLengthLiningWorkDetailsGateway.GetIssueResolvedOriginal(workIdFll); bool originalIssueInvestigationFLL = fullLengthLiningWorkDetailsGateway.GetIssueInvestigationOriginal(workIdFll); bool originalRoboticPrepCompleted = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedOriginal(workIdFll); DateTime? originalRoboticPrepCompletedDate = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDateOriginal(workIdFll); bool originalP1Completed = fullLengthLiningWorkDetailsGateway.GetP1CompletedOriginal(workIdFll); // M1 data string originalMeasurementTakenByFLL = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByOriginal(workIdFll); string originalSiteDetails = fullLengthLiningWorkDetailsGateway.GetSiteDetailsOriginal(workIdFll); bool originalPipeSizeChange = fullLengthLiningWorkDetailsGateway.GetPipeSizeChangeOriginal(workIdFll); bool originalStandardBypass = fullLengthLiningWorkDetailsGateway.GetStandardBypassOriginal(workIdFll); string originalStandardBypassComments = fullLengthLiningWorkDetailsGateway.GetStandardBypassCommentsOriginal(workIdFll); string originalTrafficControlDetails = fullLengthLiningWorkDetailsGateway.GetTrafficControlDetailsOriginal(workIdFll); string originalMeasurementType = fullLengthLiningWorkDetailsGateway.GetMeasurementTypeOriginal(workIdFll); string originalMeasurementFromMh = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMhOriginal(workIdFll); string originalVideoDoneFromMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMhOriginal(workIdFll); string originalVideoDoneToMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMhOriginal(workIdFll); string originalAccessType = fullLengthLiningWorkDetailsGateway.GetAccessTypeOriginal(workIdFll); // M2 data string originalMeasurementTakenByM2 = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2Original(workIdFll); bool originalDropPipe = fullLengthLiningWorkDetailsGateway.GetDropPipeOriginal(workIdFll); string originalDropPipeInvertDepth = fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepthOriginal(workIdFll); int? originalCappedLaterals = fullLengthLiningWorkDetailsGateway.GetCappedLateralsOriginal(workIdFll); string originalLineWithId = fullLengthLiningWorkDetailsGateway.GetLineWithIdOriginal(workIdFll); string originalHydrantAddress = fullLengthLiningWorkDetailsGateway.GetHydrantAddressOriginal(workIdFll); string originalHydroWireWithin10FtOfInversionMH = fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMHOriginal(workIdFll); string originalDistanceToInversionMh = fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMhOriginal(workIdFll); string originalSurfaceGrade = fullLengthLiningWorkDetailsGateway.GetSurfaceGradeOriginal(workIdFll); bool originalHydroPulley = fullLengthLiningWorkDetailsGateway.GetHydroPulleyOriginal(workIdFll); bool originalFridgeCart = fullLengthLiningWorkDetailsGateway.GetFridgeCartOriginal(workIdFll); bool originalTwoPump = fullLengthLiningWorkDetailsGateway.GetTwoPumpOriginal(workIdFll); bool originalSixBypass = fullLengthLiningWorkDetailsGateway.GetSixBypassOriginal(workIdFll); bool originalScaffolding = fullLengthLiningWorkDetailsGateway.GetScaffoldingOriginal(workIdFll); bool originalWinchExtension = fullLengthLiningWorkDetailsGateway.GetWinchExtensionOriginal(workIdFll); bool originalExtraGenerator = fullLengthLiningWorkDetailsGateway.GetExtraGeneratorOriginal(workIdFll); bool originalGreyCableExtension = fullLengthLiningWorkDetailsGateway.GetGreyCableExtensionOriginal(workIdFll); bool originalEasementMats = fullLengthLiningWorkDetailsGateway.GetEasementMatsOriginal(workIdFll); bool originalRampRequired = fullLengthLiningWorkDetailsGateway.GetRampRequiredOriginal(workIdFll); bool originalCameraSkid = fullLengthLiningWorkDetailsGateway.GetCameraSkidOriginal(workIdFll); // Comments string originalComments = fullLengthLiningWorkDetailsGateway.GetCommentsOriginal(workIdFll); // New variables string newClientIdFLL = fullLengthLiningWorkDetailsGateway.GetClientId(workIdFll); DateTime? newProposedLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetProposedLiningDate(workIdFll); DateTime? newDeadlineLiningDateFLL = fullLengthLiningWorkDetailsGateway.GetDeadlineLiningDate(workIdFll); DateTime? newM1Date = fullLengthLiningWorkDetailsGateway.GetM1Date(workIdFll); DateTime? newM2Date = fullLengthLiningWorkDetailsGateway.GetM2Date(workIdFll); DateTime? newInstallDate = fullLengthLiningWorkDetailsGateway.GetInstallDate(workIdFll); DateTime? newFinalVideoDateFLL = fullLengthLiningWorkDetailsGateway.GetFinalVideoDate(workIdFll); bool newIssueIdentifiedFLL = fullLengthLiningWorkDetailsGateway.GetIssueIdentified(workIdFll); bool newIssueLFSFLL = fullLengthLiningWorkDetailsGateway.GetIssueLFS(workIdFll); bool newIssueClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueClient(workIdFll); bool newIssueSalesFLL = fullLengthLiningWorkDetailsGateway.GetIssueSales(workIdFll); bool newIssueGivenToClientFLL = fullLengthLiningWorkDetailsGateway.GetIssueGivenToClient(workIdFll); bool newIssueResolvedFLL = fullLengthLiningWorkDetailsGateway.GetIssueResolved(workIdFll); bool newIssueInvestigationFLL = fullLengthLiningWorkDetailsGateway.GetIssueInvestigation(workIdFll); bool newRoboticPrepCompleted = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompleted(workIdFll); DateTime? newRoboticPrepCompletedDate = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDate(workIdFll); bool newP1Completed = fullLengthLiningWorkDetailsGateway.GetP1Completed(workIdFll); // M1 string newMeasurementTakenByFLL = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenBy(workIdFll); string newSiteDetails = fullLengthLiningWorkDetailsGateway.GetSiteDetails(workIdFll); bool newPipeSizeChange = fullLengthLiningWorkDetailsGateway.GetPipeSizeChange(workIdFll); bool newStandardBypass = fullLengthLiningWorkDetailsGateway.GetStandardBypass(workIdFll); string newStandardBypassComments = fullLengthLiningWorkDetailsGateway.GetStandardBypassComments(workIdFll); string newTrafficControlDetails = fullLengthLiningWorkDetailsGateway.GetTrafficControlDetails(workIdFll); string newMeasurementType = fullLengthLiningWorkDetailsGateway.GetMeasurementType(workIdFll); string newMeasurementFromMh = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll); string newVideoDoneFromMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMh(workIdFll); string newVideoDoneToMh = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMh(workIdFll); string newAccessType = fullLengthLiningWorkDetailsGateway.GetAccessType(workIdFll); // M2 string newMeasurementTakenByM2 = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2(workIdFll); bool newDropPipe = fullLengthLiningWorkDetailsGateway.GetDropPipe(workIdFll); string newDropPipeInvertDepth = fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepth(workIdFll); int? newCappedLaterals = fullLengthLiningWorkDetailsGateway.GetCappedLaterals(workIdFll); string newLineWithId = fullLengthLiningWorkDetailsGateway.GetLineWithId(workIdFll); string newHydrantAddress = fullLengthLiningWorkDetailsGateway.GetHydrantAddress(workIdFll); string newHydroWireWithin10FtOfInversionMH = fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMH(workIdFll); string newDistanceToInversionMh = fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMh(workIdFll); string newSurfaceGrade = fullLengthLiningWorkDetailsGateway.GetSurfaceGrade(workIdFll); bool newHydroPulley = fullLengthLiningWorkDetailsGateway.GetHydroPulley(workIdFll); bool newFridgeCart = fullLengthLiningWorkDetailsGateway.GetFridgeCart(workIdFll); bool newTwoPump = fullLengthLiningWorkDetailsGateway.GetTwoPump(workIdFll); bool newSixBypass = fullLengthLiningWorkDetailsGateway.GetSixBypass(workIdFll); bool newScaffolding = fullLengthLiningWorkDetailsGateway.GetScaffolding(workIdFll); bool newWinchExtension = fullLengthLiningWorkDetailsGateway.GetWinchExtension(workIdFll); bool newExtraGenerator = fullLengthLiningWorkDetailsGateway.GetExtraGenerator(workIdFll); bool newGreyCableExtension = fullLengthLiningWorkDetailsGateway.GetGreyCableExtension(workIdFll); bool newEasementMats = fullLengthLiningWorkDetailsGateway.GetEasementMats(workIdFll); bool newRampRequired = fullLengthLiningWorkDetailsGateway.GetRampRequired(workIdFll); bool newCameraSkid = fullLengthLiningWorkDetailsGateway.GetCameraSkid(workIdFll); // comments string newComments = fullLengthLiningWorkDetailsGateway.GetComments(workIdFll); // ... Update work UpdateFllWork(sectionAssetId, countryId, provinceId, countyId, cityId, workIdFll, originalClientIdFLL, originalProposedLiningDateFLL, originalDeadlineLiningDateFLL, originalP1Date, originalM1Date, originalM2Date, originalInstallDate, originalFinalVideoDateFLL, originalIssueIdentifiedFLL, originalIssueLFSFLL, originalIssueClientFLL, originalIssueSalesFLL, originalIssueGivenToClientFLL, originalIssueResolvedFLL, originalIssueInvestigationFLL, originalCxisRemoved, originalRoboticPrepCompleted, originalRoboticPrepCompletedDate, originalMeasurementTakenByFLL, originalTrafficControl, originalSiteDetails, originalPipeSizeChange, originalStandardBypass, originalStandardBypassComments, originalTrafficControlDetails, originalMeasurementType, originalMeasurementFromMh, originalVideoDoneFromMh, originalVideoDoneToMh, originalVideoLength, originalComments, false, companyId, originalMaterial, originalAccessType, originalP1Completed, newClientIdFLL, originalProposedLiningDateFLL, originalDeadlineLiningDateFLL, newP1Date, newM1Date, originalM2Date, originalInstallDate, originalFinalVideoDateFLL, originalIssueIdentifiedFLL, originalIssueLFSFLL, originalIssueClientFLL, originalIssueSalesFLL, originalIssueGivenToClientFLL, originalIssueResolvedFLL, originalIssueInvestigationFLL, newCxisRemoved, newRoboticPrepCompleted, newRoboticPrepCompletedDate, newMeasurementTakenByFLL, newMaterial, newTrafficControl, newSiteDetails, newPipeSizeChange, newStandardBypass, newStandardBypassComments, newTrafficControlDetails, newMeasurementType, newMeasurementFromMh, newVideoDoneFromMh, newVideoDoneToMh, newVideoLength, newComments, false, companyId, newAccessType, newP1Completed); } } if (workIdRa != 0) // ... Has Fll work { UpdateRaWork(workIdRa, originalPreFlushDate, originalPreVideoDate, newPreFlushDate, newPreVideoDate, companyId); } else { if (newPreFlushDate.HasValue || newPreVideoDate.HasValue) // Insert RA work { WorkRehabAssessment workRehabAssessment = new WorkRehabAssessment(null); workIdRa = workRehabAssessment.InsertDirect(projectId, sectionAssetId, null, newPreFlushDate, newPreVideoDate, false, companyId, "", ""); UpdateRaWork(workIdRa, originalPreFlushDate, originalPreVideoDate, newPreFlushDate, newPreVideoDate, companyId); } } // Update work WorkPointRepairs workPointRepairs = new WorkPointRepairs(null); workPointRepairs.UpdateDirect(sectionAssetId, workId, originalClientId, originalMeasurementTakenBy, originalRepairConfirmationDate, originalBypassRequired, originalRoboticDistances, originalProposedLiningDate, originalDeadlineLiningDate, originalFinalVideoDate, originalEstimatedJoints, originalJointsTestSealed, originalIssueIdentified, originalIssueLFS, originalIssueClient, originalIssueSales, originalIssueGivenToClient, originalIssueResolved, originalIssueInvestigation, "", false, companyId, workId, newClientId, newMeasurementTakenBy, newRepairConfirmationDate, newBypassRequired, newRoboticDistances, newProposedLiningDate, newDeadlineLiningDate, newFinalVideoDate, newEstimatedJoints, newJointsTestSealed, newIssueIdentified, newIssueLFS, newIssueClient, newIssueSales, newIssueGivenToClient, newIssueResolved, newIssueInvestigation, "", false, companyId); // Get original variables WorkGateway workGateway = new WorkGateway(); workGateway.LoadByWorkId(workId, companyId); string originalWorkType = workGateway.GetWorkTypeOriginal(workId); int? originalLibraryCategoriesId = workGateway.GetLibraryCategoriesIdOriginal(workId); string originalComment = workGateway.GetCommentsOriginal(workId); string originalHistory = workGateway.GetHistoryOriginal(workId); //Get new comment WorkCommentsGateway workCommentsGateway = new WorkCommentsGateway(); workCommentsGateway.LoadByAssetIdWorkTypeProjectId(sectionAssetId, companyId, "Point Repairs", projectId); WorkComments workComments = new WorkComments(workCommentsGateway.Data); string newComment = workComments.GetCommentsSummary(companyId, workCommentsGateway.Table.Rows.Count, "\n"); Work work = new Work(null); work.UpdateDirect(workId, projectId, sectionAssetId, originalWorkType, originalLibraryCategoriesId, false, companyId, originalComment, originalHistory, workId, projectId, sectionAssetId, originalWorkType, originalLibraryCategoriesId, false, companyId, newComment, originalHistory); } } }
private void workUpdate() { // Get general variables int workId = Int32.Parse(hdfWorkId.Value.Trim()); int assetId = Int32.Parse(hdfAssetId.Value.Trim()); int originalCompanyId = Int32.Parse(hdfCompanyId.Value.Trim()); string workType = hdfWorkType.Value.Trim(); bool originalDeleted = false; // Get original variables FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workId, assetId, originalCompanyId); // ... Verify if work has cipp information if (fullLengthLiningWorkDetailsGateway.Table.Rows.Count > 0) { // Wet Out data original values string originalLinerTube = fullLengthLiningWorkDetailsGateway.GetLinerTubeOriginal(workId); int originalResinId = fullLengthLiningWorkDetailsGateway.GetResinIdOriginal(workId); decimal originalExcessResin = fullLengthLiningWorkDetailsGateway.GetExcessResinOriginal(workId); string originalPoundsDrums = fullLengthLiningWorkDetailsGateway.GetPoundsDrumsOriginal(workId); decimal originalDrumDiameter = fullLengthLiningWorkDetailsGateway.GetDrumDiameterOriginal(workId); decimal originalHoistMaximumHeight = fullLengthLiningWorkDetailsGateway.GetHoistMaximumHeightOriginal(workId); decimal originalHoistMinimumHeight = fullLengthLiningWorkDetailsGateway.GetHoistMinimumHeightOriginal(workId); decimal originalDownDropTubeLenght = fullLengthLiningWorkDetailsGateway.GetDownDropTubeLenghtOriginal(workId); decimal originalPumpHeightAboveGround = fullLengthLiningWorkDetailsGateway.GetPumpHeightAboveGroundOriginal(workId); int originalTubeResinToFeltFactor = fullLengthLiningWorkDetailsGateway.GetTubeResinToFeltFactorOriginal(workId); DateTime originalDateOfSheet = fullLengthLiningWorkDetailsGateway.GetDateOfSheetOriginal(workId); int originalEmployeeId = fullLengthLiningWorkDetailsGateway.GetEmployeeIdOriginal(workId); string originalRunDetails = fullLengthLiningWorkDetailsGateway.GetRunDetailsOriginal(workId); string originalRunDetails2 = fullLengthLiningWorkDetailsGateway.GetRunDetails2Original(workId); DateTime originalWetOutDate = fullLengthLiningWorkDetailsGateway.GetWetOutDateOriginal(workId); DateTime? originalWetOutInstallDate = fullLengthLiningWorkDetailsGateway.GetWetOutInstallDateOriginal(workId); string originalThickness = fullLengthLiningWorkDetailsGateway.GetInversionThicknessOriginal(workId); decimal originalLengthToLine = fullLengthLiningWorkDetailsGateway.GetLengthToLineOriginal(workId); decimal originalPlusExtra = fullLengthLiningWorkDetailsGateway.GetPlusExtraOriginal(workId); decimal originalForTurnOffset = fullLengthLiningWorkDetailsGateway.GetForTurnOffsetOriginal(workId); decimal originalLengthToWetOut = fullLengthLiningWorkDetailsGateway.GetLengthToWetOutOriginal(workId); decimal originalTubeMaxColdHead = fullLengthLiningWorkDetailsGateway.GetTubeMaxColdHeadOriginal(workId); decimal originalTubeMaxColdHeadPsi = fullLengthLiningWorkDetailsGateway.GetTubeMaxColdHeadPsiOriginal(workId); decimal originalTubeMaxHotHead = fullLengthLiningWorkDetailsGateway.GetTubeMaxHotHeadOriginal(workId); decimal originalTubeMaxHotHeadPsi = fullLengthLiningWorkDetailsGateway.GetTubeMaxHotHeadPsiOriginal(workId); decimal originalTubeIdealHead = fullLengthLiningWorkDetailsGateway.GetTubeIdealHeadOriginal(workId); decimal originalTubeIdealHeadPsi = fullLengthLiningWorkDetailsGateway.GetTubeIdealHeadPsiOriginal(workId); decimal originalNetResinForTube = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeOriginal(workId); decimal originalNetResinForTubeUsgals = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeUsgalsOriginal(workId); string originalNetResinForTubeDrumsIns = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeDrumsInsOriginal(workId); decimal originalNetResinForTubeLbsFt = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeLbsFtOriginal(workId); decimal originalNetResinForTubeUsgFt = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeUsgFtOriginal(workId); int originalExtraResinForMix = fullLengthLiningWorkDetailsGateway.GetExtraResinForMixOriginal(workId); decimal originalExtraLbsForMix = fullLengthLiningWorkDetailsGateway.GetExtraLbsForMixOriginal(workId); decimal originalTotalMixQuantity = fullLengthLiningWorkDetailsGateway.GetTotalMixQuantityOriginal(workId); decimal originalTotalMixQuantityUsgals = fullLengthLiningWorkDetailsGateway.GetTotalMixQuantityUsgalsOriginal(workId); string originalTotalMixQuantityDrumsIns = fullLengthLiningWorkDetailsGateway.GetTotalMixQuantityDrumsInsOriginal(workId); string originalInversionType = fullLengthLiningWorkDetailsGateway.GetInversionTypeOriginal(workId); decimal originalDepthOfInversionMH = fullLengthLiningWorkDetailsGateway.GetDepthOfInversionMHOriginal(workId); decimal originalTubeForColumn = fullLengthLiningWorkDetailsGateway.GetTubeForColumnOriginal(workId); decimal originalTubeForStartDry = fullLengthLiningWorkDetailsGateway.GetTubeForStartDryOriginal(workId); decimal originalTotalTube = fullLengthLiningWorkDetailsGateway.GetTotalTubeOriginal(workId); string originalDropTubeConnects = fullLengthLiningWorkDetailsGateway.GetDropTubeConnectsOriginal(workId); decimal originalAllowsHeadTo = fullLengthLiningWorkDetailsGateway.GetAllowsHeadToOriginal(workId); decimal originalRollerGap = fullLengthLiningWorkDetailsGateway.GetRollerGapOriginal(workId); decimal originalHeightNeeded = fullLengthLiningWorkDetailsGateway.GetHeightNeededOriginal(workId); string originalAvailable = fullLengthLiningWorkDetailsGateway.GetAvailableOriginal(workId); string originalHoistHeight = fullLengthLiningWorkDetailsGateway.GetHoistHeightOriginal(workId); string originalCommentsCipp = fullLengthLiningWorkDetailsGateway.GetCommentsCippOriginal(workId); string originalResinsLabel = fullLengthLiningWorkDetailsGateway.GetResinsLabelOriginal(workId); string originalDrumContainsLabel = fullLengthLiningWorkDetailsGateway.GetDrumContainsLabelOriginal(workId); string originalLinerTubeLabel = fullLengthLiningWorkDetailsGateway.GetLinerTubeLabelOriginal(workId); string originalForLbDrumsLabel = fullLengthLiningWorkDetailsGateway.GetForLbDrumsLabelOriginal(workId); string originalNetResinLabel = fullLengthLiningWorkDetailsGateway.GetNetResinLabelOriginal(workId); string originalCatalystLabel = fullLengthLiningWorkDetailsGateway.GetCatalystLabelOriginal(workId); // Wet Out new data // ... Get new comment WorkFullLengthLiningWetOutCommentsGateway workFullLengthLiningWetOutCommentsGateway = new WorkFullLengthLiningWetOutCommentsGateway(); workFullLengthLiningWetOutCommentsGateway.LoadAllByWorkIdWorkType(workId, originalCompanyId, workType); WorkFullLengthLiningWetOutComments workFullLengthLiningWetOutComments = new WorkFullLengthLiningWetOutComments(workFullLengthLiningWetOutCommentsGateway.Data); string newComments = workFullLengthLiningWetOutComments.GetCommentsSummary(originalCompanyId, workFullLengthLiningWetOutCommentsGateway.Table.Rows.Count, "\n"); // Update work with cipp information WorkFullLengthLiningWetOut workFullLengthLiningWetOut = new WorkFullLengthLiningWetOut(null); workFullLengthLiningWetOut.UpdateDirect(workId, originalLinerTube, originalResinId, originalExcessResin, originalPoundsDrums, originalDrumDiameter, originalHoistMaximumHeight, originalHoistMinimumHeight, originalDownDropTubeLenght, originalPumpHeightAboveGround, originalTubeResinToFeltFactor, originalDateOfSheet, originalEmployeeId, originalRunDetails, originalRunDetails2, originalWetOutDate, originalWetOutInstallDate, originalThickness, originalLengthToLine, originalPlusExtra, originalForTurnOffset, originalLengthToWetOut, originalTubeMaxColdHead, originalTubeMaxColdHeadPsi, originalTubeMaxHotHead, originalTubeMaxHotHeadPsi, originalTubeIdealHead, originalTubeIdealHeadPsi, originalNetResinForTube, originalNetResinForTubeUsgals, originalNetResinForTubeDrumsIns, originalNetResinForTubeLbsFt, originalNetResinForTubeUsgFt, originalExtraResinForMix, originalExtraLbsForMix, originalTotalMixQuantity, originalTotalMixQuantityUsgals, originalTotalMixQuantityDrumsIns, originalInversionType, originalDepthOfInversionMH, originalTubeForColumn, originalTubeForStartDry, originalTotalTube, originalDropTubeConnects, originalAllowsHeadTo, originalRollerGap, originalHeightNeeded, originalAvailable, originalHoistHeight, originalCommentsCipp, originalResinsLabel, originalDrumContainsLabel, originalLinerTubeLabel, originalForLbDrumsLabel, originalNetResinLabel, originalCatalystLabel, originalDeleted, originalCompanyId, workId, originalLinerTube, originalResinId, originalExcessResin, originalPoundsDrums, originalDrumDiameter, originalHoistMaximumHeight, originalHoistMinimumHeight, originalDownDropTubeLenght, originalPumpHeightAboveGround, originalTubeResinToFeltFactor, originalDateOfSheet, originalEmployeeId, originalRunDetails, originalRunDetails2, originalWetOutDate, originalWetOutInstallDate, originalThickness, originalLengthToLine, originalPlusExtra, originalForTurnOffset, originalLengthToWetOut, originalTubeMaxColdHead, originalTubeMaxColdHeadPsi, originalTubeMaxHotHead, originalTubeMaxHotHeadPsi, originalTubeIdealHead, originalTubeIdealHeadPsi, originalNetResinForTube, originalNetResinForTubeUsgals, originalNetResinForTubeDrumsIns, originalNetResinForTubeLbsFt, originalNetResinForTubeUsgFt, originalExtraResinForMix, originalExtraLbsForMix, originalTotalMixQuantity, originalTotalMixQuantityUsgals, originalTotalMixQuantityDrumsIns, originalInversionType, originalDepthOfInversionMH, originalTubeForColumn, originalTubeForStartDry, originalTotalTube, originalDropTubeConnects, originalAllowsHeadTo, originalRollerGap, originalHeightNeeded, originalAvailable, originalHoistHeight, newComments, originalResinsLabel, originalDrumContainsLabel, originalLinerTubeLabel, originalForLbDrumsLabel, originalNetResinLabel, originalCatalystLabel, originalDeleted, originalCompanyId); } }
// //////////////////////////////////////////////////////////////////////// // PRIVATE METHODS // /// <summary> /// UpdateFieldsForSections /// </summary> private void UpdateFieldsForSections() { // Distance Validation foreach (JltoBuildReportTDS.JLToBuildRow row in ((JltoBuildReportTDS.JLToBuildDataTable)Table)) { if (!row.IsMainSizeNull()) { if (Distance.IsValidDistance(row.MainSize)) { Distance distance = new Distance(row.MainSize); switch (distance.DistanceType) { case 2: row.MainSize = distance.ToStringInEng1(); break; case 3: if (Convert.ToInt32(row.MainSize) > 99) { double newMainSize = 0; newMainSize = Convert.ToDouble(row.MainSize) * 0.03937; row.MainSize = Convert.ToString(Math.Ceiling(newMainSize)) + "\""; } else { row.MainSize = row.MainSize + "\""; } break; case 4: row.MainSize = distance.ToStringInEng1(); break; case 5: row.MainSize = distance.ToStringInEng1(); break; } } } } foreach (JltoBuildReportTDS.JLToBuildRow row in ((JltoBuildReportTDS.JLToBuildDataTable)Table)) { // Validate RoboticPrepCompleted WorkGateway workGateway = new WorkGateway(); workGateway.LoadByProjectIdAssetIdWorkType(row.ProjectID, row.Section_, "Full Length Lining", row.COMPANY_ID); if (workGateway.Table.Rows.Count > 0) { // ... Get WorkId for Full Length Lining int workIdFll = workGateway.GetWorkId(row.Section_, "Full Length Lining", row.ProjectID); // ... Load if there is robotic prep completed FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, row.AssetID, row.COMPANY_ID); bool roboticPrepCompleted = false; DateTime? roboticPrepCompletedDate = null; roboticPrepCompleted = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompleted(workIdFll); roboticPrepCompletedDate = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDate(workIdFll); if ((roboticPrepCompleted) && (!roboticPrepCompletedDate.HasValue)) { row.Delete(); } } } }
// //////////////////////////////////////////////////////////////////////// // PRIVATE METHODS // /// <summary> /// UpdateForProcess /// </summary> /// <param name="companyId">companyId</param> private void UpdateForReport(int companyId) { WorkJunctionLiningCoPitLocationListGateway workJunctionLiningCoPitLocationListGateway = new WorkJunctionLiningCoPitLocationListGateway(); foreach (JlOverviewReportTDS.JlOverviewRow row in (JlOverviewReportTDS.JlOverviewDataTable)Table) { if (!row.IsCoPitLocationNull()) { row.Abbreviation = workJunctionLiningCoPitLocationListGateway.GetAbbreviation(row.CoPitLocation, companyId); } if (!row.IsCommentsNull()) { row.Comments = row.Comments.Replace("<br>", "\n"); } int workIdFll = GetWorkId(row.ProjectID, row.AssetID, "Full Length Lining", companyId); FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, row.AssetID, companyId); if (fullLengthLiningWorkDetailsGateway.Table.Rows.Count > 0) { string measurementFromMH = "USMH"; if (fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll) != "") measurementFromMH = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll); if (measurementFromMH == "DSMH") { string auxDistanceFromUSMH = row.DistanceFromUSMH; row.DistanceFromUSMH = row.DistanceFromDSMH; row.DistanceFromDSMH = auxDistanceFromUSMH; } } } }
/// <summary> /// LoadByProjectIdJlNavigatorTDS /// </summary> /// <param name="projectId">projectId</param> /// <param name="jlNavigatorTDS">jlNavigatorTDS</param> /// <param name="companyId">companyId</param> public void LoadByProjectIdJlNavigatorTDS(int projectId, JlNavigatorTDS jlNavigatorTDS, int companyId) { ArrayList sections = new ArrayList(); LateralLocationSheetReportGateway lateralLocationSheetReportGateway = new LateralLocationSheetReportGateway(Data); lateralLocationSheetReportGateway.ClearBeforeFill = false; foreach (JlNavigatorTDS.JlNavigatorRow jlNavigatorRow in jlNavigatorTDS.JlNavigator) { if (jlNavigatorRow.Selected) { if (!sections.Contains(jlNavigatorRow.AssetID)) { sections.Add(jlNavigatorRow.AssetID); int assetId = jlNavigatorRow.AssetID; int workIdFll = GetWorkId(projectId, assetId, "Full Length Lining", companyId); string measuredFrom = "USMH"; if (workIdFll > 0) { FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, assetId, companyId); measuredFrom = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll); } // Get Data lateralLocationSheetReportGateway.LoadByAssetId(assetId, companyId); UpdateForReportForJunctionLining(assetId, workIdFll, projectId, measuredFrom, companyId); } } } lateralLocationSheetReportGateway.ClearBeforeFill = true; }
// //////////////////////////////////////////////////////////////////////// // PRIVATE METHODS // /// <summary> /// UpdateFieldsForSections /// </summary> /// <param name="projectId">projectId</param> /// <param name="companyId">companyId</param> private void UpdateFieldsForSections(int projectId, int companyId) { foreach (JlNavigatorTDS.JlNavigatorRow row in (JlNavigatorTDS.JlNavigatorDataTable)Table) { if (row.IsPitRequiredNull()) row.PitRequired = false; if (row.IsCoRequiredNull()) row.CoRequired = false; if (row.IsPostContractDigRequiredNull()) row.PostContractDigRequired = false; if (row.IsLiningThruCoNull()) row.LiningThruCo = false; if (!row.IsFlowOrderIDNull()) { row.LateralID = row.FlowOrderID + "-JL-" + row.LateralID; } else { row.LateralID = "JL-" + row.LateralID; } if (!row.IsMainSizeNull()) { try { if (Distance.IsValidDistance(row.MainSize)) { Distance distance = new Distance(row.MainSize); switch (distance.DistanceType) { case 2: row.MainSize = distance.ToStringInEng1(); break; case 3: if (Convert.ToDouble(row.MainSize) > 99) { double newMainSize = 0; newMainSize = Convert.ToDouble(row.MainSize) * 0.03937; row.MainSize = Convert.ToString(Math.Ceiling(newMainSize)) + "\""; } else { row.MainSize = row.MainSize + "\""; } break; case 4: row.MainSize = distance.ToStringInEng1(); break; case 5: row.MainSize = distance.ToStringInEng1(); break; } } } catch { } } row.Selected = false; int workIdFll = GetWorkId(projectId, row.AssetID, "Full Length Lining", companyId); FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(); fullLengthLiningWorkDetailsGateway.LoadByWorkIdAssetId(workIdFll, row.AssetID, companyId); if (fullLengthLiningWorkDetailsGateway.Table.Rows.Count > 0) { string measurementFromMH = "USMH"; if (fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll) != "") measurementFromMH = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workIdFll); if (measurementFromMH == "DSMH") { string auxDistanceFromUSMH = row.DistanceFromUSMH; row.DistanceFromUSMH = row.DistanceFromDSMH; row.DistanceFromDSMH = auxDistanceFromUSMH; } } } }