コード例 #1
0
        private void LoadWorkData(int workId, int assetId)
        {
            FullLengthLiningWorkDetailsGateway fullLengthLiningWorkDetailsGateway = new FullLengthLiningWorkDetailsGateway(fullLengthLiningTDS);

            if (fullLengthLiningWorkDetailsGateway.Table.Rows.Count > 0)
            {
                // For Header
                tbxVideoLength.Text = fullLengthLiningWorkDetailsGateway.GetVideoLength(workId);

                // Load full length lining general data
                tbxGeneralClientId.Text = fullLengthLiningWorkDetailsGateway.GetClientId(workId);
                ckbxGeneralIssueIdentified.Checked = fullLengthLiningWorkDetailsGateway.GetIssueIdentified(workId);
                ckbxGeneralLfsIssue.Checked = fullLengthLiningWorkDetailsGateway.GetIssueLFS(workId);
                ckbxGeneralClientIssue.Checked = fullLengthLiningWorkDetailsGateway.GetIssueClient(workId);
                ckbxGeneralSalesIssue.Checked = fullLengthLiningWorkDetailsGateway.GetIssueSales(workId);
                ckbxGeneralIssueGivenToClient.Checked = fullLengthLiningWorkDetailsGateway.GetIssueGivenToClient(workId);
                ckbxGeneralIssueResolved.Checked = fullLengthLiningWorkDetailsGateway.GetIssueResolved(workId);
                ckbxGeneralIssueInvestigation.Checked = fullLengthLiningWorkDetailsGateway.GetIssueInvestigation(workId);

                // ... Load Dates
                if (fullLengthLiningWorkDetailsGateway.GetProposedLiningDate(workId).HasValue)
                {
                    tkrdpGeneralProposedLiningDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetProposedLiningDate(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetDeadlineLiningDate(workId).HasValue)
                {
                    tkrdpGeneralDeadlineLiningDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetDeadlineLiningDate(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetP1Date(workId).HasValue)
                {
                    tkrdpPrepDataP1Date.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetP1Date(workId);
                    tkrdpGeneralP1Date.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetP1Date(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetM1Date(workId).HasValue)
                {
                    tkrdpM1DataM1Date.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetM1Date(workId);
                    tkrdpGeneralM1Date.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetM1Date(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetM2Date(workId).HasValue)
                {
                    tkrdpGeneralM2Date.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetM2Date(workId);
                    tkrdpM2DataM2Date.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetM2Date(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetInstallDate(workId).HasValue)
                {
                    tkrdpGeneralInstallDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetInstallDate(workId);
                    tkrdpInstallDataInstallDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetInstallDate(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetFinalVideoDate(workId).HasValue)
                {
                    tkrdpGeneralFinalVideo.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetFinalVideoDate(workId);
                    tkrdpInstallDataFinalVideoDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetFinalVideoDate(workId);
                }

                // ... for RA data
                if (fullLengthLiningWorkDetailsGateway.GetPreFlushDate(workId).HasValue)
                {
                    tkrdpGeneralPreFlushDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetPreFlushDate(workId);
                    tkrdpGeneralPreFlushDateReadOnly.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetPreFlushDate(workId);
                }

                if (fullLengthLiningWorkDetailsGateway.GetPreVideoDate(workId).HasValue)
                {
                    tkrdpGeneralPreVideoDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetPreVideoDate(workId);
                    tkrdpGeneralPreVideoDateReadOnly.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetPreVideoDate(workId);
                }

                // For FullLengthLiningP1 data
                tbxPrepDataCXIsRemoved.Text = ""; if (fullLengthLiningWorkDetailsGateway.GetCxisRemoved(workId).HasValue) tbxPrepDataCXIsRemoved.Text = fullLengthLiningWorkDetailsGateway.GetCxisRemoved(workId).ToString();
                ckbxPrepDataRoboticPrepCompleted.Checked = fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompleted(workId);
                if (fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDate(workId).HasValue)
                {
                    tkrdpPrepDataRoboticPrepCompletedDate.SelectedDate = (DateTime)fullLengthLiningWorkDetailsGateway.GetRoboticPrepCompletedDate(workId);
                }
                ckbxPrepDataP1Completed.Checked = fullLengthLiningWorkDetailsGateway.GetP1Completed(workId);

                // For FullLengthLiningM1 data
                // ... for material
                ddlM1DataMaterial.SelectedValue = fullLengthLiningWorkDetailsGateway.GetMaterial(workId);

                // ... form m1 data
                tbxM1DataMeasurementsTakenBy.Text = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenBy(workId);
                ddlM1DataTrafficControl.SelectedValue = fullLengthLiningWorkDetailsGateway.GetTrafficControl(workId);
                if(fullLengthLiningWorkDetailsGateway.GetSiteDetails(workId) == "") ddlM1DataSiteDetails.SelectedIndex = 0; else ddlM1DataSiteDetails.SelectedValue = fullLengthLiningWorkDetailsGateway.GetSiteDetails(workId);
                if (fullLengthLiningWorkDetailsGateway.GetAccessType(workId) == "") ddlM1DataAccessType.SelectedIndex = 0; else ddlM1DataAccessType.SelectedValue = fullLengthLiningWorkDetailsGateway.GetAccessType(workId);
                ckbxM1DataPipeSizeChange.Checked = fullLengthLiningWorkDetailsGateway.GetPipeSizeChange(workId);
                ckbxM1DataStandardBypass.Checked = fullLengthLiningWorkDetailsGateway.GetStandardBypass(workId);
                tbxM1DataStandardBypassComments.Text = fullLengthLiningWorkDetailsGateway.GetStandardBypassComments(workId);
                tbxM1DataTrafficControlDetails.Text = fullLengthLiningWorkDetailsGateway.GetTrafficControlDetails(workId);
                ddlM1DataMeasurementType.SelectedValue = fullLengthLiningWorkDetailsGateway.GetMeasurementType(workId);
                ddlM1DataMeasuredFromMh.SelectedValue = fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId);
                tbxM1DataMeasuredFromMh.Text = ""; fullLengthLiningWorkDetailsGateway.GetMeasurementFromMh(workId);
                ddlM1DataVideoDoneFromMh.SelectedValue = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMh(workId);
                tbxM1DataVideoDoneFromMh.Text = fullLengthLiningWorkDetailsGateway.GetVideoDoneFromMh(workId);
                ddlM1DataVideoDoneToMh.SelectedValue = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMh(workId);
                tbxM1DataVideoDoneToMh.Text = fullLengthLiningWorkDetailsGateway.GetVideoDoneToMh(workId);

                // For FullLengthLiningM2 data
                tbxM2DataMeasurementsTakenBy.Text = fullLengthLiningWorkDetailsGateway.GetMeasurementTakenByM2(workId);
                ckbxM2DataDropPipe.Checked = fullLengthLiningWorkDetailsGateway.GetDropPipe(workId);
                tbxM2DataDropPipeInvertdepth.Text = fullLengthLiningWorkDetailsGateway.GetDropPipeInvertDepth(workId);
                tbxM2DataCappedLaterals.Text = ""; if (fullLengthLiningWorkDetailsGateway.GetCappedLaterals(workId).HasValue) tbxM2DataCappedLaterals.Text = fullLengthLiningWorkDetailsGateway.GetCappedLaterals(workId).ToString();
                tbxM2DataLineWidthId.Text = fullLengthLiningWorkDetailsGateway.GetLineWithId(workId);
                tbxM2DataHydrantAddress.Text = fullLengthLiningWorkDetailsGateway.GetHydrantAddress(workId);
                ddlM2DataHydroWireWithin10FtOfInversionMh.SelectedValue = fullLengthLiningWorkDetailsGateway.GetHydroWiredWithin10FtOfInversionMH(workId);
                tbxM2DataDistanceToInversionMH.Text = fullLengthLiningWorkDetailsGateway.GetDistanceToInversionMh(workId);
                if (fullLengthLiningWorkDetailsGateway.GetSurfaceGrade(workId) == "") ddlM2DataSurfaceGrade.SelectedIndex = 0; else ddlM2DataSurfaceGrade.SelectedValue = fullLengthLiningWorkDetailsGateway.GetSurfaceGrade(workId);
                cbxM2DataHydroPulley.Checked = fullLengthLiningWorkDetailsGateway.GetHydroPulley(workId);
                cbxM2DataFridgeCart.Checked = fullLengthLiningWorkDetailsGateway.GetFridgeCart(workId);
                cbxM2DataTwoPump.Checked = fullLengthLiningWorkDetailsGateway.GetTwoPump(workId);
                cbxM2DataSixBypass.Checked = fullLengthLiningWorkDetailsGateway.GetSixBypass(workId);
                cbxM2DataScaffolding.Checked = fullLengthLiningWorkDetailsGateway.GetScaffolding(workId);
                cbxM2DataWinchExtension.Checked = fullLengthLiningWorkDetailsGateway.GetWinchExtension(workId);
                cbxM2DataExtraGenerator.Checked = fullLengthLiningWorkDetailsGateway.GetExtraGenerator(workId);
                cbxM2DataGreyCableExtension.Checked = fullLengthLiningWorkDetailsGateway.GetGreyCableExtension(workId);
                cbxM2DataEasementMats.Checked = fullLengthLiningWorkDetailsGateway.GetEasementMats(workId);
                cbxM2DataRampsRequired.Checked = fullLengthLiningWorkDetailsGateway.GetRampRequired(workId);
                cbxM2DataCameraSkid.Checked = fullLengthLiningWorkDetailsGateway.GetCameraSkid(workId);

                // For FullLengthLiningWetOut data
                int companyId = Int32.Parse(hdfCompanyId.Value);

                // ... ... tube size = confirmed Size
                Distance confirmedSizeDistance = new Distance(tbxConfirmedSize.Text);
                double confirmedSize = 0;
                string[] confirmedSizeString = confirmedSizeDistance.ToStringInEng1().Split('\"');

                if (!confirmedSizeDistance.ToStringInEng1().Contains("'"))
                {
                    if (Validator.IsValidDouble(tbxConfirmedSize.Text))
                    {
                        confirmedSize = double.Parse(tbxConfirmedSize.Text);
                    }
                    else
                    {
                        confirmedSize = double.Parse(confirmedSizeString[0]);
                    }
                }
                else
                {
                    confirmedSize = Math.Ceiling(confirmedSizeDistance.ToDoubleInEng3()*12);
                    tbxConfirmedSize.Text = confirmedSize.ToString();
                }

                // ... Verify if work has wet out information
                WorkFullLengthLiningWetOutGateway workFullLengthLiningWetOutGateway = new WorkFullLengthLiningWetOutGateway();
                workFullLengthLiningWetOutGateway.LoadByWorkId(workId, companyId);

                if (workFullLengthLiningWetOutGateway.Table.Rows.Count > 0)
                {
                    // ... setup data
                    ddlWetOutDataLinerTube.SelectedValue = fullLengthLiningWorkDetailsGateway.GetLinerTube(workId);
                    if (ddlWetOutDataLinerTube.SelectedValue != "(Select)")
                    {
                        ckbxWetOutDataIncludeWetOutInformation.Checked = true;
                    }
                    else
                    {
                        ckbxWetOutDataIncludeWetOutInformation.Checked = false;
                    }

                    ddlWetOutDataResins.SelectedValue = fullLengthLiningWorkDetailsGateway.GetResinId(workId).ToString();
                    tbxWetOutDataExcessResin.Text = fullLengthLiningWorkDetailsGateway.GetExcessResin(workId).ToString();
                    ddlWetOutDataPoundsDrums.SelectedValue = fullLengthLiningWorkDetailsGateway.GetPoundsDrums(workId);
                    tbxWetOutDataDrumDiameter.Text = fullLengthLiningWorkDetailsGateway.GetDrumDiameter(workId).ToString();
                    tbxWetOutDataHoistMaximumHeight.Text = fullLengthLiningWorkDetailsGateway.GetHoistMaximumHeight(workId).ToString();
                    tbxWetOutDataHoistMinimumHeight.Text = fullLengthLiningWorkDetailsGateway.GetHoistMinimumHeight(workId).ToString();
                    tbxWetOutDataDownDropTubeLength.Text = fullLengthLiningWorkDetailsGateway.GetDownDropTubeLenght(workId).ToString();
                    tbxWetOutDataPumpHeightAboveGround.Text = fullLengthLiningWorkDetailsGateway.GetPumpHeightAboveGround(workId).ToString();
                    tbxWetOutDataTubeResinToFeltFactor.Text = fullLengthLiningWorkDetailsGateway.GetTubeResinToFeltFactor(workId).ToString();

                    // ... wet out sheet
                    DateTime wetOutDataDateOfSheet = fullLengthLiningWorkDetailsGateway.GetDateOfSheet(workId);
                    tbxWetOutDataDateOfSheet.Text = wetOutDataDateOfSheet.Month.ToString() + "/" + wetOutDataDateOfSheet.Day.ToString() + "/" + wetOutDataDateOfSheet.Year.ToString();
                    ddlWetOutDataMadeBy.SelectedValue = fullLengthLiningWorkDetailsGateway.GetEmployeeId(workId).ToString();
                    hdfRunDetails.Value = fullLengthLiningWorkDetailsGateway.GetRunDetails(workId);
                    ddlWetOutDataRunDetails2.SelectedValue = fullLengthLiningWorkDetailsGateway.GetRunDetails2(workId);
                    tkrdpWetOutDataWetOutDate.SelectedDate = fullLengthLiningWorkDetailsGateway.GetWetOutDate(workId);

                    tbxWetOutDataInstallDate.Text = "";
                    if (fullLengthLiningWorkDetailsGateway.GetWetOutInstallDate(workId).HasValue)
                    {
                        DateTime? wetOutDataInstallDate = fullLengthLiningWorkDetailsGateway.GetWetOutInstallDate(workId);
                        DateTime wetOutDataInstallDateDateTime = (DateTime)wetOutDataInstallDate;
                        tbxWetOutDataInstallDate.Text = wetOutDataInstallDateDateTime.Month.ToString() + "/" + wetOutDataInstallDateDateTime.Day.ToString() + "/" + wetOutDataInstallDateDateTime.Year.ToString();
                    }

                    tbxWetOutDataTubeThickness.Text = fullLengthLiningWorkDetailsGateway.GetInversionThickness(workId);
                    tbxWetOutDataLengthToLine.Text = decimal.Round(decimal.Parse(fullLengthLiningWorkDetailsGateway.GetLengthToLine(workId).ToString()), 1).ToString();
                    tbxWetOutDataPlusExtra.Text = fullLengthLiningWorkDetailsGateway.GetPlusExtra(workId).ToString();
                    tbxWetOutDataForTurnOffset.Text = fullLengthLiningWorkDetailsGateway.GetForTurnOffset(workId).ToString();
                    tbxWetOutDataLengthtToWetOut.Text = fullLengthLiningWorkDetailsGateway.GetLengthToWetOut(workId).ToString();

                    tbxWetOutDataTubeMaxColdHead.Text = fullLengthLiningWorkDetailsGateway.GetTubeMaxColdHead(workId).ToString();
                    tbxWetOutDataTubeMaxColdHeadPSI.Text = fullLengthLiningWorkDetailsGateway.GetTubeMaxColdHeadPsi(workId).ToString();
                    tbxWetOutDataTubeMaxHotHead.Text = fullLengthLiningWorkDetailsGateway.GetTubeMaxHotHead(workId).ToString();
                    tbxWetOutDataTubeMaxHotHeadPSI.Text = fullLengthLiningWorkDetailsGateway.GetTubeMaxHotHeadPsi(workId).ToString();
                    tbxWetOutDataTubeIdealHead.Text = fullLengthLiningWorkDetailsGateway.GetTubeIdealHead(workId).ToString();
                    tbxWetOutDataTubeIdealHeadPSI.Text = fullLengthLiningWorkDetailsGateway.GetTubeIdealHeadPsi(workId).ToString();

                    tbxWetOutDataNetResinForTube.Text = fullLengthLiningWorkDetailsGateway.GetNetResinForTube(workId).ToString();
                    tbxWetOutDataNetResinForTubeUsgals.Text = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeUsgals(workId).ToString();
                    tbxWetOutDataNetResinForTubeDrumsIns.Text = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeDrumsIns(workId);
                    tbxWetOutDataNetResinForTubeLbsFt.Text = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeLbsFt(workId).ToString();
                    tbxWetOutDataNetResinForTubeUsgFt.Text = fullLengthLiningWorkDetailsGateway.GetNetResinForTubeUsgFt(workId).ToString();

                    tbxWetOutDataExtraResinForMix.Text = fullLengthLiningWorkDetailsGateway.GetExtraResinForMix(workId).ToString();
                    tbxWetOutDataExtraLbsForMix.Text = fullLengthLiningWorkDetailsGateway.GetExtraLbsForMix(workId).ToString();
                    tbxWetOutDataTotalMixQuantity.Text = fullLengthLiningWorkDetailsGateway.GetTotalMixQuantity(workId).ToString();
                    tbxWetOutDataTotalMixQuantityUsgals.Text = fullLengthLiningWorkDetailsGateway.GetTotalMixQuantityUsgals(workId).ToString();
                    tbxWetOutDataTotalMixQuantityDrumsIns.Text = fullLengthLiningWorkDetailsGateway.GetTotalMixQuantityDrumsIns(workId);

                    ddlWetOutDataInversionType.SelectedValue = fullLengthLiningWorkDetailsGateway.GetInversionType(workId);
                    tbxWetOutDataDepthOfInversionMH.Text = fullLengthLiningWorkDetailsGateway.GetDepthOfInversionMH(workId).ToString();
                    tbxWetOutDataTubeForColumn.Text = fullLengthLiningWorkDetailsGateway.GetTubeForColumn(workId).ToString();
                    tbxWetOutDataTubeForStartDry.Text = fullLengthLiningWorkDetailsGateway.GetTubeForStartDry(workId).ToString();
                    tbxWetOutDataTotalTube.Text = fullLengthLiningWorkDetailsGateway.GetTotalTube(workId).ToString();
                    tbxWetOutDataDropTubeConnects.Text = fullLengthLiningWorkDetailsGateway.GetDropTubeConnects(workId);
                    tbxWetOutDataAllowsHeadTo.Text = fullLengthLiningWorkDetailsGateway.GetAllowsHeadTo(workId).ToString();
                    tbxWetOutDataRollerGap.Text = fullLengthLiningWorkDetailsGateway.GetRollerGap(workId).ToString();

                    tbxWetOutDataHeightNeeded.Text = fullLengthLiningWorkDetailsGateway.GetHeightNeeded(workId).ToString();
                    tbxWetOutDataAvailable.Text = fullLengthLiningWorkDetailsGateway.GetAvailable(workId);
                    tbxWetOutDataHoistHeight.Text = fullLengthLiningWorkDetailsGateway.GetHoistHeight(workId);
                    hdfResinId.Value = fullLengthLiningWorkDetailsGateway.GetResinId(workId).ToString();
                    hdfMadeBy.Value = fullLengthLiningWorkDetailsGateway.GetEmployeeId(workId).ToString();
                    tbxWetOutDataNotes.Text = fullLengthLiningWorkDetailsGateway.GetCommentsCipp(workId);

                    lblWetOutDataResinGray.Text = fullLengthLiningWorkDetailsGateway.GetResinsLabel(workId);
                    lblWetOutDataDrumContainsGray.Text = fullLengthLiningWorkDetailsGateway.GetDrumContainsLabel(workId);
                    lblWetOutDataLinerTubeGray.Text = fullLengthLiningWorkDetailsGateway.GetLinerTubeLabel(workId);
                    lblWetOutDataLbDrumsGrey.Text = fullLengthLiningWorkDetailsGateway.GetForLbDrumsLabel(workId);
                    lblWetOutDataNetResinGrey.Text = fullLengthLiningWorkDetailsGateway.GetNetResinLabel(workId);
                    lblWetOutDataCatalystGrey.Text = fullLengthLiningWorkDetailsGateway.GetCatalystLabel(workId);

                    // ... ... graphic labels
                    lblWetOutDataDimensionLabel.Text = confirmedSize + " ins x " + ddlThickness.SelectedValue + " mm Tube";
                    lblWetOutDataTotalTubeLengthlabel.Text = "Total Tube Length " + tbxWetOutDataTotalTube.Text + " ft";
                    lblWetOutDataForColumnLabel.Text = tbxWetOutDataTubeForColumn.Text + " ft  for Column";
                    lblWetOutDataDryFtLabel.Text = "Dry " + tbxWetOutDataTubeForStartDry.Text + " ft";
                    lblWetOutDataWetOutLengthlabel.Text = "Wet-Out Length " + tbxWetOutDataLengthtToWetOut.Text + " ft";
                    lblWetOutDataDryFtEndLabel.Text = "Dry " + tbxWetOutDataTubeForColumn.Text + " ft";
                    lblWetOutDataTailEndlabel.Text = "Tail End";
                    lblWetOutDataColumnEndlabel.Text = "Column End";
                    lblWetOutDataRollerGapLabel.Text = "Roller Gap " + tbxWetOutDataRollerGap.Text + " mm";
                }
                else
                {
                    //  Wet Out Data
                    // ... Show current day for new sheets
                    DateTime sheetDate = DateTime.Now;
                    tbxWetOutDataDateOfSheet.Text = sheetDate.Month.ToString() + "/" + sheetDate.Day.ToString() + "/" + sheetDate.Year.ToString();

                    // Set default values.
                    tbxWetOutDataExcessResin.Text = "0.0";
                    ddlWetOutDataPoundsDrums.SelectedIndex = 1;
                    tbxWetOutDataDrumDiameter.Text = "22.5";
                    tbxWetOutDataHoistMaximumHeight.Text = "24";
                    tbxWetOutDataHoistMinimumHeight.Text = "5";
                    tbxWetOutDataDownDropTubeLength.Text = "19";
                    tbxWetOutDataPumpHeightAboveGround.Text = "6";
                    tbxWetOutDataTubeResinToFeltFactor.Text = "87";

                    tbxWetOutDataPlusExtra.Text = "3";
                    tbxWetOutDataForTurnOffset.Text = "0";

                    tbxWetOutDataExtraResinForMix.Text = "0";
                    tbxWetOutDataTubeForColumn.Text = "16";
                    tbxWetOutDataTubeForStartDry.Text = "3";
                    if (ddlWetOutDataInversionType.SelectedValue == "Top")
                    {
                        Distance usmhDepthDistance = new Distance(tbxM1DataUsmhDepth.Text);
                        tbxWetOutDataDepthOfInversionMH.Text = decimal.Round(decimal.Parse(usmhDepthDistance.ToStringInEng3()), 1).ToString();
                    }
                    else
                    {
                        if (ddlWetOutDataInversionType.SelectedValue == "Bottom")
                        {
                            Distance dsmhDepthDistance = new Distance(tbxM1DataDsmhDepth.Text);
                            tbxWetOutDataDepthOfInversionMH.Text = decimal.Round(decimal.Parse(dsmhDepthDistance.ToStringInEng3()), 1).ToString();
                        }
                        else
                        {
                            tbxWetOutDataDepthOfInversionMH.Text = "0";
                        }
                    }

                    tbxWetOutDataRollerGap.Text = "13";
                    tbxWetOutDataNotes.Text = fullLengthLiningWorkDetailsGateway.GetCommentsCipp(workId);

                    // ...Section values
                    // ... ... Length To Line = Steel Tape Length, the first section to consider is the work one in Xft Yin
                    Distance steelTapeLength = new Distance(tbxSteelTapeLength.Text);
                    tbxWetOutDataLengthToLine.Text = decimal.Round(decimal.Parse(steelTapeLength.ToStringInEng3()), 1).ToString();
                    tbxInversionDataRunLength.Text = decimal.Round(decimal.Parse(steelTapeLength.ToStringInEng3()),1).ToString();
                    double lengthToLine = double.Parse(steelTapeLength.ToStringInEng3());

                    // ... Run details
                    if (cbxlSectionId.Items.Count > 1)
                    {
                        hdfRunDetails.Value = hdfSectionId.Value;
                    }

                    // .... Install Date
                    tbxWetOutDataInstallDate.Text = "";
                    if (tkrdpInstallDataInstallDate.SelectedDate.ToString() != "")
                    {
                        DateTime? inversionDataInstalledOn = tkrdpInstallDataInstallDate.SelectedDate;
                        DateTime installedOnDateTime = (DateTime)inversionDataInstalledOn;

                        tbxWetOutDataInstallDate.Text = installedOnDateTime.Month.ToString() + "/" + installedOnDateTime.Day.ToString() + "/" + installedOnDateTime.Year.ToString();
                    }
                }

                // ... Verify if work has inversion information
                WorkFullLengthLiningInversionGateway workFullLengthLiningInversionGateway = new WorkFullLengthLiningInversionGateway();
                workFullLengthLiningInversionGateway.LoadByWorkId(workId, companyId);

                // ... Verify if work has inversion information
                if (workFullLengthLiningInversionGateway.Table.Rows.Count > 0)
                {
                    // ... Inversion data
                    lblInversionDataSubtitle.Text = fullLengthLiningWorkDetailsGateway.GetLinerTube(workId);

                    DateTime inversionDataDateOfSheet = fullLengthLiningWorkDetailsGateway.GetDateOfSheet(workId);
                    tbxInversionDataDateOfSheet.Text = inversionDataDateOfSheet.Month.ToString() + "/" + inversionDataDateOfSheet.Day.ToString() + "/" + inversionDataDateOfSheet.Year.ToString();

                    int employeeId = fullLengthLiningWorkDetailsGateway.GetEmployeeId(workId);
                    EmployeeGateway employeeGateway = new EmployeeGateway();
                    employeeGateway.LoadByEmployeeId(employeeId);
                    tbxInversionDataMadeBy.Text = employeeGateway.GetLastName(employeeId) + " " + employeeGateway.GetFirstName(employeeId);

                    tbxInversionDataInstalledOn.Text = "";
                    if (fullLengthLiningWorkDetailsGateway.GetWetOutInstallDate(workId).HasValue)
                    {
                        DateTime? inversionDataInstalledOn = fullLengthLiningWorkDetailsGateway.GetWetOutInstallDate(workId);
                        DateTime inversionDataInstalledOnDateTime = (DateTime)inversionDataInstalledOn;
                        tbxInversionDataInstalledOn.Text = inversionDataInstalledOnDateTime.Month.ToString() + "/" + inversionDataInstalledOnDateTime.Day.ToString() + "/" + inversionDataInstalledOnDateTime.Year.ToString();
                    }

                    tbxInversionDataRunDetails2.Text = fullLengthLiningWorkDetailsGateway.GetRunDetails2(workId);
                    tbxInversionDataCommentsEdit.Text = fullLengthLiningWorkDetailsGateway.GetInversionComment(workId);
                    tbxInversionDataLinerSize.Text = confirmedSizeString + " ins x" + fullLengthLiningWorkDetailsGateway.GetInversionThickness(workId);
                    tbxInversionDataRunLength.Text = decimal.Round(decimal.Parse(fullLengthLiningWorkDetailsGateway.GetLengthToLine(workId).ToString()), 1).ToString();
                    tbxInversionDataWetOutLenght.Text = fullLengthLiningWorkDetailsGateway.GetLengthToWetOut(workId).ToString();

                    ddlInversionDataInversionPipeType.SelectedValue = fullLengthLiningWorkDetailsGateway.GetPipeType(workId);
                    if (ddlInversionDataInversionPipeType.SelectedValue != "(Select)")
                    {
                        ckbxInversionDataIncludeInversionInformation.Checked = true;
                    }
                    else
                    {
                        ckbxInversionDataIncludeInversionInformation.Checked = false;
                    }

                    ddlInversionDataPipeCondition.SelectedValue = fullLengthLiningWorkDetailsGateway.GetPipeCondition(workId);
                    ddlInversionDataGroundMoisture.SelectedValue = fullLengthLiningWorkDetailsGateway.GetGroundMoisture(workId);
                    tbxInversionDataBoilerSize.Text = fullLengthLiningWorkDetailsGateway.GetBoilerSize(workId).ToString();
                    tbxInversionDataPumpsTotalCapacity.Text = fullLengthLiningWorkDetailsGateway.GetPumpTotalCapacity(workId).ToString();
                    tbxInversionDataLayflatSize.Text = fullLengthLiningWorkDetailsGateway.GetLayFlatSize(workId).ToString();
                    tbxInversionDataLayflatQuantityTotal.Text = fullLengthLiningWorkDetailsGateway.GetLayFlatQuantityTotal(workId).ToString();

                    tbxInversionDataWaterStartTempTs.Text = fullLengthLiningWorkDetailsGateway.GetWaterStartTemp(workId).ToString();
                    tbxInversionDataTempT1.Text = fullLengthLiningWorkDetailsGateway.GetTemp1(workId).ToString();
                    tbxInversionDataHoldAtT1For.Text = fullLengthLiningWorkDetailsGateway.GetHoldAtT1(workId).ToString();
                    tbxInversionDataTempT2.Text = fullLengthLiningWorkDetailsGateway.GetTempT2(workId).ToString();
                    tbxInversionDataCookAtT2For.Text = fullLengthLiningWorkDetailsGateway.GetCookAtT2(workId).ToString();
                    tbxInversionDataCoolDownFor.Text = fullLengthLiningWorkDetailsGateway.GetCoolDownFor(workId).ToString();

                    tbxInversionDataCoolToTemp.Text = fullLengthLiningWorkDetailsGateway.GetCoolToTemp(workId).ToString();
                    tbxInversionDataDropInPipeRun.Text = fullLengthLiningWorkDetailsGateway.GetDropInPipeRun(workId).ToString();
                    tbxInversionDataPipeSlopeOf.Text = fullLengthLiningWorkDetailsGateway.GetPipeSlopOf(workId).ToString();

                    lblInversionData45F120F.Text = tbxInversionDataWaterStartTempTs.Text + "°F-" + tbxInversionDataTempT1.Text + "°F (hr)";
                    tbxInversionData45F120F.Text = fullLengthLiningWorkDetailsGateway.GetF45F120(workId).ToString();
                    tbxInversionDataHold.Text = fullLengthLiningWorkDetailsGateway.GetHold(workId).ToString();
                    lblInversionData120F185F.Text = tbxInversionDataTempT1.Text + "°F-" + tbxInversionDataTempT2.Text + "°F (hr)";
                    tbxInversionData120F185F.Text = fullLengthLiningWorkDetailsGateway.GetF120F185(workId).ToString();
                    tbxInversionDataCookTime.Text = fullLengthLiningWorkDetailsGateway.GetCookTime(workId).ToString();
                    tbxInversionDataCoolTime.Text = fullLengthLiningWorkDetailsGateway.GetCoolTime(workId).ToString();
                    tbxInversionDataAproxTotal.Text = fullLengthLiningWorkDetailsGateway.GetAproxTotal(workId).ToString();

                    tbxInversionDataWaterChangesPerHour.Text = fullLengthLiningWorkDetailsGateway.GetWaterChangesPerHour(workId).ToString();
                    tbxInversionDataReturnWaterVelocity.Text = fullLengthLiningWorkDetailsGateway.GetReturnWaterVelocity(workId).ToString();
                    tbxInversionDataLayflatBackPressure.Text = fullLengthLiningWorkDetailsGateway.GetLayflatBackPressure(workId).ToString();
                    tbxInversionDataPumpLiftAtIdealHead.Text = fullLengthLiningWorkDetailsGateway.GetPumpLiftAtIdealHead(workId).ToString();
                    tbxInversionDataWaterToFillLinerColumn.Text = fullLengthLiningWorkDetailsGateway.GetWaterToFillLinerColumn(workId).ToString();
                    tbxInversionDataWaterPerFit.Text = fullLengthLiningWorkDetailsGateway.GetWaterPerFit(workId).ToString();

                    tbxInversionDataNotesAndInstallationResults.Text = fullLengthLiningWorkDetailsGateway.GetInstallationResults(workId);

                    lblInversionDataLinerInfoGrey.Text = fullLengthLiningWorkDetailsGateway.GetInversionLinerTubeLabel(workId);
                    lblInversionDataHeadsGrey.Text = fullLengthLiningWorkDetailsGateway.GetHeadsIdealLabel(workId);
                    lblInversionDataPumpingCirculationSubtitle.Text = fullLengthLiningWorkDetailsGateway.GetPumpingAndCirculationLabel(workId);

                    // ... ... graphic labels
                    lblInversionDataMaxColdForTubeLabel.Text = tbxWetOutDataTubeMaxColdHead.Text + " ft = Max Cold for tube";
                    lblInversionDataMaxHotForTubeLabel.Text = tbxWetOutDataTubeMaxHotHead.Text + " ft = Max Hot for tube";
                    lblInversionDataIdelForTubeLabel.Text = tbxWetOutDataTubeIdealHead.Text + " ft = Ideal for tube";

                    double maxColdForTubeEnd = double.Parse(tbxWetOutDataTubeMaxColdHead.Text) + double.Parse(tbxInversionDataDropInPipeRun.Text);
                    lblInversionDataMaxColdForTubeEndLabel.Text = decimal.Round(decimal.Parse(maxColdForTubeEnd.ToString()), 1).ToString() + " ft";

                    double maxHotForTubeEnd = double.Parse(tbxWetOutDataTubeMaxHotHead.Text) + double.Parse(tbxInversionDataDropInPipeRun.Text);
                    lblInversionDataMaxHotForTubeEndLabel.Text = decimal.Round(decimal.Parse(maxHotForTubeEnd.ToString()), 1).ToString() + " ft";

                    double idealForTubeEnd = double.Parse(tbxWetOutDataTubeIdealHead.Text) + double.Parse(tbxInversionDataDropInPipeRun.Text);
                    lblInversionDataIdelForTubeEndLabel.Text = decimal.Round(decimal.Parse(idealForTubeEnd.ToString()), 1).ToString() + " ft";

                    lblInversionDataPumpHeightLabel.Text = "   " + tbxWetOutDataPumpHeightAboveGround.Text + " ft";
                    lblInversionDataLinerSizeLabel.Text = confirmedSize.ToString() + " ins x" + fullLengthLiningWorkDetailsGateway.GetInversionThickness(workId) + " Liner";

                    lblInversionDataRunLengthLabel.Text = "Run Length: " + tbxInversionDataRunLength.Text + " ft; Fall: " + tbxInversionDataDropInPipeRun.Text + " ft";
                    lblInversionDataDepthOfInversionMHLabel.Text = "   " + tbxWetOutDataDepthOfInversionMH.Text + " ft";
                    lblInversionDataEndLabel.Text = "End";
                }
                else
                {
                    //  Wet Out Data
                    // ... Show current day for new sheets
                    DateTime sheetDate = DateTime.Now;
                    tbxInversionDataDateOfSheet.Text = sheetDate.Month.ToString() + "/" + sheetDate.Day.ToString() + "/" + sheetDate.Year.ToString();

                    // Set default values.
                    lblInversionData45F120F.Text = "";
                    lblInversionData120F185F.Text = "";
                    tbxInversionDataBoilerSize.Text = "7000000";
                    tbxInversionDataPumpsTotalCapacity.Text = "300";
                    tbxInversionDataLayflatSize.Text = "4";
                    tbxInversionDataLayflatQuantityTotal.Text = "1";

                    tbxInversionDataWaterStartTempTs.Text = "45";
                    tbxInversionDataTempT1.Text = "120";
                    tbxInversionDataHoldAtT1For.Text = "0.5";
                    tbxInversionDataTempT2.Text = "185";
                    tbxInversionDataCookAtT2For.Text = "2";
                    tbxInversionDataCoolDownFor.Text = "1";
                    tbxInversionDataCoolToTemp.Text = "85";

                    // ...Section values
                    // ... ... Length To Line = Steel Tape Length, the first section to consider is the work one in Xft Yin
                    Distance steelTapeLength = new Distance(tbxSteelTapeLength.Text);
                    tbxInversionDataRunLength.Text = decimal.Round(decimal.Parse(steelTapeLength.ToStringInEng3()), 1).ToString();
                    double lengthToLine = double.Parse(steelTapeLength.ToStringInEng3());

                    // ... Run details
                    if (cbxlSectionId.Items.Count > 1)
                    {
                        hdfRunDetails.Value = hdfSectionId.Value;
                    }

                    // .... Install Date
                    tbxInversionDataInstalledOn.Text = "";
                    if (tkrdpInstallDataInstallDate.SelectedDate.ToString() != "")
                    {
                        DateTime? inversionDataInstalledOn = tkrdpInstallDataInstallDate.SelectedDate;
                        DateTime installedOnDateTime = (DateTime)inversionDataInstalledOn;

                        tbxInversionDataInstalledOn.Text = installedOnDateTime.Month.ToString() + "/" + installedOnDateTime.Day.ToString() + "/" + installedOnDateTime.Year.ToString();
                    }
                 }

                // ... Show FLL Comments + RA Comments
                int flWorkId = workId;

                // ... ... Get raWorkId
                int raWorkId = 0;
                int projectId = Int32.Parse(hdfCurrentProjectId.Value);
                WorkGateway workGateway = new WorkGateway();
                workGateway.LoadByProjectIdAssetIdWorkType(projectId, assetId, "Rehab Assessment", companyId);
                if (workGateway.Table.Rows.Count > 0)
                {
                    raWorkId = workGateway.GetWorkId(assetId, "Rehab Assessment", projectId);
                }

                // ... ... Get comments
                FullLengthLiningAllComments fullLengthLiningAllComments = new FullLengthLiningAllComments(fullLengthLiningTDS);
                fullLengthLiningAllComments.LoadAllByFlWorkIdRaWorkId(flWorkId, raWorkId, companyId);

                // ... ... Store datasets
                Session["fullLengthLiningTDS"] = fullLengthLiningTDS;

                // ... ... Show comments
                tbxCommentsDataComments.Text = fullLengthLiningAllComments.GetFLOrRAComments(companyId, fullLengthLiningAllComments.Table.Rows.Count, "\n");
            }
        }
コード例 #2
0
        private void Save2()
        {
            //Save changes without validate

            // Laterals Gridview
            // ... If the gridview is edition mode
            if (grdLaterals.EditIndex >= 0)
            {
                grdLaterals.UpdateRow(grdLaterals.EditIndex, true);
            }

            // Save Lateral data
            GrdFLAddLateralsNewAdd();

            // Catalysts Gridview
            if (ckbxWetOutDataIncludeWetOutInformation.Checked)
            {
                // ... If the gridview is edition mode
                if (grdCatalysts.EditIndex >= 0)
                {
                    grdCatalysts.UpdateRow(grdCatalysts.EditIndex, true);
                }

                // Save Lateral data
                GrdCatalystsAdd();
            }

            // Save data
            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());

            // Get Section Details
            // ... FullLengthLiningSectionDetails data
            string newStreet = ""; if (tbxStreet.Text != "") newStreet = tbxStreet.Text.Trim();
            string newUsmh = ""; if (tbxUSMH.Text != "") newUsmh = tbxUSMH.Text.Trim();
            string newDsmh = ""; if (tbxDSMH.Text != "") newDsmh = tbxDSMH.Text.Trim();
            string newMapSize = ""; if (tbxMapSize.Text != "") newMapSize = tbxMapSize.Text.Trim();
            string newSize = ""; if (tbxConfirmedSize.Text != "") newSize = tbxConfirmedSize.Text.Trim();
            string newThickness = ""; if (ddlThickness.SelectedValue != "") newThickness = ddlThickness.SelectedValue;
            string newMapLength = ""; if (tbxMapLength.Text != "") newMapLength = tbxMapLength.Text.Trim();

            string newSteelTapeThroughSewer = "";
            string newLength = "";
            if (tbxM1DataSteelTapeThroughSewer.Text != "")
            {
                newSteelTapeThroughSewer = tbxM1DataSteelTapeThroughSewer.Text.Trim();
                newLength = tbxM1DataSteelTapeThroughSewer.Text.Trim();
            }

            int? newLaterals = null; if (tbxLaterals.Text != "") newLaterals = Int32.Parse(tbxLaterals.Text.Trim());
            int? newLiveLaterals = null; if (tbxLiveLaterals.Text != "") newLiveLaterals = Int32.Parse(tbxLiveLaterals.Text.Trim());

            // Get m1 data
            // ... assetSewerSection data
            string newUsmhDepth = ""; if ((tbxM1DataUsmhDepth.Text != "") && (tbxUSMH.Text != "")) newUsmhDepth = tbxM1DataUsmhDepth.Text.Trim();
            string newDsmhDepth = ""; if ((tbxM1DataDsmhDepth.Text != "") && (tbxDSMH.Text != "")) newDsmhDepth = tbxM1DataDsmhDepth.Text.Trim();

            // ... lfsAssetSewerSection data
            string newUsmhMouth12 = ""; if ((tbxM1DataUsmhMouth12.Text != "") && (tbxUSMH.Text != "")) newUsmhMouth12 = tbxM1DataUsmhMouth12.Text.Trim();
            string newUsmhMouth1 = ""; if ((tbxM1DataUsmhMouth1.Text != "") && (tbxUSMH.Text != "")) newUsmhMouth1 = tbxM1DataUsmhMouth1.Text.Trim();
            string newUsmhMouth2 = ""; if ((tbxM1DataUsmhMouth2.Text != "") && (tbxUSMH.Text != "")) newUsmhMouth2 = tbxM1DataUsmhMouth2.Text.Trim();
            string newUsmhMouth3 = ""; if ((tbxM1DataUsmhMouth3.Text != "") && (tbxUSMH.Text != "")) newUsmhMouth3 = tbxM1DataUsmhMouth3.Text.Trim();
            string newUsmhMouth4 = ""; if ((tbxM1DataUsmhMouth4.Text != "") && (tbxUSMH.Text != "")) newUsmhMouth4 = tbxM1DataUsmhMouth4.Text.Trim();
            string newUsmhMouth5 = ""; if ((tbxM1DataUsmhMouth5.Text != "") && (tbxUSMH.Text != "")) newUsmhMouth5 = tbxM1DataUsmhMouth5.Text.Trim();
            string newDsmhMouth12 = ""; if ((tbxM1DataDsmhMouth12.Text != "") && (tbxDSMH.Text != "")) newDsmhMouth12 = tbxM1DataDsmhMouth12.Text.Trim();
            string newDsmhMouth1 = ""; if ((tbxM1DataDsmhMouth1.Text != "") && (tbxDSMH.Text != "")) newDsmhMouth1 = tbxM1DataDsmhMouth1.Text.Trim();
            string newDsmhMouth2 = ""; if ((tbxM1DataDsmhMouth2.Text != "") && (tbxDSMH.Text != "")) newDsmhMouth2 = tbxM1DataDsmhMouth2.Text.Trim();
            string newDsmhMouth3 = ""; if ((tbxM1DataDsmhMouth3.Text != "") && (tbxDSMH.Text != "")) newDsmhMouth3 = tbxM1DataDsmhMouth3.Text.Trim();
            string newDsmhMouth4 = ""; if ((tbxM1DataDsmhMouth4.Text != "") && (tbxDSMH.Text != "")) newDsmhMouth4 = tbxM1DataDsmhMouth4.Text.Trim();
            string newDsmhMouth5 = ""; if ((tbxM1DataDsmhMouth5.Text != "") && (tbxDSMH.Text != "")) newDsmhMouth5 = tbxM1DataDsmhMouth5.Text.Trim();
            string newGeneralSubArea = ""; if (tbxGeneralSubArea.Text != "") newGeneralSubArea = tbxGeneralSubArea.Text.Trim();

            // ... assetSewerMH data
            string newUsmhAddress = ""; if (tbxM1DataUsmhAddress.Text != "") newUsmhAddress = tbxM1DataUsmhAddress.Text.Trim();
            string newDsmhAddress = ""; if (tbxM1DataDsmhAddress.Text != "") newDsmhAddress = tbxM1DataDsmhAddress.Text.Trim();

            // Update section details
            FullLengthLiningSectionDetails fullLengthLiningSectionDetails = new FullLengthLiningSectionDetails(fullLengthLiningTDS);
            fullLengthLiningSectionDetails.Update(workId, assetId, newStreet, newMapSize, newSize, newMapLength, newLength, newLaterals, newLiveLaterals, newUsmhDepth, newDsmhDepth, newSteelTapeThroughSewer, newUsmhMouth12, newUsmhMouth1, newUsmhMouth2, newUsmhMouth3, newUsmhMouth4, newUsmhMouth5, newDsmhMouth12, newDsmhMouth1, newDsmhMouth2, newDsmhMouth3, newDsmhMouth4, newDsmhMouth5, newUsmh, newDsmh, newUsmhAddress, newDsmhAddress, newGeneralSubArea, newThickness);

            // Get generalData
            // ... Ra new data
            DateTime? newPreFlushDate = null;
            if (tkrdpGeneralPreFlushDate.Visible == true)
            {
                if (tkrdpGeneralPreFlushDate.SelectedDate.HasValue)
                {
                    newPreFlushDate = tkrdpGeneralPreFlushDate.SelectedDate.Value;
                }
            }
            else
            {
                if (tkrdpGeneralPreFlushDateReadOnly.SelectedDate.HasValue)
                {
                    newPreFlushDate = tkrdpGeneralPreFlushDateReadOnly.SelectedDate.Value;
                }
            }

            DateTime? newPreVideoDate = null;
            if (tkrdpGeneralPreVideoDate.Visible == true)
            {
                if (tkrdpGeneralPreVideoDate.SelectedDate.HasValue)
                {
                    newPreVideoDate = tkrdpGeneralPreVideoDate.SelectedDate.Value;
                }
            }
            else
            {
                if (tkrdpGeneralPreVideoDateReadOnly.SelectedDate.HasValue)
                {
                    newPreVideoDate = tkrdpGeneralPreVideoDateReadOnly.SelectedDate.Value; ;
                }
            }

            // ... FullLengthLining data
            string newGeneralClientId = ""; if (tbxGeneralClientId.Text != "") newGeneralClientId = tbxGeneralClientId.Text.Trim();
            DateTime? newGeneralProposedLiningDate = null; if (tkrdpGeneralProposedLiningDate.SelectedDate.HasValue) newGeneralProposedLiningDate = tkrdpGeneralProposedLiningDate.SelectedDate.Value;
            DateTime? newGeneralDeadlineLiningDate = null; if (tkrdpGeneralDeadlineLiningDate.SelectedDate.HasValue) newGeneralDeadlineLiningDate = tkrdpGeneralDeadlineLiningDate.SelectedDate.Value;
            DateTime? newGeneralP1Date = null; if (tkrdpPrepDataP1Date.SelectedDate.HasValue) newGeneralP1Date = tkrdpPrepDataP1Date.SelectedDate.Value;
            DateTime? newGeneralM1Date = null; if (tkrdpM1DataM1Date.SelectedDate.HasValue) newGeneralM1Date = tkrdpM1DataM1Date.SelectedDate.Value;
            DateTime? newGeneralM2Date = null; if (tkrdpM2DataM2Date.SelectedDate.HasValue) newGeneralM2Date = tkrdpM2DataM2Date.SelectedDate.Value;
            DateTime? newGeneralInstallDate = null; if (tkrdpInstallDataInstallDate.SelectedDate.HasValue) newGeneralInstallDate = tkrdpInstallDataInstallDate.SelectedDate.Value;
            DateTime? newGeneralFinalVideo = null; if (tkrdpInstallDataFinalVideoDate.SelectedDate.HasValue) newGeneralFinalVideo = tkrdpInstallDataFinalVideoDate.SelectedDate.Value;
            bool newGeneralIssueIdentified = ckbxGeneralIssueIdentified.Checked;
            bool newGeneralLfsIssue = ckbxGeneralLfsIssue.Checked;
            bool newGeneralClientIssue = ckbxGeneralClientIssue.Checked;
            bool newGeneralSalesIssue = ckbxGeneralSalesIssue.Checked;
            bool newGeneralIssueGivenToClient = ckbxGeneralIssueGivenToClient.Checked;
            bool newGeneralIssueResolved = ckbxGeneralIssueResolved.Checked;
            bool newGeneralIssueInvestigation = ckbxGeneralIssueInvestigation.Checked;
            int? newPrepDataCXIsRemoved = null; if (tbxPrepDataCXIsRemoved.Text != "") newPrepDataCXIsRemoved = Int32.Parse(tbxPrepDataCXIsRemoved.Text.Trim());
            bool newRoboticPrepCompleted = ckbxPrepDataRoboticPrepCompleted.Checked;
            DateTime? newRoboticPrepCompletedDate = null; if (tkrdpPrepDataRoboticPrepCompletedDate.SelectedDate.HasValue) newRoboticPrepCompletedDate = tkrdpPrepDataRoboticPrepCompletedDate.SelectedDate.Value;
            bool newP1Completed = ckbxPrepDataP1Completed.Checked;

            // ... WorkFullLengthLiningM1 data
            string newMeasurementsTakenBy = ""; if (tbxM1DataMeasurementsTakenBy.Text != "") newMeasurementsTakenBy = tbxM1DataMeasurementsTakenBy.Text.Trim();
            string newMaterial = ddlM1DataMaterial.SelectedValue;
            string newTrafficControl = ddlM1DataTrafficControl.SelectedValue;
            string newSiteDetails = ""; if (ddlM1DataSiteDetails.SelectedValue != "(Select)") newSiteDetails = ddlM1DataSiteDetails.SelectedValue;
            bool newPipeSizeChange = ckbxM1DataPipeSizeChange.Checked;
            bool newStandardByPass = ckbxM1DataStandardBypass.Checked;
            string newStandardBypassComments = ""; if (tbxM1DataStandardBypassComments.Text != "") newStandardBypassComments = tbxM1DataStandardBypassComments.Text.Trim();
            string newTrafficControlDetails = ""; if (tbxM1DataTrafficControlDetails.Text != "") newTrafficControlDetails = tbxM1DataTrafficControlDetails.Text.Trim();
            string newMeasurementType = ddlM1DataMeasurementType.SelectedValue;
            string newMeasuredFromMh = null; if (tbxM1DataMeasuredFromMh.Visible) newMeasuredFromMh = tbxM1DataMeasuredFromMh.Text; else newMeasuredFromMh = ddlM1DataMeasuredFromMh.SelectedValue;
            string newVideoDoneFromMh = ""; if (tbxM1DataVideoDoneFromMh.Visible) newVideoDoneFromMh = tbxM1DataVideoDoneFromMh.Text; else newVideoDoneFromMh = ddlM1DataVideoDoneFromMh.SelectedValue;
            string newVideoDoneToMh = ""; if (tbxM1DataVideoDoneToMh.Visible) newVideoDoneToMh = tbxM1DataVideoDoneToMh.Text; else newVideoDoneToMh = ddlM1DataVideoDoneToMh.SelectedValue;
            string newAccessType = ""; if (ddlM1DataAccessType.SelectedValue != "(Select)") newAccessType = ddlM1DataAccessType.SelectedValue;

            // ... ... For header values
            string newVideoLength = tbxVideoLength.Text.Trim();

            // ... WorkFullLengthLiningM2 data
            string newMeasurementTakenByM2 = tbxM2DataMeasurementsTakenBy.Text.Trim();
            bool newDropPipe = ckbxM2DataDropPipe.Checked;
            string newDropPipeInvertDepth = tbxM2DataDropPipeInvertdepth.Text.Trim();
            int? newCappedLaterals = null; if (tbxM2DataCappedLaterals.Text != "") newCappedLaterals = Int32.Parse(tbxM2DataCappedLaterals.Text.Trim());
            string newLineWidthId = ""; if (tbxM2DataLineWidthId.Text != "") newLineWidthId = tbxM2DataLineWidthId.Text.Trim();
            string newHydrantAddress = ""; if (tbxM2DataHydrantAddress.Text != "") newHydrantAddress = tbxM2DataHydrantAddress.Text.Trim();
            string newHydroWireWithin10FtOfInversionMH = ddlM2DataHydroWireWithin10FtOfInversionMh.SelectedValue.Trim();
            string newDistanceToInversionMH = ""; if (tbxM2DataDistanceToInversionMH.Text != "") newDistanceToInversionMH = tbxM2DataDistanceToInversionMH.Text.Trim();
            string newSurfaceGrade = ""; if (ddlM2DataSurfaceGrade.SelectedValue != "(Select)") newSurfaceGrade = ddlM2DataSurfaceGrade.SelectedValue;
            bool newHydroPulley = cbxM2DataHydroPulley.Checked;
            bool newFridgeCart = cbxM2DataFridgeCart.Checked;
            bool newTwoPump = cbxM2DataTwoPump.Checked;
            bool newSixBypass = cbxM2DataSixBypass.Checked;
            bool newScaffolding = cbxM2DataScaffolding.Checked;
            bool newWinchExtension = cbxM2DataWinchExtension.Checked;
            bool newExtraGenerator = cbxM2DataExtraGenerator.Checked;
            bool newGreyCableExtension = cbxM2DataGreyCableExtension.Checked;
            bool newEasementMats = cbxM2DataEasementMats.Checked;
            bool newRampsRequired = cbxM2DataRampsRequired.Checked;
            bool newCameraSkid = cbxM2DataCameraSkid.Checked;

            // ... Update work details
            FullLengthLiningWorkDetails fullLengthLiningWorkDetails = new FullLengthLiningWorkDetails(fullLengthLiningTDS);

            // ... ... If it doen's have wet out information and inversion information
            if ((!ckbxWetOutDataIncludeWetOutInformation.Checked) && (!ckbxInversionDataIncludeInversionInformation.Checked))
            {
                fullLengthLiningWorkDetails.Update(workId, newGeneralClientId, newGeneralProposedLiningDate, newGeneralDeadlineLiningDate, newGeneralP1Date, newGeneralM1Date, newGeneralM2Date, newGeneralInstallDate, newGeneralFinalVideo, newGeneralIssueIdentified, newGeneralLfsIssue, newGeneralClientIssue, newGeneralSalesIssue, newGeneralIssueGivenToClient, newGeneralIssueResolved, newGeneralIssueInvestigation, newPrepDataCXIsRemoved, newRoboticPrepCompleted, newRoboticPrepCompletedDate, newMeasurementsTakenBy, newMaterial, newTrafficControl, newSiteDetails, newPipeSizeChange, newStandardByPass, newStandardBypassComments, newTrafficControlDetails, newMeasurementType, newMeasuredFromMh, newVideoDoneFromMh, newVideoDoneToMh, newMeasurementTakenByM2, newDropPipe, newDropPipeInvertDepth, newCappedLaterals, newLineWidthId, newHydrantAddress, newHydroWireWithin10FtOfInversionMH, newDistanceToInversionMH, newSurfaceGrade, newHydroPulley, newFridgeCart, newTwoPump, newSixBypass, newScaffolding, newWinchExtension, newExtraGenerator, newGreyCableExtension, newEasementMats, newRampsRequired, newVideoLength, newPreFlushDate, newPreVideoDate, newCameraSkid, newAccessType, newP1Completed);
            }
            else
            {
                // Wet out data
                string newLinerTuber = "";
                int newResinId = 0;
                decimal newExcessResin = 0;
                string newPoundsDrums = "";
                decimal newDrumDiameter = 0;
                decimal newHoistMaximumHeight = 0;
                decimal newHoistMinimumHeight = 0;
                decimal newDownDropTubeLenght = 0;
                decimal newPumpHeightAboveGround = 0;
                int newTubeResinToFeltFactor = 0;
                DateTime newDateOfSheet = DateTime.Now;
                int newEmployeeID = 0;
                string newRunDetails = "";
                string newRunDetails2 = "";
                DateTime newWetOutDate = DateTime.Now;
                DateTime? newInstallDate = null;
                string newInversionThickness = "";
                Distance lengthToLine = new Distance("0");
                decimal newLengthToLine = 0;
                decimal newPlusExtra = 0;
                decimal newForTurnOffset = 0;
                decimal newLengthToWetOut = 0;

                decimal newTubeMaxColdHead = 0;
                decimal newTubeMaxColdHeadPsi = 0;
                decimal newTubeMaxHotHead = 0;
                decimal newTubeMaxHotHeadPsi = 0;
                decimal newTubeIdealHead = 0;
                decimal newTubeIdealHeadPsi = 0;

                decimal newNetResinForTube = 0;
                decimal newNetResinForTubeUsgals = 0;
                string newNetResinForTubeDrumsIns = "";
                decimal newNetResinForTubeLbsFt = 0;
                decimal newNetResinForTubeUsgFt = 0;

                int newExtraResinForMix = 0;
                decimal newExtraLbsForMix = 0;
                decimal newTotalMixQuantity = 0;
                decimal newTotalMixQuantityUsgals = 0;
                string newTotalMixQuantityDrumsIns = "";

                string newInversionType = "";
                decimal newDepthOfInversionMH = 0;
                decimal newTubeForColumn = 0;
                decimal newTubeForStartDry = 0;
                decimal newTotalTube = 0;
                string newDropTubeConnects = "";
                decimal newAllowsHeadTo = 0;
                decimal newRollerGap = 0;

                decimal newHeightNeeded = 0;
                string newAvailable = "";
                string newHoistHeight = "";
                string newCommentsCipp = "";

                string newResinLabel = "";
                string newDrumContainsLabel = "";
                string newLinerTubeLabel = "";
                string newForLbDrumsLabel = "";
                string newNetResinLabel = "";
                string newCatalystLabel = "";

                if (ckbxWetOutDataIncludeWetOutInformation.Checked)
                {
                    // .... ... Wet Out Sheet
                    newLinerTuber = ddlWetOutDataLinerTube.SelectedValue;
                    newResinId = Int32.Parse(ddlWetOutDataResins.SelectedValue);
                    newExcessResin = decimal.Round(decimal.Parse(tbxWetOutDataExcessResin.Text), 1);
                    newPoundsDrums = ddlWetOutDataPoundsDrums.SelectedValue;
                    newDrumDiameter = decimal.Round(decimal.Parse(tbxWetOutDataDrumDiameter.Text), 1);
                    newHoistMaximumHeight = decimal.Round(decimal.Parse(tbxWetOutDataHoistMaximumHeight.Text), 0);
                    newHoistMinimumHeight = decimal.Round(decimal.Parse(tbxWetOutDataHoistMinimumHeight.Text), 0);
                    newDownDropTubeLenght = decimal.Round(decimal.Parse(tbxWetOutDataDownDropTubeLength.Text), 0);
                    newPumpHeightAboveGround = decimal.Round(decimal.Parse(tbxWetOutDataPumpHeightAboveGround.Text), 2);
                    newTubeResinToFeltFactor = Int32.Parse(tbxWetOutDataTubeResinToFeltFactor.Text);

                    newDateOfSheet = DateTime.Parse(tbxWetOutDataDateOfSheet.Text);
                    newEmployeeID = Int32.Parse(ddlWetOutDataMadeBy.SelectedValue);

                    foreach (ListItem lst in cbxlSectionId.Items)
                    {
                        if (lst.Selected)
                        {
                            newRunDetails = newRunDetails + lst.Value + ">";
                        }
                    }
                    newRunDetails = newRunDetails.Substring(0, newRunDetails.Length - 1);

                    newRunDetails2 = ddlWetOutDataRunDetails2.SelectedValue;
                    newWetOutDate = (DateTime)tkrdpWetOutDataWetOutDate.SelectedDate;

                    if (tkrdpInstallDataInstallDate.SelectedDate.ToString() != "")
                    {
                        newInstallDate = (DateTime)tkrdpInstallDataInstallDate.SelectedDate;
                    }

                    newInversionThickness = ddlThickness.SelectedValue;
                    lengthToLine = new Distance(tbxWetOutDataLengthToLine.Text);
                    newLengthToLine = decimal.Round(decimal.Parse(lengthToLine.ToStringInEng3()), 1);
                    newPlusExtra = decimal.Round(decimal.Parse(tbxWetOutDataPlusExtra.Text), 0);
                    newForTurnOffset = decimal.Round(decimal.Parse(tbxWetOutDataForTurnOffset.Text), 0);
                    newLengthToWetOut = decimal.Round(decimal.Parse(tbxWetOutDataLengthtToWetOut.Text), 1);

                    newTubeMaxColdHead = decimal.Round(decimal.Parse(tbxWetOutDataTubeMaxColdHead.Text), 1);
                    newTubeMaxColdHeadPsi = decimal.Round(decimal.Parse(tbxWetOutDataTubeMaxColdHeadPSI.Text), 1);
                    newTubeMaxHotHead = decimal.Round(decimal.Parse(tbxWetOutDataTubeMaxHotHead.Text), 1);
                    newTubeMaxHotHeadPsi = decimal.Round(decimal.Parse(tbxWetOutDataTubeMaxHotHeadPSI.Text), 1);
                    newTubeIdealHead = decimal.Round(decimal.Parse(tbxWetOutDataTubeIdealHead.Text), 1);
                    newTubeIdealHeadPsi = decimal.Round(decimal.Parse(tbxWetOutDataTubeIdealHeadPSI.Text), 1);

                    newNetResinForTube = decimal.Round(decimal.Parse(tbxWetOutDataNetResinForTube.Text), 0);
                    newNetResinForTubeUsgals = decimal.Round(decimal.Parse(tbxWetOutDataNetResinForTubeUsgals.Text), 1);
                    newNetResinForTubeDrumsIns = tbxWetOutDataNetResinForTubeDrumsIns.Text;
                    newNetResinForTubeLbsFt = decimal.Round(decimal.Parse(tbxWetOutDataNetResinForTubeLbsFt.Text), 2);
                    newNetResinForTubeUsgFt = decimal.Round(decimal.Parse(tbxWetOutDataNetResinForTubeUsgFt.Text), 3);

                    newExtraResinForMix = Int32.Parse(tbxWetOutDataExtraResinForMix.Text);
                    newExtraLbsForMix = decimal.Round(decimal.Parse(tbxWetOutDataExtraLbsForMix.Text), 2);
                    newTotalMixQuantity = decimal.Round(decimal.Parse(tbxWetOutDataTotalMixQuantity.Text), 0);
                    newTotalMixQuantityUsgals = decimal.Round(decimal.Parse(tbxWetOutDataTotalMixQuantityUsgals.Text), 1);
                    newTotalMixQuantityDrumsIns = tbxWetOutDataTotalMixQuantityDrumsIns.Text;

                    newInversionType = ddlWetOutDataInversionType.SelectedValue;
                    newDepthOfInversionMH = decimal.Round(decimal.Parse(tbxWetOutDataDepthOfInversionMH.Text), 0);
                    newTubeForColumn = decimal.Round(decimal.Parse(tbxWetOutDataTubeForColumn.Text), 0);
                    newTubeForStartDry = decimal.Round(decimal.Parse(tbxWetOutDataTubeForStartDry.Text), 0);
                    newTotalTube = decimal.Round(decimal.Parse(tbxWetOutDataTotalTube.Text), 1);
                    newDropTubeConnects = tbxWetOutDataDropTubeConnects.Text;
                    newAllowsHeadTo = decimal.Round(decimal.Parse(tbxWetOutDataAllowsHeadTo.Text), 0);
                    newRollerGap = decimal.Round(decimal.Parse(tbxWetOutDataRollerGap.Text), 0);

                    newHeightNeeded = decimal.Round(decimal.Parse(tbxWetOutDataHeightNeeded.Text), 0);
                    newAvailable = tbxWetOutDataAvailable.Text;
                    newHoistHeight = tbxWetOutDataHoistHeight.Text;
                    newCommentsCipp = tbxWetOutDataNotes.Text;

                    newResinLabel = lblWetOutDataResinGray.Text;
                    newDrumContainsLabel = lblWetOutDataDrumContainsGray.Text;
                    newLinerTubeLabel = lblWetOutDataLinerTubeGray.Text;
                    newForLbDrumsLabel = lblWetOutDataLbDrumsGrey.Text;
                    newNetResinLabel = lblWetOutDataNetResinGrey.Text;
                    newCatalystLabel = lblWetOutDataCatalystGrey.Text;
                }

                // Inversion data
                string newInversionComment = "";
                string newPipeType = "";
                string newPipeCondition = "";
                string newGroundMoisture = "";
                decimal newBoilerSize = 0;
                decimal newPumpTotalCapacity = 0;
                decimal newLayFlatSize = 0;
                decimal newLayFlatQuantityTotal = 0;

                decimal newWaterStartTemp = 0;
                decimal newTemp1 = 0;
                decimal newHoldAtT1 = 0;
                decimal newTempT2 = 0;
                decimal newCookAtT2 = 0;
                decimal newCoolDownFor = 0;
                decimal newCoolToTemp = 0;
                decimal newDropInPipeRun = 0;
                decimal newPipeSlopOf = 0;

                decimal newF45F120 = 0;
                decimal newHold = 0;
                decimal newF120F185 = 0;
                decimal newCookTime = 0;
                decimal newCoolTime = 0;
                decimal newAproxTotal = 0;

                decimal newWaterChangesPerHour = 0;
                decimal newReturnWaterVelocity = 0;
                decimal newLayflatBackPressure = 0;
                decimal newPumpLiftAtIdealHead = 0;
                decimal newWaterToFillLinerColumn = 0;
                decimal newWaterPerFit = 0;
                string newInstallationResults = "";
                string newInversionLinerTubeLabel = "";
                string newHeadsIdealLabel = "";
                string newPumpingAndCirculationLabel = "";

                if ((ckbxInversionDataIncludeInversionInformation.Checked) && (ckbxWetOutDataIncludeWetOutInformation.Checked))
                {
                    // .... ... Inversion data
                    newInversionComment = tbxInversionDataCommentsEdit.Text;
                    newPipeType = ddlInversionDataInversionPipeType.SelectedValue;
                    newPipeCondition = ddlInversionDataPipeCondition.SelectedValue;
                    newGroundMoisture = ddlInversionDataGroundMoisture.SelectedValue;
                    newBoilerSize = decimal.Round(decimal.Parse(tbxInversionDataBoilerSize.Text), 0);
                    newPumpTotalCapacity = decimal.Round(decimal.Parse(tbxInversionDataPumpsTotalCapacity.Text), 0);
                    newLayFlatSize = decimal.Round(decimal.Parse(tbxInversionDataLayflatSize.Text), 0);
                    newLayFlatQuantityTotal = decimal.Round(decimal.Parse(tbxInversionDataLayflatQuantityTotal.Text), 0);

                    newWaterStartTemp = decimal.Round(decimal.Parse(tbxInversionDataWaterStartTempTs.Text), 0);
                    newTemp1 = decimal.Round(decimal.Parse(tbxInversionDataTempT1.Text), 0);
                    newHoldAtT1 = decimal.Round(decimal.Parse(tbxInversionDataHoldAtT1For.Text), 1);
                    newTempT2 = decimal.Round(decimal.Parse(tbxInversionDataTempT2.Text), 0);
                    newCookAtT2 = decimal.Round(decimal.Parse(tbxInversionDataCookAtT2For.Text), 0);
                    newCoolDownFor = decimal.Round(decimal.Parse(tbxInversionDataCoolDownFor.Text), 0);
                    newCoolToTemp = decimal.Round(decimal.Parse(tbxInversionDataCoolToTemp.Text), 0);
                    newDropInPipeRun = decimal.Round(decimal.Parse(tbxInversionDataDropInPipeRun.Text), 1);
                    newPipeSlopOf = decimal.Round(decimal.Parse(tbxInversionDataPipeSlopeOf.Text), 2);

                    newF45F120 = decimal.Round(decimal.Parse(tbxInversionData45F120F.Text), 1);
                    newHold = decimal.Round(decimal.Parse(tbxInversionDataHold.Text), 1);
                    newF120F185 = decimal.Round(decimal.Parse(tbxInversionData120F185F.Text), 1);
                    newCookTime = decimal.Round(decimal.Parse(tbxInversionDataCookTime.Text), 1);
                    newCoolTime = decimal.Round(decimal.Parse(tbxInversionDataCoolTime.Text), 1);
                    newAproxTotal = decimal.Round(decimal.Parse(tbxInversionDataAproxTotal.Text), 1);

                    newWaterChangesPerHour = decimal.Round(decimal.Parse(tbxInversionDataWaterChangesPerHour.Text), 2);
                    newReturnWaterVelocity = decimal.Round(decimal.Parse(tbxInversionDataReturnWaterVelocity.Text), 2);
                    newLayflatBackPressure = decimal.Round(decimal.Parse(tbxInversionDataLayflatBackPressure.Text), 1);
                    newPumpLiftAtIdealHead = decimal.Round(decimal.Parse(tbxInversionDataPumpLiftAtIdealHead.Text), 1);
                    newWaterToFillLinerColumn = decimal.Round(decimal.Parse(tbxInversionDataWaterToFillLinerColumn.Text), 0);
                    newWaterPerFit = decimal.Round(decimal.Parse(tbxInversionDataWaterPerFit.Text), 2);
                    newInstallationResults = tbxInversionDataNotesAndInstallationResults.Text;
                    newInversionLinerTubeLabel = lblInversionDataLinerInfoGrey.Text;
                    newHeadsIdealLabel = lblInversionDataHeadsGrey.Text;
                    newPumpingAndCirculationLabel = lblInversionDataPumpingCirculationSubtitle.Text;
                }

                // ... Update
                fullLengthLiningWorkDetails.UpdateWithWetOutInformation(workId, newGeneralClientId, newGeneralProposedLiningDate, newGeneralDeadlineLiningDate, newGeneralP1Date, newGeneralM1Date, newGeneralM2Date, newGeneralInstallDate, newGeneralFinalVideo, newGeneralIssueIdentified, newGeneralLfsIssue, newGeneralClientIssue, newGeneralSalesIssue, newGeneralIssueGivenToClient, newGeneralIssueResolved, newGeneralIssueInvestigation, newPrepDataCXIsRemoved, newRoboticPrepCompleted, newRoboticPrepCompletedDate, newMeasurementsTakenBy, newMaterial, newTrafficControl, newSiteDetails, newPipeSizeChange, newStandardByPass, newStandardBypassComments, newTrafficControlDetails, newMeasurementType, newMeasuredFromMh, newVideoDoneFromMh, newVideoDoneToMh, newMeasurementTakenByM2, newDropPipe, newDropPipeInvertDepth, newCappedLaterals, newLineWidthId, newHydrantAddress, newHydroWireWithin10FtOfInversionMH, newDistanceToInversionMH, newSurfaceGrade, newHydroPulley, newFridgeCart, newTwoPump, newSixBypass, newScaffolding, newWinchExtension, newExtraGenerator, newGreyCableExtension, newEasementMats, newRampsRequired, newVideoLength, newPreFlushDate, newPreVideoDate, newCameraSkid, newLinerTuber, newResinId, newExcessResin, newPoundsDrums, newDrumDiameter, newHoistMaximumHeight, newHoistMinimumHeight, newDownDropTubeLenght, newPumpHeightAboveGround, newTubeResinToFeltFactor, newDateOfSheet, newEmployeeID, newRunDetails, newRunDetails2, newWetOutDate, newInstallDate, newInversionThickness, newLengthToLine, newPlusExtra, newForTurnOffset, newLengthToWetOut, newTubeMaxColdHead, newTubeMaxColdHeadPsi, newTubeMaxHotHead, newTubeMaxHotHeadPsi, newTubeIdealHead, newTubeIdealHeadPsi, newNetResinForTube, newNetResinForTubeUsgals, newNetResinForTubeDrumsIns, newNetResinForTubeLbsFt, newNetResinForTubeUsgFt, newExtraResinForMix, newExtraLbsForMix, newTotalMixQuantity, newTotalMixQuantityUsgals, newTotalMixQuantityDrumsIns, newInversionType, newDepthOfInversionMH, newTubeForColumn, newTubeForStartDry, newTotalTube, newDropTubeConnects, newAllowsHeadTo, newRollerGap, newHeightNeeded, newAvailable, newHoistHeight, newCommentsCipp, newResinLabel, newDrumContainsLabel, newLinerTubeLabel, newForLbDrumsLabel, newNetResinLabel, newCatalystLabel, newInversionComment, newPipeType, newPipeCondition, newGroundMoisture, newBoilerSize, newPumpTotalCapacity, newLayFlatSize, newLayFlatQuantityTotal, newWaterStartTemp, newTemp1, newHoldAtT1, newTempT2, newCookAtT2, newCoolDownFor, newCoolToTemp, newDropInPipeRun, newPipeSlopOf, newF45F120, newHold, newF120F185, newCookTime, newCoolTime, newAproxTotal, newWaterChangesPerHour, newReturnWaterVelocity, newLayflatBackPressure, newPumpLiftAtIdealHead, newWaterToFillLinerColumn, newWaterPerFit, newInstallationResults, newInversionLinerTubeLabel, newHeadsIdealLabel, newPumpingAndCirculationLabel, newAccessType, newP1Completed);
            }

            if (ddlM1DataMaterial.SelectedIndex > 0)
            {
                LfsAssetSewerLateralGateway lfsAssetSewertLateralGateway = new LfsAssetSewerLateralGateway(null);
                if (!lfsAssetSewertLateralGateway.IsUsedInMaterials(assetId, newMaterial, companyId))
                {
                    MaterialInformation model = new MaterialInformation(materialInformationTDS);
                    model.Insert(assetId, newMaterial, DateTime.Now, false, companyId, false);
                }
            }

            // Store datasets
            Session["fullLengthLiningTDS"] = fullLengthLiningTDS;
            Session["materialInformationTDS"] = materialInformationTDS;

            ViewState["update"] = "no";
        }
コード例 #3
0
        protected void btnMixedShapeOnClick(object sender, EventArgs e)
        {
            Page.Validate("mrMixedShape");
            if (Page.IsValid)
            {
                if (ckbxRehabilitationDataImperial.Checked)
                {
                    Distance distanceMixedRoundDiameter = new Distance(tbxRehabilitationDataRoundDiameter.Text);
                    decimal roundDiameter = GetValueInEng3With2Decimals(distanceMixedRoundDiameter.ToStringInEng3());
                    tbxRehabilitationDataRoundDiameter.Text = roundDiameter.ToString();

                    Distance distanceMixedRoundDepth = new Distance(tbxRehabilitationDataRoundDepth.Text);
                    decimal roundDepth = GetValueInEng3With2Decimals(distanceMixedRoundDepth.ToStringInEng3());
                    tbxRehabilitationDataRoundDepth.Text = roundDepth.ToString();

                    Distance distanceMixedRectangleLongSid = new Distance(tbxRehabilitationDataRectangleLongSide.Text);
                    decimal rectangleLongSide = GetValueInEng3With2Decimals(distanceMixedRectangleLongSid.ToStringInEng3());
                    tbxRehabilitationDataRectangleLongSide.Text = rectangleLongSide.ToString();

                    Distance distanceMixedShortSide = new Distance(tbxRehabilitationDataRectangleShortSide.Text);
                    decimal rectangleShortSide = GetValueInEng3With2Decimals(distanceMixedShortSide.ToStringInEng3());
                    tbxRehabilitationDataRectangleShortSide.Text = rectangleShortSide.ToString();

                    Distance distanceMixedRectangleDepth = new Distance(tbxRehabilitationDataRectangleDepth.Text);
                    decimal rectangleDepth = GetValueInEng3With2Decimals(distanceMixedRectangleDepth.ToStringInEng3());
                    tbxRehabilitationDataRectangleDepth.Text = rectangleDepth.ToString();

                    decimal pi = Decimal.Round(decimal.Parse(Math.PI.ToString()), 4);
                    double radius = double.Parse(distanceMixedRoundDiameter.ToStringInEng3()) / 2;
                    decimal radiusSquare = decimal.Parse(Math.Pow(radius, 2).ToString());

                    // Recalculate Round Floor
                    decimal roundFloor = 0;
                    tbxRehabilitationDataRoundFloor.Text = "";
                    if (ckbxRehabilitationDataRoundFloor.Checked)
                    {
                        roundFloor = Decimal.Round(pi * (radiusSquare), 2);
                        Distance floorDistance = new Distance(roundFloor.ToString());
                        tbxRehabilitationDataRoundFloor.Text = floorDistance.ToStringInEng3();
                    }

                    // Recalculate Round Ceiling
                    decimal roundCeiling = 0;
                    tbxRehabilitationDataRoundCeiling.Text = "";
                    if (ckbxRehabilitationDataRoundCeiling.Checked)
                    {
                        roundCeiling = Decimal.Round(pi * (radiusSquare), 2);
                        Distance ceilingDistance = new Distance(roundCeiling.ToString());
                        tbxRehabilitationDataRoundCeiling.Text = ceilingDistance.ToStringInEng3(); ;

                        // Graphic
                        lblDataRoundCeilingLabel.Text = tbxRehabilitationDataRoundCeiling.Text;
                    }

                    // Recalculate Round Benching
                    decimal roundBenching = 0;
                    tbxRehabilitationDataRoundBenching.Text = "";
                    if (ckbxRehabilitationDataRoundBenching.Checked)
                    {
                        roundBenching = Decimal.Round((pi * (radiusSquare)) * decimal.Parse("0.06"), 2);
                        Distance benchingDistance = new Distance(roundBenching.ToString());
                        tbxRehabilitationDataRoundBenching.Text = benchingDistance.ToStringInEng3();
                    }

                    // Recalculate round surface area
                    decimal roundSurfaceArea = Decimal.Round((2 * pi * (decimal.Parse("0.5") * roundDiameter) * roundDepth), 2);
                    Distance roundSurfaceAreaDistance = new Distance(roundSurfaceArea.ToString());
                    tbxRehabilitationDataRoundSurfaceArea.Text = roundSurfaceAreaDistance.ToStringInEng3();

                    // Recalculate Rectangle floor
                    decimal rectangleFloor = 0;
                    tbxRehabilitationDataRectangleFloor.Text = "";
                    if (ckbxRehabilitationDataRectangleFloor.Checked)
                    {
                        rectangleFloor = Decimal.Round((rectangleLongSide * rectangleShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangleFloor.ToString());
                        tbxRehabilitationDataRectangleFloor.Text = ceilingDistance.ToStringInEng3();
                    }

                    // Recalculate Rectangle ceiling
                    decimal rectangleCeiling = 0;
                    tbxRehabilitationDataRectangleCeiling.Text = "";
                    if (ckbxRehabilitationDataRectangleCeiling.Checked)
                    {
                        rectangleCeiling = Decimal.Round((rectangleLongSide * rectangleShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangleCeiling.ToString());
                        tbxRehabilitationDataRectangleCeiling.Text = ceilingDistance.ToStringInEng3();

                        //Graphic
                        lblRectangleCeilingLabel.Text = tbxRehabilitationDataRectangleCeiling.Text;
                    }

                    // Recalculate Rectangle benching
                    decimal rectangleBenching = 0;
                    tbxRehabilitationDataRectangleBenching.Text = "";
                    if (ckbxRehabilitationDataRectangleBenching.Checked)
                    {
                        rectangleBenching = Decimal.Round(((rectangleLongSide * rectangleShortSide) * decimal.Parse("0.06")), 2);
                        Distance benchingDistance = new Distance(rectangleBenching.ToString());
                        tbxRehabilitationDataRectangleBenching.Text = benchingDistance.ToStringInEng3();
                    }

                    // Recalculate rectangle  surface area
                    decimal rectangleSurfaceArea = decimal.Round(((rectangleLongSide * 2) + (rectangleShortSide * 2)) * rectangleDepth, 2);
                    Distance rectangleSurfaceAreaDistance = new Distance(rectangleSurfaceArea.ToString());
                    tbxRehabilitationDataRectangleSufaceArea.Text = rectangleSurfaceAreaDistance.ToStringInEng3();

                    // Recalculte total depth
                    decimal totalDetph = decimal.Round((roundDepth + rectangleDepth), 0);
                    Distance totalDetphDistance = new Distance(totalDetph.ToString());
                    tbxRehabilitationDataMixedTotalDepth.Text = totalDetphDistance.ToStringInEng3();

                    // Recalculate total surface area
                    decimal totalSurfaceArea = decimal.Round(rectangleSurfaceArea + roundSurfaceArea + roundFloor + roundCeiling + roundBenching + rectangleFloor + rectangleCeiling + rectangleBenching, 0);
                    Distance totalSurfaceAreaDistance = new Distance(totalSurfaceArea.ToString());
                    tbxRehabilitationDataMixedTotalSurfaceArea.Text = totalSurfaceAreaDistance.ToStringInEng3();

                    // Graphic
                    lblDataRoundDiameterLabel.Text = tbxRehabilitationDataRoundDiameter.Text;
                    lblDataRoundDepthLabel.Text = tbxRehabilitationDataRoundDepth.Text;
                    lblDataRoundSurfaceAreaLabel.Text = tbxRehabilitationDataRoundSurfaceArea.Text;

                    lblRectangleLongSideLabel.Text = tbxRehabilitationDataRectangleLongSide.Text;
                    lblRectangleShortSideLabel.Text = tbxRehabilitationDataRectangleShortSide.Text;
                    lblRectangleDephtLabel.Text = tbxRehabilitationDataRectangleDepth.Text;
                    lblRectangleSurfaceAreaLabel.Text = tbxRehabilitationDataRectangleSufaceArea.Text;

                    lblMixedTotalDepthLabel.Text = tbxRehabilitationDataMixedTotalDepth.Text;
                    lblTotalMixedSurfaceAreaLabel.Text = "Total Surface Area: " + tbxRehabilitationDataMixedTotalSurfaceArea.Text;

                    // Recalculate Top total surface area
                    decimal roundTotalSurfaceArea = decimal.Round(roundSurfaceArea + roundFloor + roundCeiling + roundBenching, 2);
                    Distance roundTotalSurfaceAreaDistance = new Distance(roundTotalSurfaceArea.ToString());
                    tbxRehabilitationDataMixedRoundTotalSurfaceArea.Text = roundTotalSurfaceAreaDistance.ToStringInEng3();

                    // Recalculate Down total surface area
                    decimal mixesRectangleTotalSurfaceArea = decimal.Round(rectangleSurfaceArea + rectangleFloor + rectangleCeiling + rectangleBenching, 2);
                    Distance mixesRectangleTotalSurfaceAreaDistance = new Distance(mixesRectangleTotalSurfaceArea.ToString());
                    tbxRehabilitationDataMixedRectangleTotalSurfaceArea.Text = mixesRectangleTotalSurfaceAreaDistance.ToStringInEng3();
                }
                else
                {
                    Distance distanceMixedRoundDiameter = new Distance(tbxRehabilitationDataRoundDiameter.Text);
                    decimal roundDiameter = GetValueInEng3With2Decimals(distanceMixedRoundDiameter.ToStringInEng3());
                    tbxRehabilitationDataRoundDiameter.Text = distanceMixedRoundDiameter.ToStringInMet2();

                    Distance distanceMixedRoundDepth = new Distance(tbxRehabilitationDataRoundDepth.Text);
                    decimal roundDepth = GetValueInEng3With2Decimals(distanceMixedRoundDepth.ToStringInEng3());
                    tbxRehabilitationDataRoundDepth.Text = distanceMixedRoundDepth.ToStringInMet2();

                    Distance distanceMixedRectangleLongSid = new Distance(tbxRehabilitationDataRectangleLongSide.Text);
                    decimal rectangleLongSide = GetValueInEng3With2Decimals(distanceMixedRectangleLongSid.ToStringInEng3());
                    tbxRehabilitationDataRectangleLongSide.Text = distanceMixedRectangleLongSid.ToStringInMet2();

                    Distance distanceMixedShortSide = new Distance(tbxRehabilitationDataRectangleShortSide.Text);
                    decimal rectangleShortSide = GetValueInEng3With2Decimals(distanceMixedShortSide.ToStringInEng3());
                    tbxRehabilitationDataRectangleShortSide.Text = distanceMixedShortSide.ToStringInMet2();

                    Distance distanceMixedRectangleDepth = new Distance(tbxRehabilitationDataRectangleDepth.Text);
                    decimal rectangleDepth = decimal.Parse(distanceMixedRectangleDepth.ToStringInEng3());
                    tbxRehabilitationDataRectangleDepth.Text = distanceMixedRectangleDepth.ToStringInMet2();

                    decimal pi = Decimal.Round(decimal.Parse(Math.PI.ToString()), 4);
                    double radius = double.Parse(distanceMixedRoundDiameter.ToStringInEng3()) / 2;
                    decimal radiusSquare = decimal.Parse(Math.Pow(radius, 2).ToString());

                    // Recalculate Round Floor
                    decimal roundFloor = 0;
                    tbxRehabilitationDataRoundFloor.Text = "";
                    if (ckbxRehabilitationDataRoundFloor.Checked)
                    {
                        roundFloor = Decimal.Round(pi * (radiusSquare), 2);
                        Distance floorDistance = new Distance(roundFloor.ToString());
                        tbxRehabilitationDataRoundFloor.Text = floorDistance.ToStringInMet2();
                    }

                    // Recalculate Round Ceiling
                    decimal roundCeiling = 0;
                    tbxRehabilitationDataRoundCeiling.Text = "";
                    if (ckbxRehabilitationDataRoundCeiling.Checked)
                    {
                        roundCeiling = Decimal.Round(pi * (radiusSquare), 2);
                        Distance ceilingDistance = new Distance(roundCeiling.ToString());
                        tbxRehabilitationDataRoundCeiling.Text = ceilingDistance.ToStringInMet2(); ;

                        // Graphic
                        lblDataRoundCeilingLabel.Text = tbxRehabilitationDataRoundCeiling.Text;
                    }

                    // Recalculate Round Benching
                    decimal roundBenching = 0;
                    tbxRehabilitationDataRoundBenching.Text = "";
                    if (ckbxRehabilitationDataRoundBenching.Checked)
                    {
                        roundBenching = Decimal.Round((pi * (radiusSquare)) * decimal.Parse("0.06"), 2);
                        Distance benchingDistance = new Distance(roundBenching.ToString());
                        tbxRehabilitationDataRoundBenching.Text = benchingDistance.ToStringInMet2();
                    }

                    // Recalculate round surface area
                    decimal roundSurfaceArea = Decimal.Round((2 * pi * (decimal.Parse("0.5") * roundDiameter) * roundDepth), 2);
                    Distance roundSurfaceAreaDistance = new Distance(roundSurfaceArea.ToString());
                    tbxRehabilitationDataRoundSurfaceArea.Text = roundSurfaceAreaDistance.ToStringInMet2();

                    // Recalculate Rectangle floor
                    decimal rectangleFloor = 0;
                    tbxRehabilitationDataRectangleFloor.Text = "";
                    if (ckbxRehabilitationDataRectangleFloor.Checked)
                    {
                        rectangleFloor = Decimal.Round((rectangleLongSide * rectangleShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangleFloor.ToString());
                        tbxRehabilitationDataRectangleFloor.Text = ceilingDistance.ToStringInMet2();
                    }

                    // Recalculate Rectangle ceiling
                    decimal rectangleCeiling = 0;
                    tbxRehabilitationDataRectangleCeiling.Text = "";
                    if (ckbxRehabilitationDataRectangleCeiling.Checked)
                    {
                        rectangleCeiling = Decimal.Round((rectangleLongSide * rectangleShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangleCeiling.ToString());
                        tbxRehabilitationDataRectangleCeiling.Text = ceilingDistance.ToStringInMet2();

                        //Graphic
                        lblRectangleCeilingLabel.Text = tbxRehabilitationDataRectangleCeiling.Text;
                    }

                    // Recalculate Rectangle benching
                    decimal rectangleBenching = 0;
                    tbxRehabilitationDataRectangleBenching.Text = "";
                    if (ckbxRehabilitationDataRectangleBenching.Checked)
                    {
                        rectangleBenching = Decimal.Round(((rectangleLongSide * rectangleShortSide) * decimal.Parse("0.06")), 2);
                        Distance benchingDistance = new Distance(rectangleBenching.ToString());
                        tbxRehabilitationDataRectangleBenching.Text = benchingDistance.ToStringInMet2();
                    }

                    // Recalculate rectangle  surface area
                    decimal rectangleSurfaceArea = decimal.Round(((rectangleLongSide * 2) + (rectangleShortSide * 2)) * rectangleDepth, 2);
                    Distance rectangleSurfaceAreaDistance = new Distance(rectangleSurfaceArea.ToString());
                    tbxRehabilitationDataRectangleSufaceArea.Text = rectangleSurfaceAreaDistance.ToStringInMet2();

                    // Recalculte total depth
                    decimal totalDetph = decimal.Round((roundDepth + rectangleDepth), 0);
                    Distance totalDetphDistance = new Distance(totalDetph.ToString());
                    tbxRehabilitationDataMixedTotalDepth.Text = totalDetphDistance.ToStringInMet2();

                    // Recalculate total surface area
                    decimal totalSurfaceArea = decimal.Round(rectangleSurfaceArea + roundSurfaceArea + roundFloor + roundCeiling + roundBenching + rectangleFloor + rectangleCeiling + rectangleBenching, 0);
                    Distance totalSurfaceAreaDistance = new Distance(totalSurfaceArea.ToString());
                    tbxRehabilitationDataMixedTotalSurfaceArea.Text = totalSurfaceAreaDistance.ToStringInEng3();

                    // Graphic
                    lblDataRoundDiameterLabel.Text = tbxRehabilitationDataRoundDiameter.Text;
                    lblDataRoundDepthLabel.Text = tbxRehabilitationDataRoundDepth.Text;
                    lblDataRoundSurfaceAreaLabel.Text = tbxRehabilitationDataRoundSurfaceArea.Text;

                    lblRectangleLongSideLabel.Text = tbxRehabilitationDataRectangleLongSide.Text;
                    lblRectangleShortSideLabel.Text = tbxRehabilitationDataRectangleShortSide.Text;
                    lblRectangleDephtLabel.Text = tbxRehabilitationDataRectangleDepth.Text;
                    lblRectangleSurfaceAreaLabel.Text = tbxRehabilitationDataRectangleSufaceArea.Text;

                    lblMixedTotalDepthLabel.Text = tbxRehabilitationDataMixedTotalDepth.Text;
                    lblTotalMixedSurfaceAreaLabel.Text = "Total Surface Area: " + tbxRehabilitationDataMixedTotalSurfaceArea.Text;

                    // Recalculate Top total surface area
                    decimal roundTotalSurfaceArea = decimal.Round(roundSurfaceArea + roundFloor + roundCeiling + roundBenching, 2);
                    Distance roundTotalSurfaceAreaDistance = new Distance(roundTotalSurfaceArea.ToString());
                    tbxRehabilitationDataMixedRoundTotalSurfaceArea.Text = roundTotalSurfaceAreaDistance.ToStringInEng3();

                    // Recalculate Down total surface area
                    decimal mixesRectangleTotalSurfaceArea = decimal.Round(rectangleSurfaceArea + rectangleFloor + rectangleCeiling + rectangleBenching, 2);
                    Distance mixesRectangleTotalSurfaceAreaDistance = new Distance(mixesRectangleTotalSurfaceArea.ToString());
                    tbxRehabilitationDataMixedRectangleTotalSurfaceArea.Text = mixesRectangleTotalSurfaceAreaDistance.ToStringInEng3();
                }
            }
        }
コード例 #4
0
 protected void ddlWetOutDataInversionType_SelectedIndexChanged(object sender, EventArgs e)
 {
     tbxWetOutDataDepthOfInversionMH.Text = "0";
     if (tbxM1DataUsmhDepth.Text != "")
     {
         if (ddlWetOutDataInversionType.SelectedValue == "Top")
         {
             Distance usmhDepthDistance = new Distance(tbxM1DataUsmhDepth.Text);
             tbxWetOutDataDepthOfInversionMH.Text = decimal.Round(decimal.Parse(usmhDepthDistance.ToStringInEng3()),1).ToString();
         }
         else
         {
             if (ddlWetOutDataInversionType.SelectedValue == "Bottom")
             {
                 Distance dsmhDepthDistance = new Distance(tbxM1DataDsmhDepth.Text);
                 tbxWetOutDataDepthOfInversionMH.Text = decimal.Round(decimal.Parse(dsmhDepthDistance.ToStringInEng3()), 1).ToString();
             }
         }
     }
 }
コード例 #5
0
        protected void btnRectangularShapeOnClick(object sender, EventArgs e)
        {
            Page.Validate("mrRectangularShape");
            if (Page.IsValid)
            {
                if (ckbxRehabilitationDataImperial.Checked)
                {
                    Distance distanceRectangularRectangle1LongSide = new Distance(tbxRehabilitationDataRectangle1LongSide.Text);
                    decimal rectangle1LongSide = GetValueInEng3With2Decimals(distanceRectangularRectangle1LongSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle1LongSide.Text = rectangle1LongSide.ToString();

                    Distance distanceRectangularRectangle1ShortSide = new Distance(tbxRehabilitationDataRectangle1ShortSide.Text);
                    decimal rectangle1ShortSide = GetValueInEng3With2Decimals(distanceRectangularRectangle1ShortSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle1ShortSide.Text = rectangle1ShortSide.ToString();

                    Distance distanceRectangularRectangle1Depth = new Distance(tbxRehabilitationDataRectangle1Depth.Text);
                    decimal rectangle1Depth = GetValueInEng3With2Decimals(distanceRectangularRectangle1Depth.ToStringInEng3());
                    tbxRehabilitationDataRectangle1Depth.Text = rectangle1Depth.ToString();

                    Distance distanceRectangularRectangle2LongSide = new Distance(tbxRehabilitationDataRectangle2LongSide.Text);
                    decimal rectangle2LongSide = GetValueInEng3With2Decimals(distanceRectangularRectangle2LongSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle2LongSide.Text = rectangle2LongSide.ToString();

                    Distance distanceRectangularRectangle2ShortSide = new Distance(tbxRehabilitationDataRectangle2ShortSide.Text);
                    decimal rectangle2ShortSide = GetValueInEng3With2Decimals(distanceRectangularRectangle2ShortSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle2ShortSide.Text = rectangle2ShortSide.ToString();

                    Distance distanceRectangularRectangle2Depth = new Distance(tbxRehabilitationDataRectangle2Depth.Text);
                    decimal rectangle2Depth = GetValueInEng3With2Decimals(distanceRectangularRectangle2Depth.ToStringInEng3());
                    tbxRehabilitationDataRectangle2Depth.Text = rectangle2Depth.ToString();

                    // Recalculate Rectangle1 floor
                    decimal rectangle1Floor = 0;
                    tbxRehabilitationDataRectangle1Floor.Text = "";
                    if (ckbxRehabilitationDataRectangle1Floor.Checked)
                    {
                        rectangle1Floor = Decimal.Round((rectangle1LongSide * rectangle1ShortSide), 2);
                        Distance floorDistance = new Distance(rectangle1Floor.ToString());
                        tbxRehabilitationDataRectangle1Floor.Text = floorDistance.ToStringInEng3();
                    }

                    // Recalculate Rectangle1 ceiling
                    decimal rectangle1Ceiling = 0;
                    tbxRehabilitationDataRectangle1Ceiling.Text = "";
                    if (ckbxRehabilitationDataRectangle1Ceiling.Checked)
                    {
                        rectangle1Ceiling = Decimal.Round((rectangle1LongSide * rectangle1ShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangle1Ceiling.ToString());
                        tbxRehabilitationDataRectangle1Ceiling.Text = ceilingDistance.ToStringInEng3();

                        //Graphic
                        lblRectangular1CeilingLabel.Text = tbxRehabilitationDataRectangle1Ceiling.Text;
                    }

                    // Recalculate Rectangle1 benching
                    decimal rectangle1Benching = 0;
                    tbxRehabilitationDataRectangle1Benching.Text = "";
                    if (ckbxRehabilitationDataRectangle1Benching.Checked)
                    {
                        rectangle1Benching = Decimal.Round(((rectangle1LongSide * rectangle1ShortSide) * decimal.Parse("0.06")), 2);
                        Distance benchingDistance = new Distance(rectangle1Benching.ToString());
                        tbxRehabilitationDataRectangle1Benching.Text = benchingDistance.ToStringInEng3();
                    }

                    // Recalculate rectangle 1 surface area
                    decimal rectangle1SurfaceArea = decimal.Round(((rectangle1LongSide * 2) + (rectangle1ShortSide * 2)) * rectangle1Depth, 2);
                    Distance rectangle1SurfaceAreaDistance = new Distance(rectangle1SurfaceArea.ToString());
                    tbxRehabilitationDataRectangle1SurfaceArea.Text = rectangle1SurfaceAreaDistance.ToStringInEng3();

                    // Recalculate Rectangle2 floor
                    decimal rectangle2Floor = 0;
                    tbxRehabilitationDataRectangle2Floor.Text = "";
                    if (ckbxRehabilitationDataRectangle2Floor.Checked)
                    {
                        rectangle2Floor = Decimal.Round((rectangle2LongSide * rectangle2ShortSide), 2);
                        Distance floorDistance = new Distance(rectangle2Floor.ToString());
                        tbxRehabilitationDataRectangle2Floor.Text = floorDistance.ToStringInEng3();
                    }

                    // Recalculate Rectangle2 ceiling
                    decimal rectangle2Ceiling = 0;
                    tbxRehabilitationDataRectangle2Ceiling.Text = "";
                    if (ckbxRehabilitationDataRectangle2Ceiling.Checked)
                    {
                        rectangle2Ceiling = Decimal.Round((rectangle2LongSide * rectangle2ShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangle2Ceiling.ToString());
                        tbxRehabilitationDataRectangle2Ceiling.Text = ceilingDistance.ToStringInEng3();

                        //Graphic
                        lblRectangular2CeilingLabel.Text = tbxRehabilitationDataRectangle2Ceiling.Text;
                    }

                    // Recalculate Rectangle2 benching
                    decimal rectangle2Benching = 0;
                    tbxRehabilitationDataRectangle2Benching.Text = "";
                    if (ckbxRehabilitationDataRectangle2Benching.Checked)
                    {
                        rectangle2Benching = Decimal.Round(((rectangle2LongSide * rectangle2ShortSide) * decimal.Parse("0.06")), 2);
                        Distance benchingDistance = new Distance(rectangle2Benching.ToString());
                        tbxRehabilitationDataRectangle2Benching.Text = benchingDistance.ToStringInEng3();
                    }

                    // Recalculate rectangle 2 surface area
                    decimal rectangle2SurfaceArea = decimal.Round(((rectangle2LongSide * 2) + (rectangle2ShortSide * 2)) * rectangle2Depth, 2);
                    Distance rectangle2SurfaceAreaDistance = new Distance(rectangle2SurfaceArea.ToString());
                    tbxRehabilitationDataRectangle2SurfaceArea.Text = rectangle2SurfaceAreaDistance.ToStringInEng3();

                    // Recalculate total depth
                    decimal totalDepth = decimal.Round(rectangle1Depth + rectangle2Depth, 0);
                    Distance totalDepthDistance = new Distance(totalDepth.ToString());
                    tbxRehabilitationDataRectangularTotalDepth.Text = totalDepthDistance.ToStringInEng3();

                    // Recalculate rectangle total surface area
                    decimal totalSurfaceArea = decimal.Round(rectangle1SurfaceArea + rectangle2SurfaceArea + rectangle1Floor + rectangle1Ceiling + rectangle1Benching + rectangle2Floor + rectangle2Ceiling + rectangle2Benching, 0);
                    Distance totalSurfaceAreaDistance = new Distance(totalSurfaceArea.ToString());
                    tbxRehabilitationDataRectangularTotalSurfaceArea.Text = totalSurfaceAreaDistance.ToStringInEng3();

                    // Graphic
                    lblRectangular1LongSideLabel.Text = tbxRehabilitationDataRectangle1LongSide.Text;
                    lblRectangular1ShortSideLabel.Text = tbxRehabilitationDataRectangle1ShortSide.Text;
                    lblRectangular1DephtLabel.Text = tbxRehabilitationDataRectangle1Depth.Text;
                    lblRectangle1SurfaceAreaLabel.Text = tbxRehabilitationDataRectangle1SurfaceArea.Text;

                    lblRectangle2LongSideLabel.Text = tbxRehabilitationDataRectangle2LongSide.Text;
                    lblRectangular2ShortSideLabel.Text = tbxRehabilitationDataRectangle2ShortSide.Text;
                    lblRectangular2Depth.Text = tbxRehabilitationDataRectangle2Depth.Text;
                    lblRectangle2SurfaceAreaLabel.Text = tbxRehabilitationDataRectangle2SurfaceArea.Text;

                    lblRectangularTotalDepthLabel.Text = tbxRehabilitationDataRectangularTotalDepth.Text;
                    lblRectangularTotalSurfaceAreaLabel.Text = "Total Surface Area: " + tbxRehabilitationDataRectangularTotalSurfaceArea.Text;

                    // Recalculate Top total surface area
                    decimal rectangle1TotalSurfaceArea = decimal.Round(rectangle1SurfaceArea + rectangle1Floor + rectangle1Ceiling + rectangle1Benching, 2);
                    Distance rectangle1TotalSurfaceAreaDistance = new Distance(rectangle1TotalSurfaceArea.ToString());
                    tbxRehabilitationDataRectangle1TotalSurfaceArea.Text = rectangle1TotalSurfaceAreaDistance.ToStringInEng3();

                    // Recalculate Down total surface area
                    decimal rectangle2TotalSurfaceArea = decimal.Round(rectangle2SurfaceArea + rectangle2Floor + rectangle2Ceiling + rectangle2Benching, 2);
                    Distance rectangle2TotalSurfaceAreaDistance = new Distance(rectangle2TotalSurfaceArea.ToString());
                    tbxRehabilitationDataRectangle2TotalSurfaceArea.Text = rectangle2TotalSurfaceAreaDistance.ToStringInEng3();
                }
                else
                {
                    Distance distanceRectangularRectangle1LongSide = new Distance(tbxRehabilitationDataRectangle1LongSide.Text);
                    decimal rectangle1LongSide = GetValueInEng3With2Decimals(distanceRectangularRectangle1LongSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle1LongSide.Text = distanceRectangularRectangle1LongSide.ToStringInMet2();

                    Distance distanceRectangularRectangle1ShortSide = new Distance(tbxRehabilitationDataRectangle1ShortSide.Text);
                    decimal rectangle1ShortSide = GetValueInEng3With2Decimals(distanceRectangularRectangle1ShortSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle1ShortSide.Text = distanceRectangularRectangle1ShortSide.ToStringInMet2();

                    Distance distanceRectangularRectangle1Depth = new Distance(tbxRehabilitationDataRectangle1Depth.Text);
                    decimal rectangle1Depth = GetValueInEng3With2Decimals(distanceRectangularRectangle1Depth.ToStringInEng3());
                    tbxRehabilitationDataRectangle1Depth.Text = distanceRectangularRectangle1Depth.ToStringInMet2();

                    Distance distanceRectangularRectangle2LongSide = new Distance(tbxRehabilitationDataRectangle2LongSide.Text);
                    decimal rectangle2LongSide = GetValueInEng3With2Decimals(distanceRectangularRectangle2LongSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle2LongSide.Text = distanceRectangularRectangle2LongSide.ToStringInMet2();

                    Distance distanceRectangularRectangle2ShortSide = new Distance(tbxRehabilitationDataRectangle2ShortSide.Text);
                    decimal rectangle2ShortSide = GetValueInEng3With2Decimals(distanceRectangularRectangle2ShortSide.ToStringInEng3());
                    tbxRehabilitationDataRectangle2ShortSide.Text = distanceRectangularRectangle2ShortSide.ToStringInMet2();

                    Distance distanceRectangularRectangle2Depth = new Distance(tbxRehabilitationDataRectangle2Depth.Text);
                    decimal rectangle2Depth = GetValueInEng3With2Decimals(distanceRectangularRectangle2Depth.ToStringInEng3());
                    tbxRehabilitationDataRectangle2Depth.Text = distanceRectangularRectangle2Depth.ToStringInMet2();

                    // Recalculate Rectangle1 floor
                    decimal rectangle1Floor = 0;
                    tbxRehabilitationDataRectangle1Floor.Text = "";
                    if (ckbxRehabilitationDataRectangle1Floor.Checked)
                    {
                        rectangle1Floor = Decimal.Round((rectangle1LongSide * rectangle1ShortSide), 2);
                        Distance floorDistance = new Distance(rectangle1Floor.ToString());
                        tbxRehabilitationDataRectangle1Floor.Text = floorDistance.ToStringInMet2();
                    }

                    // Recalculate Rectangle1 ceiling
                    decimal rectangle1Ceiling = 0;
                    tbxRehabilitationDataRectangle1Ceiling.Text = "";
                    if (ckbxRehabilitationDataRectangle1Ceiling.Checked)
                    {
                        rectangle1Ceiling = Decimal.Round((rectangle1LongSide * rectangle1ShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangle1Ceiling.ToString());
                        tbxRehabilitationDataRectangle1Ceiling.Text = ceilingDistance.ToStringInMet2();

                        //Graphic
                        lblRectangular1CeilingLabel.Text = tbxRehabilitationDataRectangle1Ceiling.Text;
                    }

                    // Recalculate Rectangle1 benching
                    decimal rectangle1Benching = 0;
                    tbxRehabilitationDataRectangle1Benching.Text = "";
                    if (ckbxRehabilitationDataRectangle1Benching.Checked)
                    {
                        rectangle1Benching = Decimal.Round(((rectangle1LongSide * rectangle1ShortSide) * decimal.Parse("0.06")), 2);
                        Distance benchingDistance = new Distance(rectangle1Benching.ToString());
                        tbxRehabilitationDataRectangle1Benching.Text = benchingDistance.ToStringInMet2();
                    }

                    // Recalculate rectangle 1 surface area
                    decimal rectangle1SurfaceArea = decimal.Round(((rectangle1LongSide * 2) + (rectangle1ShortSide * 2)) * rectangle1Depth, 2);
                    Distance rectangle1SurfaceAreaDistance = new Distance(rectangle1SurfaceArea.ToString());
                    tbxRehabilitationDataRectangle1SurfaceArea.Text = rectangle1SurfaceAreaDistance.ToStringInMet2();

                    // Recalculate Rectangle2 floor
                    decimal rectangle2Floor = 0;
                    tbxRehabilitationDataRectangle2Floor.Text = "";
                    if (ckbxRehabilitationDataRectangle2Floor.Checked)
                    {
                        rectangle2Floor  = Decimal.Round((rectangle2LongSide * rectangle2ShortSide), 2);
                        Distance floorDistance = new Distance(rectangle2Floor.ToString());
                        tbxRehabilitationDataRectangle2Floor.Text = floorDistance.ToStringInMet2();

                    }

                    // Recalculate Rectangle2 ceiling
                    decimal rectangle2Ceiling = 0;
                    tbxRehabilitationDataRectangle2Ceiling.Text = "";
                    if (ckbxRehabilitationDataRectangle2Ceiling.Checked)
                    {
                        rectangle2Ceiling = Decimal.Round((rectangle2LongSide * rectangle2ShortSide), 2);
                        Distance ceilingDistance = new Distance(rectangle2Ceiling.ToString());
                        tbxRehabilitationDataRectangle2Ceiling.Text = ceilingDistance.ToStringInMet2();

                        //Graphic
                        lblRectangular2CeilingLabel.Text = tbxRehabilitationDataRectangle2Ceiling.Text;
                    }

                    // Recalculate Rectangle2 benching
                    decimal rectangle2Benching = 0;
                    tbxRehabilitationDataRectangle2Benching.Text = "";
                    if (ckbxRehabilitationDataRectangle2Benching.Checked)
                    {
                        rectangle2Benching = Decimal.Round(((rectangle2LongSide * rectangle2ShortSide) * decimal.Parse("0.06")), 2);
                        Distance benchingDistance = new Distance(rectangle2Benching.ToString());
                        tbxRehabilitationDataRectangle2Benching.Text = benchingDistance.ToStringInMet2();
                    }

                    // Recalculate rectangle 2 surface area
                    decimal rectangle2SurfaceArea = decimal.Round(((rectangle2LongSide * 2) + (rectangle2ShortSide * 2)) * rectangle2Depth, 2);
                    Distance rectangle2SurfaceAreaDistance = new Distance(rectangle2SurfaceArea.ToString());
                    tbxRehabilitationDataRectangle2SurfaceArea.Text = rectangle2SurfaceAreaDistance.ToStringInMet2();

                    // Recalculate total depth
                    decimal totalDepth = decimal.Round(rectangle1Depth + rectangle2Depth, 0);
                    Distance totalDepthDistance = new Distance(totalDepth.ToString());
                    tbxRehabilitationDataRectangularTotalDepth.Text = totalDepthDistance.ToStringInMet2();

                    // Recalculate rectangle total surface area
                    decimal totalSurfaceArea = decimal.Round(rectangle1SurfaceArea + rectangle2SurfaceArea + rectangle1Floor + rectangle1Ceiling + rectangle1Benching + rectangle2Floor + rectangle2Ceiling + rectangle2Benching, 0);
                    Distance totalSurfaceAreaDistance = new Distance(totalSurfaceArea.ToString());
                    tbxRehabilitationDataRectangularTotalSurfaceArea.Text = totalSurfaceAreaDistance.ToStringInEng3();

                    // Graphic
                    lblRectangular1LongSideLabel.Text = tbxRehabilitationDataRectangle1LongSide.Text;
                    lblRectangular1ShortSideLabel.Text = tbxRehabilitationDataRectangle1ShortSide.Text;
                    lblRectangular1DephtLabel.Text = tbxRehabilitationDataRectangle1Depth.Text;
                    lblRectangle1SurfaceAreaLabel.Text = tbxRehabilitationDataRectangle1SurfaceArea.Text;

                    lblRectangle2LongSideLabel.Text = tbxRehabilitationDataRectangle2LongSide.Text;
                    lblRectangular2ShortSideLabel.Text = tbxRehabilitationDataRectangle2ShortSide.Text;
                    lblRectangular2Depth.Text = tbxRehabilitationDataRectangle2Depth.Text;
                    lblRectangle2SurfaceAreaLabel.Text = tbxRehabilitationDataRectangle2SurfaceArea.Text;

                    lblRectangularTotalDepthLabel.Text = tbxRehabilitationDataRectangularTotalDepth.Text;
                    lblRectangularTotalSurfaceAreaLabel.Text = "Total Surface Area: " + tbxRehabilitationDataRectangularTotalSurfaceArea.Text;

                    // Recalculate Top total surface area
                    decimal rectangle1TotalSurfaceArea = decimal.Round(rectangle1SurfaceArea + rectangle1Floor + rectangle1Ceiling + rectangle1Benching, 2);
                    Distance rectangle1TotalSurfaceAreaDistance = new Distance(rectangle1TotalSurfaceArea.ToString());
                    tbxRehabilitationDataRectangle1TotalSurfaceArea.Text = rectangle1TotalSurfaceAreaDistance.ToStringInEng3();

                    // Recalculate Down total surface area
                    decimal rectangle2TotalSurfaceArea = decimal.Round(rectangle2SurfaceArea + rectangle2Floor + rectangle2Ceiling + rectangle2Benching, 2);
                    Distance rectangle2TotalSurfaceAreaDistance = new Distance(rectangle2TotalSurfaceArea.ToString());
                    tbxRehabilitationDataRectangle2TotalSurfaceArea.Text = rectangle2TotalSurfaceAreaDistance.ToStringInEng3();
                }
            }
        }
コード例 #6
0
        protected void btnRoundShapeOnClick(object sender, EventArgs e)
        {
            Page.Validate("mrRoundShape");
            if (Page.IsValid)
            {
                if (ckbxRehabilitationDataImperial.Checked)
                {
                    Distance distanceRoundChimneyDiameter = new Distance(tbxRehabilitationDataChimneyDiameter.Text);
                    decimal chimneyDiameter = GetValueInEng3With2Decimals(distanceRoundChimneyDiameter.ToStringInEng3());
                    tbxRehabilitationDataChimneyDiameter.Text = chimneyDiameter.ToString();

                    Distance distanceRoundChimneyDepth = new Distance(tbxRehabilitationDataChimneyDepth.Text);
                    decimal chimneyDepth = GetValueInEng3With2Decimals(distanceRoundChimneyDepth.ToStringInEng3());
                    tbxRehabilitationDataChimneyDepth.Text = chimneyDepth.ToString();

                    Distance distanceRoundBarrelDiameter = new Distance(tbxRehabilitationDataBarrelDiameter.Text);
                    decimal barrelDiameter = GetValueInEng3With2Decimals(distanceRoundBarrelDiameter.ToStringInEng3());
                    tbxRehabilitationDataBarrelDiameter.Text = barrelDiameter.ToString();

                    Distance distanceRoundBarrelDepth = new Distance(tbxRehabilitationDataBarrelDepth.Text);
                    decimal barrelDepth = GetValueInEng3With2Decimals(distanceRoundBarrelDepth.ToStringInEng3());
                    tbxRehabilitationDataBarrelDepth.Text = barrelDepth.ToString();

                    decimal pi = Decimal.Round(decimal.Parse(Math.PI.ToString()), 4);
                    double chimneyRadius = double.Parse(distanceRoundChimneyDiameter.ToStringInEng3()) / 2;
                    decimal chimneyRadiusSquare = decimal.Parse(Math.Pow(chimneyRadius, 2).ToString());
                    double barrelRadius = double.Parse(distanceRoundBarrelDiameter.ToStringInEng3()) / 2;
                    decimal barrelRadiusSquare = decimal.Parse(Math.Pow(barrelRadius, 2).ToString());

                    // Recalculate chimmney Floor
                    decimal chimneyFloor = 0;
                    tbxRehabilitationDataChimneyFloor.Text = "";
                    if (ckbxRehabilitationDataChimneyFloor.Checked)
                    {
                        chimneyFloor = Decimal.Round(pi * (chimneyRadiusSquare), 2);
                        Distance floorDistance = new Distance(chimneyFloor.ToString());
                        tbxRehabilitationDataChimneyFloor.Text = floorDistance.ToStringInEng3();
                    }

                    // Recalculate Chimney Ceiling
                    decimal chimneyCeiling = 0;
                    tbxRehabilitationDataChimneyCeiling.Text = "";
                    if (ckbxRehabilitationDataChimneyCeiling.Checked)
                    {
                        chimneyCeiling = Decimal.Round(pi * (chimneyRadiusSquare), 2);
                        Distance ceilingDistance = new Distance(chimneyCeiling.ToString());
                        tbxRehabilitationDataChimneyCeiling.Text = ceilingDistance.ToStringInEng3();

                        //Graphic
                        lblRoudChimneyCeilingLabel.Text = tbxRehabilitationDataChimneyCeiling.Text;
                    }

                    // Recalculate chimney Benching
                    decimal chimneyBenching = 0;
                    tbxRehabilitationDataChimneyBenching.Text = "";
                    if (ckbxRehabilitationDataChimneyBenching.Checked)
                    {
                        chimneyBenching = Decimal.Round((pi * (chimneyRadiusSquare)) * decimal.Parse("0.06"), 2);
                        Distance benchingDistance = new Distance(chimneyBenching.ToString());
                        tbxRehabilitationDataChimneyBenching.Text = benchingDistance.ToStringInEng3();
                    }

                    // Recalculate chimney surface area
                    decimal chimneyArea = Decimal.Round((2 * pi * (decimal.Parse("0.5") * chimneyDiameter) * chimneyDepth), 2);
                    Distance chimneyAreaDistance = new Distance(chimneyArea.ToString());
                    tbxRehabilitationDataChimneySurfaceArea.Text = chimneyAreaDistance.ToStringInEng3();

                    // Recalculate Barrel Floor
                    decimal barrelFloor = 0;
                    tbxRehabilitationDataBarrelFloor.Text = "";

                    if (ckbxRehabilitationDataBarrelFloor.Checked)
                    {
                        barrelFloor = Decimal.Round(pi * (barrelRadiusSquare), 2);
                        Distance floorDistance = new Distance(barrelFloor.ToString());
                        tbxRehabilitationDataBarrelFloor.Text = floorDistance.ToStringInEng3();
                    }

                    // Recalculate Barrel Ceiling
                    decimal barrelCeiling = 0;
                    tbxRehabilitationDataBarrelCeiling.Text = "";
                    if (ckbxRehabilitationDataBarrelCeiling.Checked)
                    {
                        barrelCeiling = Decimal.Round(pi * (barrelRadiusSquare), 2);
                        Distance ceilingDistance = new Distance(barrelCeiling.ToString());
                        tbxRehabilitationDataBarrelCeiling.Text = ceilingDistance.ToStringInEng3();

                        // Graphic
                        lblRoundBarrelCeilingLabel.Text = tbxRehabilitationDataBarrelCeiling.Text;
                    }

                    // Recalculate Barrel Benching
                    decimal barrelBenching = 0;
                    tbxRehabilitationDataBarrelBenching.Text = "";
                    if (ckbxRehabilitationDataBarrelBenching.Checked)
                    {
                        barrelBenching = Decimal.Round((pi * (barrelRadiusSquare)) * decimal.Parse("0.06"), 2);
                        Distance benchingDistance = new Distance(barrelBenching.ToString());
                        tbxRehabilitationDataBarrelBenching.Text = benchingDistance.ToStringInEng3();
                    }

                    // Recalculate Barrel surface area
                    decimal barrelArea = Decimal.Round((2 * pi * (decimal.Parse("0.5") * barrelDiameter) * barrelDepth), 2);
                    Distance barrelAreaDistance = new Distance(barrelArea.ToString());
                    tbxRehabilitationDataBarrelSurfaceArea.Text = barrelAreaDistance.ToStringInEng3();

                    // Recalculte total depth
                    decimal totalDepth = decimal.Round(chimneyDepth + barrelDepth, 0);
                    Distance totalDepthDistance = new Distance(totalDepth.ToString());
                    tbxRehabilitationDataRoundTotalDepth.Text = totalDepthDistance.ToStringInEng3();

                    // Recalculate total surface area
                    decimal totalSurfaceArea = decimal.Round((chimneyArea + barrelArea + chimneyFloor + chimneyCeiling + chimneyBenching + barrelFloor + barrelCeiling + barrelBenching), 0);
                    Distance totalSurfaceAreaDistance = new Distance(totalSurfaceArea.ToString());
                    tbxRehabilitationDataRoundTotalSurfaceArea.Text = totalSurfaceAreaDistance.ToStringInEng3();

                    // For Graphic
                    lblRoudChimneyDiameterLabel.Text = tbxRehabilitationDataChimneyDiameter.Text;
                    lblRoudChimneyDepthLabel.Text = tbxRehabilitationDataChimneyDepth.Text;
                    lblRoundChimneySurfaceAreaLabel.Text = tbxRehabilitationDataChimneySurfaceArea.Text;

                    lblRoudBarrelDiameterLabel.Text = tbxRehabilitationDataBarrelDiameter.Text;
                    lblRoudBarrelDepthLabel.Text = tbxRehabilitationDataBarrelDepth.Text;
                    lblRoundBarrelSurfaceAreaLabel.Text = tbxRehabilitationDataBarrelSurfaceArea.Text;

                    lblRoundTotalDepthLabel.Text = tbxRehabilitationDataRoundTotalDepth.Text;
                    lblRoundTotalSurfaceArea.Text = "Total Surface Area: " + tbxRehabilitationDataRoundTotalSurfaceArea.Text;

                    decimal chimneyTotalSurfaceArea = decimal.Round(chimneyArea + chimneyFloor + chimneyCeiling + chimneyBenching, 2);
                    Distance chimneyTotalSurfaceAreaDistance = new Distance(chimneyTotalSurfaceArea.ToString());
                    tbxRehabilitationDataChimneyTotalSurfaceArea.Text = chimneyTotalSurfaceAreaDistance.ToStringInEng3();

                    decimal barrelTotalSurfaceArea = decimal.Round(barrelArea + barrelFloor + barrelCeiling + barrelBenching, 2);
                    Distance barrelTotalSurfaceAreaDistance = new Distance(barrelTotalSurfaceArea.ToString());
                    tbxRehabilitationDataBarrelTotalSurfaceArea.Text = barrelTotalSurfaceAreaDistance.ToStringInEng3();
                }
                else
                {
                    Distance distanceRoundChimneyDiameter = new Distance(tbxRehabilitationDataChimneyDiameter.Text);
                    decimal chimneyDiameter = decimal.Parse(distanceRoundChimneyDiameter.ToStringInEng3());
                    tbxRehabilitationDataChimneyDiameter.Text = distanceRoundChimneyDiameter.ToStringInMet2();

                    Distance distanceRoundChimneyDepth = new Distance(tbxRehabilitationDataChimneyDepth.Text);
                    decimal chimneyDepth = decimal.Parse(distanceRoundChimneyDepth.ToStringInEng3());
                    tbxRehabilitationDataChimneyDepth.Text = distanceRoundChimneyDepth.ToStringInMet2();

                    Distance distanceRoundBarrelDiameter = new Distance(tbxRehabilitationDataBarrelDiameter.Text);
                    decimal barrelDiameter = decimal.Parse(distanceRoundBarrelDiameter.ToStringInEng3());
                    tbxRehabilitationDataBarrelDiameter.Text = distanceRoundBarrelDiameter.ToStringInMet2();

                    Distance distanceRoundBarrelDepth = new Distance(tbxRehabilitationDataBarrelDepth.Text);
                    decimal barrelDepth = decimal.Parse(distanceRoundBarrelDepth.ToStringInEng3());
                    tbxRehabilitationDataBarrelDepth.Text = distanceRoundBarrelDepth.ToStringInMet2();

                    decimal pi = Decimal.Round(decimal.Parse(Math.PI.ToString()), 4);
                    double chimneyRadius = double.Parse(distanceRoundChimneyDiameter.ToStringInEng3()) / 2;
                    decimal chimneyRadiusSquare = decimal.Parse(Math.Pow(chimneyRadius, 2).ToString());
                    double barrelRadius = double.Parse(distanceRoundBarrelDiameter.ToStringInEng3()) / 2;
                    decimal barrelRadiusSquare = decimal.Parse(Math.Pow(barrelRadius, 2).ToString());

                    // Recalculate chimmney Floor
                    decimal chimneyFloor = 0;
                    tbxRehabilitationDataChimneyFloor.Text = "";
                    if (ckbxRehabilitationDataChimneyFloor.Checked)
                    {
                        chimneyFloor = Decimal.Round(pi * (chimneyRadiusSquare), 2);
                        Distance floorDistance = new Distance(chimneyFloor.ToString());
                        tbxRehabilitationDataChimneyFloor.Text = floorDistance.ToStringInMet2();
                    }

                    // Recalculate Chimney Ceiling
                    decimal chimneyCeiling = 0;
                    tbxRehabilitationDataChimneyCeiling.Text = "";
                    if (ckbxRehabilitationDataChimneyCeiling.Checked)
                    {
                        chimneyCeiling = Decimal.Round(pi * (chimneyRadiusSquare), 2);
                        Distance ceilingDistance = new Distance(chimneyCeiling.ToString());
                        tbxRehabilitationDataChimneyCeiling.Text = ceilingDistance.ToStringInMet2();

                        //Graphic
                        lblRoudChimneyCeilingLabel.Text = tbxRehabilitationDataChimneyCeiling.Text;
                    }

                    // Recalculate chimney Benching
                    decimal chimneyBenching = 0;
                    tbxRehabilitationDataChimneyBenching.Text = "";
                    if (ckbxRehabilitationDataChimneyBenching.Checked)
                    {
                        chimneyBenching = Decimal.Round((pi * (chimneyRadiusSquare)) * decimal.Parse("0.06"), 2);
                        Distance benchingDistance = new Distance(chimneyBenching.ToString());
                        tbxRehabilitationDataChimneyBenching.Text = benchingDistance.ToStringInMet2();
                    }

                    // Recalculate chimney surface area
                    decimal chimneyArea = Decimal.Round((2 * pi * (decimal.Parse("0.5") * chimneyDiameter) * chimneyDepth), 2);
                    Distance chimneyAreaDistance = new Distance(chimneyArea.ToString());
                    tbxRehabilitationDataChimneySurfaceArea.Text = chimneyAreaDistance.ToStringInMet2();

                    // Recalculate Barrel Floor
                    decimal barrelFloor = 0;
                    tbxRehabilitationDataBarrelFloor.Text = "";
                    if (ckbxRehabilitationDataBarrelFloor.Checked)
                    {
                        barrelFloor = Decimal.Round(pi * (barrelRadiusSquare), 2);
                        Distance floorDistance = new Distance(barrelFloor.ToString());
                        tbxRehabilitationDataBarrelFloor.Text = floorDistance.ToStringInMet2();
                    }

                    // Recalculate Barrel Ceiling
                    decimal barrelCeiling = 0;
                    tbxRehabilitationDataBarrelCeiling.Text = "";
                    if (ckbxRehabilitationDataBarrelCeiling.Checked)
                    {
                        barrelCeiling = Decimal.Round(pi * (barrelRadiusSquare), 2);
                        Distance ceilingDistance = new Distance(barrelCeiling.ToString());
                        tbxRehabilitationDataBarrelCeiling.Text = ceilingDistance.ToStringInMet2();

                        // Graphic
                        lblRoundBarrelCeilingLabel.Text = tbxRehabilitationDataBarrelCeiling.Text;
                    }

                    // Recalculate Barrel Benching
                    decimal barrelBenching = 0;
                    tbxRehabilitationDataBarrelBenching.Text = "";
                    if (ckbxRehabilitationDataBarrelBenching.Checked)
                    {
                        barrelBenching = Decimal.Round((pi * (barrelRadiusSquare)) * decimal.Parse("0.06"), 2);
                        Distance benchingDistance = new Distance(barrelBenching.ToString());
                        tbxRehabilitationDataBarrelBenching.Text = benchingDistance.ToStringInMet2();
                    }

                    // Recalculate Barrel surface area
                    decimal barrelArea = Decimal.Round((2 * pi * (decimal.Parse("0.5") * barrelDiameter) * barrelDepth), 2);
                    Distance barrelAreaDistance = new Distance(barrelArea.ToString());
                    tbxRehabilitationDataBarrelSurfaceArea.Text = barrelAreaDistance.ToStringInMet2();

                    // Recalculte total depth
                    decimal totalDepth = decimal.Round(chimneyDepth + barrelDepth, 0);
                    Distance totalDepthDistance = new Distance(totalDepth.ToString());
                    tbxRehabilitationDataRoundTotalDepth.Text = totalDepthDistance.ToStringInMet2();

                    // Recalculate total surface area
                    decimal totalSurfaceArea = decimal.Round((chimneyArea + barrelArea + chimneyFloor + chimneyCeiling + chimneyBenching + barrelFloor + barrelCeiling + barrelBenching), 0);
                    Distance totalSurfaceAreaDistance = new Distance(totalSurfaceArea.ToString());
                    tbxRehabilitationDataRoundTotalSurfaceArea.Text = totalSurfaceAreaDistance.ToStringInEng3();

                    // For Graphic
                    lblRoudChimneyDiameterLabel.Text = tbxRehabilitationDataChimneyDiameter.Text;
                    lblRoudChimneyDepthLabel.Text = tbxRehabilitationDataChimneyDepth.Text;
                    lblRoundChimneySurfaceAreaLabel.Text = tbxRehabilitationDataChimneySurfaceArea.Text;

                    lblRoudBarrelDiameterLabel.Text = tbxRehabilitationDataBarrelDiameter.Text;
                    lblRoudBarrelDepthLabel.Text = tbxRehabilitationDataBarrelDepth.Text;
                    lblRoundBarrelSurfaceAreaLabel.Text = tbxRehabilitationDataBarrelSurfaceArea.Text;

                    lblRoundTotalDepthLabel.Text = tbxRehabilitationDataRoundTotalDepth.Text;
                    lblRoundTotalSurfaceArea.Text = "Total Surface Area: " + tbxRehabilitationDataRoundTotalSurfaceArea.Text;

                    decimal chimneyTotalSurfaceArea = decimal.Round(chimneyArea + chimneyFloor + chimneyCeiling + chimneyBenching, 2);
                    Distance chimneyTotalSurfaceAreaDistance = new Distance(chimneyTotalSurfaceArea.ToString());
                    tbxRehabilitationDataChimneyTotalSurfaceArea.Text = chimneyTotalSurfaceAreaDistance.ToStringInEng3();

                    decimal barrelTotalSurfaceArea = decimal.Round(barrelArea + barrelFloor + barrelCeiling + barrelBenching, 2);
                    Distance barrelTotalSurfaceAreaDistance = new Distance(barrelTotalSurfaceArea.ToString());
                    tbxRehabilitationDataBarrelTotalSurfaceArea.Text = barrelTotalSurfaceAreaDistance.ToStringInEng3();
                }
            }
        }
コード例 #7
0
        // ////////////////////////////////////////////////////////////////////////
        // PRIVATE METHODS
        //
        /// <summary>
        /// UpdateForReport
        /// </summary>
        private void UpdateForReport()
        {
            foreach (FlLiningCompletedReportTDS.LiningCompletedRow row in (FlLiningCompletedReportTDS.LiningCompletedDataTable)Table)
            {
                if (!row.IsLengthNull())
                {
                    Distance distance = new Distance(row.Length);
                    row.Length = distance.ToStringInEng3();
                }

                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;
                        }
                    }
                }
            }
        }
コード例 #8
0
 protected string GetDistance(object distance)
 {
     if (distance != DBNull.Value)
     {
         Distance distanceInch = new Distance(distance.ToString());
         return distanceInch.ToStringInEng3();
     }
     else
     {
         return "";
     }
 }
コード例 #9
0
        // ////////////////////////////////////////////////////////////////////////
        // PRIVATE METHODS
        //
        /// <summary>
        /// UpdateForReport
        /// </summary>
        private void UpdateForReport()
        {
            double total = 0.0F;
            double totalConfirmed = 0;
            Distance d;

            foreach (FLWorkAheadReportTDS.WorkAheadRow rowTemp in (FLWorkAheadReportTDS.WorkAheadDataTable)Table)
            {
                if (!rowTemp.IsMapLengthNull())
                {
                    if (Distance.IsValidDistance(rowTemp.MapLength))
                    {
                        d = new Distance(rowTemp.MapLength);
                        total = total + d.ToDoubleInEng3();
                    }
                }

                if (!rowTemp.IsSize_Null())
                {
                    if (Distance.IsValidDistance(rowTemp.Size_))
                    {
                        d = new Distance(rowTemp.Size_);
                        totalConfirmed = totalConfirmed + d.ToDoubleInEng3();
                    }
                }
            }

            foreach (FLWorkAheadReportTDS.WorkAheadRow row in (FLWorkAheadReportTDS.WorkAheadDataTable)Table)
            {
                if (!row.IsMapLengthNull())
                {
                    if (Distance.IsValidDistance(row.MapLength))
                    {
                        d = new Distance(row.MapLength);
                        row.SumScaled = Math.Round(d.ToDoubleInEng3(), 2);
                    }
                }

                if (!row.IsSize_Null())
                {
                    if (Distance.IsValidDistance(row.Size_))
                    {
                        try
                        {
                            d = new Distance(row.Size_);
                            row.SumConfirmed = Convert.ToInt32(d.ToStringInEng3());
                        }
                        catch
                        {
                            row.SumConfirmed = 0;
                        }
                    }
                }

                row.TotalAhead = Math.Round(total, 2);
                row.TotalAhead2 = totalConfirmed;
            }
        }
コード例 #10
0
        private void LoadManholeRoundShape(int assetId, ManholeRehabilitationManholeDetailsGateway manholeRehabilitationManholeDetailsGateway)
        {
            // Load manhole structure information
            // ... Round shape
            // ... ... Chimney
            tbxRehabilitationDataChimneyDiameter.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopDiameter(assetId));
            lblRoudChimneyDiameterLabel.Text = tbxRehabilitationDataChimneyDiameter.Text;
            tbxRehabilitationDataChimneyDepth.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopDepth(assetId));
            lblRoudChimneyDepthLabel.Text = tbxRehabilitationDataChimneyDepth.Text;

            ckbxRehabilitationDataChimneyFloor.Checked = false;
            tbxRehabilitationDataChimneyFloor.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopFloor(assetId) != "")
            {
                ckbxRehabilitationDataChimneyFloor.Checked = true;
                tbxRehabilitationDataChimneyFloor.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopFloor(assetId));
            }

            ckbxRehabilitationDataChimneyCeiling.Checked = false;
            tbxRehabilitationDataChimneyCeiling.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopCeiling(assetId) != "")
            {
                ckbxRehabilitationDataChimneyCeiling.Checked = true;
                tbxRehabilitationDataChimneyCeiling.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopCeiling(assetId));
                lblRoudChimneyCeilingLabel.Text = tbxRehabilitationDataChimneyCeiling.Text;
            }

            ckbxRehabilitationDataChimneyBenching.Checked = false;
            tbxRehabilitationDataChimneyBenching.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopBenching(assetId) != "")
            {
                ckbxRehabilitationDataChimneyBenching.Checked = true;
                tbxRehabilitationDataChimneyBenching.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopBenching(assetId));
            }

            ckbxRehabilitationDataChimneySurfaceArea.Checked = false;
            tbxRehabilitationDataChimneySurfaceArea.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopSurfaceArea(assetId) != "")
            {
                ckbxRehabilitationDataChimneySurfaceArea.Checked = true;
                tbxRehabilitationDataChimneySurfaceArea.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopSurfaceArea(assetId));
                lblRoundChimneySurfaceAreaLabel.Text = tbxRehabilitationDataChimneySurfaceArea.Text;
            }

            // Recalculate Top total surface area
            decimal chimneySurfaceArea = GetValueValidForCalculations(tbxRehabilitationDataChimneySurfaceArea.Text);
            decimal chimneyFloor = GetValueValidForCalculations(tbxRehabilitationDataChimneyFloor.Text);
            decimal chimneyCeiling = GetValueValidForCalculations(tbxRehabilitationDataChimneyCeiling.Text);
            decimal chimneyBenching = GetValueValidForCalculations(tbxRehabilitationDataChimneyBenching.Text);

            decimal chimneyTotalSurfaceArea = decimal.Round(chimneySurfaceArea + chimneyFloor + chimneyCeiling + chimneyBenching, 2);
            Distance chimneyTotalSurfaceAreaDistance = new Distance(chimneyTotalSurfaceArea.ToString());
            tbxRehabilitationDataChimneyTotalSurfaceArea.Text = chimneyTotalSurfaceAreaDistance.ToStringInEng3();

            // ... ... Barrel
            tbxRehabilitationDataBarrelDiameter.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownDiameter(assetId));
            lblRoudBarrelDiameterLabel.Text = tbxRehabilitationDataBarrelDiameter.Text;
            tbxRehabilitationDataBarrelDepth.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownDepth(assetId));
            lblRoudBarrelDepthLabel.Text = tbxRehabilitationDataBarrelDepth.Text;

            ckbxRehabilitationDataBarrelFloor.Checked = false;
            tbxRehabilitationDataBarrelFloor.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownFloor(assetId) != "")
            {
                ckbxRehabilitationDataBarrelFloor.Checked = true;
                tbxRehabilitationDataBarrelFloor.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownFloor(assetId));
            }

            ckbxRehabilitationDataBarrelCeiling.Checked = false;
            tbxRehabilitationDataBarrelCeiling.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownCeiling(assetId) != "")
            {
                ckbxRehabilitationDataBarrelCeiling.Checked = true;
                tbxRehabilitationDataBarrelCeiling.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownCeiling(assetId));
                lblRoundBarrelCeilingLabel.Text = tbxRehabilitationDataBarrelCeiling.Text;
            }

            ckbxRehabilitationDataBarrelBenching.Checked = false;
            tbxRehabilitationDataBarrelBenching.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownBenching(assetId) != "")
            {
                ckbxRehabilitationDataBarrelBenching.Checked = true;
                tbxRehabilitationDataBarrelBenching.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownBenching(assetId));
            }

            tbxRehabilitationDataBarrelSurfaceArea.Text = manholeRehabilitationManholeDetailsGateway.GetDownSurfaceArea(assetId);
            lblRoundBarrelSurfaceAreaLabel.Text = tbxRehabilitationDataBarrelSurfaceArea.Text;

            // Recalculate Top total surface area
            decimal barrelSurfaceArea = GetValueValidForCalculations(tbxRehabilitationDataBarrelSurfaceArea.Text);
            decimal barrelFloor = GetValueValidForCalculations(tbxRehabilitationDataBarrelFloor.Text);
            decimal barrelCeiling = GetValueValidForCalculations(tbxRehabilitationDataBarrelCeiling.Text);
            decimal barrelBenching = GetValueValidForCalculations(tbxRehabilitationDataBarrelBenching.Text);

            decimal barrelTotalSurfaceArea = decimal.Round(barrelSurfaceArea + barrelFloor + barrelCeiling + barrelBenching, 2);
            Distance barrelTotalSurfaceAreaDistance = new Distance(barrelTotalSurfaceArea.ToString());
            tbxRehabilitationDataBarrelTotalSurfaceArea.Text = barrelTotalSurfaceAreaDistance.ToStringInEng3();

            tbxRehabilitationDataBarrelManholeRugs.Text = manholeRehabilitationManholeDetailsGateway.GetManholeRugs(assetId).ToString();

            // ... ... Totals
            tbxRehabilitationDataRoundTotalDepth.Text = GetValueValidForCalculationsInStringWithoutDecimals(manholeRehabilitationManholeDetailsGateway.GetTotalDepth(assetId));
            lblRoundTotalDepthLabel.Text = tbxRehabilitationDataRoundTotalDepth.Text;
            tbxRehabilitationDataRoundTotalSurfaceArea.Text = GetValueValidForCalculationsInStringWithoutDecimals(manholeRehabilitationManholeDetailsGateway.GetTotalSurfaceArea(assetId));
            lblRoundTotalSurfaceArea.Text = tbxRehabilitationDataRoundTotalSurfaceArea.Text;
        }
コード例 #11
0
        private void LoadManholeRectangularShape(int assetId, ManholeRehabilitationManholeDetailsGateway manholeRehabilitationManholeDetailsGateway)
        {
            // ... Rectangular Shape
            // ... ... Rectangular 1
            tbxRehabilitationDataRectangle1LongSide.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetRectangle1LongSide(assetId));
            lblRectangular1LongSideLabel.Text = tbxRehabilitationDataRectangle1LongSide.Text;
            tbxRehabilitationDataRectangle1ShortSide.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetRectangle1ShortSide(assetId));
            lblRectangular1ShortSideLabel.Text = tbxRehabilitationDataRectangle1ShortSide.Text;
            tbxRehabilitationDataRectangle1Depth.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopDepth(assetId));
            lblRectangular1DephtLabel.Text = tbxRehabilitationDataRectangle1Depth.Text;

            ckbxRehabilitationDataRectangle1Floor.Checked = false;
            tbxRehabilitationDataRectangle1Floor.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopFloor(assetId) != "")
            {
                ckbxRehabilitationDataRectangle1Floor.Checked = true;
                tbxRehabilitationDataRectangle1Floor.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopFloor(assetId));
            }

            ckbxRehabilitationDataRectangle1Ceiling.Checked = false;
            tbxRehabilitationDataRectangle1Ceiling.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopCeiling(assetId) != "")
            {
                ckbxRehabilitationDataRectangle1Ceiling.Checked = true;
                tbxRehabilitationDataRectangle1Ceiling.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopCeiling(assetId));
                lblRectangular1CeilingLabel.Text = tbxRehabilitationDataRectangle1Ceiling.Text;
            }

            ckbxRehabilitationDataRectangle1Benching.Checked = false;
            tbxRehabilitationDataRectangle1Benching.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopBenching(assetId) != "")
            {
                ckbxRehabilitationDataRectangle1Benching.Checked = true;
                tbxRehabilitationDataRectangle1Benching.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopBenching(assetId));
            }

            tbxRehabilitationDataRectangle1SurfaceArea.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopSurfaceArea(assetId));
            lblRectangle1SurfaceAreaLabel.Text = tbxRehabilitationDataRectangle1SurfaceArea.Text;

            // Recalculate rectangle 1 total surface area
            decimal rectangle1SurfaceArea = GetValueValidForCalculations(tbxRehabilitationDataRectangle1SurfaceArea.Text);
            decimal rectangle1Floor = GetValueValidForCalculations(tbxRehabilitationDataRectangle1Floor.Text);
            decimal rectangle1Ceiling = GetValueValidForCalculations(tbxRehabilitationDataRectangle1Ceiling.Text);
            decimal rectangle1Benching = GetValueValidForCalculations(tbxRehabilitationDataRectangle1Benching.Text);

            decimal rectangle1TotalSurfaceArea = decimal.Round(rectangle1SurfaceArea + rectangle1Floor + rectangle1Ceiling + rectangle1Benching, 2);
            Distance rectangle1TotalSurfaceAreaDistance = new Distance(rectangle1TotalSurfaceArea.ToString());
            tbxRehabilitationDataRectangle1TotalSurfaceArea.Text = rectangle1TotalSurfaceAreaDistance.ToStringInEng3();

            // ... ... Rectangular 2
            tbxRehabilitationDataRectangle2LongSide.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetRectangle2LongSide(assetId));
            lblRectangle2LongSideLabel.Text = tbxRehabilitationDataRectangle2LongSide.Text;
            tbxRehabilitationDataRectangle2ShortSide.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetRectangle2ShortSide(assetId));
            lblRectangular2ShortSideLabel.Text = tbxRehabilitationDataRectangle2ShortSide.Text;
            tbxRehabilitationDataRectangle2Depth.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownDepth(assetId));
            lblRectangular2Depth.Text = tbxRehabilitationDataRectangle2Depth.Text;

            ckbxRehabilitationDataRectangle2Floor.Checked = false;
            tbxRehabilitationDataRectangle2Floor.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownFloor(assetId) != "")
            {
                ckbxRehabilitationDataRectangle2Floor.Checked = true;
                tbxRehabilitationDataRectangle2Floor.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownFloor(assetId));
            }

            ckbxRehabilitationDataRectangle2Ceiling.Checked = false;
            tbxRehabilitationDataRectangle2Ceiling.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownCeiling(assetId) != "")
            {
                ckbxRehabilitationDataRectangle2Ceiling.Checked = true;
                tbxRehabilitationDataRectangle2Ceiling.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownCeiling(assetId));
                lblRectangular2CeilingLabel.Text = tbxRehabilitationDataRectangle2Ceiling.Text;
            }

            ckbxRehabilitationDataRectangle2Benching.Checked = false;
            tbxRehabilitationDataRectangle2Benching.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownBenching(assetId) != "")
            {
                ckbxRehabilitationDataRectangle2Benching.Checked = true;
                tbxRehabilitationDataRectangle2Benching.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownBenching(assetId));
            }

            tbxRehabilitationDataRectangle2SurfaceArea.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownSurfaceArea(assetId));
            lblRectangle2SurfaceAreaLabel.Text = tbxRehabilitationDataRectangle2SurfaceArea.Text;

            // Recalculate rectangle 2 total surface area
            decimal rectangle2SurfaceArea = GetValueValidForCalculations(tbxRehabilitationDataRectangle2SurfaceArea.Text);
            decimal rectangle2Floor = GetValueValidForCalculations(tbxRehabilitationDataRectangle2Floor.Text);
            decimal rectangle2Ceiling = GetValueValidForCalculations(tbxRehabilitationDataRectangle2Ceiling.Text);
            decimal rectangle2Benching = GetValueValidForCalculations(tbxRehabilitationDataRectangle2Benching.Text);

            decimal rectangle2TotalSurfaceArea = decimal.Round(rectangle2SurfaceArea + rectangle2Floor + rectangle2Ceiling + rectangle2Benching, 2);
            Distance rectangle2TotalSurfaceAreaDistance = new Distance(rectangle2TotalSurfaceArea.ToString());
            tbxRehabilitationDataRectangle2TotalSurfaceArea.Text = rectangle2TotalSurfaceAreaDistance.ToStringInEng3();

            tbxRehabilitationDataRectangularManholeRugs.Text = manholeRehabilitationManholeDetailsGateway.GetManholeRugs(assetId).ToString();

            // ... ... Totals
            tbxRehabilitationDataRectangularTotalDepth.Text = GetValueValidForCalculationsInStringWithoutDecimals(manholeRehabilitationManholeDetailsGateway.GetTotalDepth(assetId));
            lblRectangularTotalDepthLabel.Text = tbxRehabilitationDataRectangularTotalDepth.Text;
            tbxRehabilitationDataRectangularTotalSurfaceArea.Text = GetValueValidForCalculationsInStringWithoutDecimals(manholeRehabilitationManholeDetailsGateway.GetTotalSurfaceArea(assetId));
            lblRectangularTotalSurfaceAreaLabel.Text = tbxRehabilitationDataRectangularTotalSurfaceArea.Text;
        }
コード例 #12
0
        private void LoadManholeMixShape(int assetId, ManholeRehabilitationManholeDetailsGateway manholeRehabilitationManholeDetailsGateway)
        {
            // ... Mix Shape
            // ... ... Top
            tbxRehabilitationDataRoundDiameter.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopDiameter(assetId));
            lblDataRoundDiameterLabel.Text = tbxRehabilitationDataRoundDiameter.Text;
            tbxRehabilitationDataRoundDepth.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopDepth(assetId));
            lblDataRoundDepthLabel.Text = tbxRehabilitationDataRoundDepth.Text;

            ckbxRehabilitationDataRoundFloor.Checked = false;
            tbxRehabilitationDataRoundFloor.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopFloor(assetId) != "")
            {
                ckbxRehabilitationDataRoundFloor.Checked = true;
                tbxRehabilitationDataRoundFloor.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopFloor(assetId));
            }

            ckbxRehabilitationDataRoundCeiling.Checked = false;
            tbxRehabilitationDataRoundCeiling.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopCeiling(assetId) != "")
            {
                ckbxRehabilitationDataRoundCeiling.Checked = true;
                tbxRehabilitationDataRoundCeiling.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopCeiling(assetId));
                lblDataRoundCeilingLabel.Text = tbxRehabilitationDataRoundCeiling.Text;
            }

            ckbxRehabilitationDataRoundBenching.Checked = false;
            tbxRehabilitationDataRoundBenching.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetTopBenching(assetId) != "")
            {
                ckbxRehabilitationDataRoundBenching.Checked = true;
                tbxRehabilitationDataRoundBenching.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopBenching(assetId));
            }

            tbxRehabilitationDataRoundSurfaceArea.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetTopSurfaceArea(assetId));
            lblDataRoundSurfaceAreaLabel.Text = tbxRehabilitationDataRoundSurfaceArea.Text;

            // Recalculate Top total surface area
            decimal roundSurfaceArea = GetValueValidForCalculations(tbxRehabilitationDataRoundSurfaceArea.Text);
            decimal roundFloor = GetValueValidForCalculations(tbxRehabilitationDataRoundFloor.Text);
            decimal roundCeiling = GetValueValidForCalculations(tbxRehabilitationDataRoundCeiling.Text);
            decimal roundBenching = GetValueValidForCalculations(tbxRehabilitationDataRoundBenching.Text);

            decimal roundTotalSurfaceArea = decimal.Round(roundSurfaceArea + roundFloor + roundCeiling + roundBenching, 2);
            Distance roundTotalSurfaceAreaDistance = new Distance(roundTotalSurfaceArea.ToString());
            tbxRehabilitationDataMixedRoundTotalSurfaceArea.Text = roundTotalSurfaceAreaDistance.ToStringInEng3();

            // ... ... Down
            tbxRehabilitationDataRectangleLongSide.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetRectangle2LongSide(assetId));
            lblRectangleLongSideLabel.Text = tbxRehabilitationDataRectangleLongSide.Text;
            tbxRehabilitationDataRectangleShortSide.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetRectangle2ShortSide(assetId));
            lblRectangleShortSideLabel.Text = tbxRehabilitationDataRectangleShortSide.Text;
            tbxRehabilitationDataRectangleDepth.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownDepth(assetId));
            lblRectangleDepthLabel.Text = tbxRehabilitationDataRectangleDepth.Text;

            ckbxRehabilitationDataRectangleFloor.Checked = false;
            tbxRehabilitationDataRectangleFloor.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownFloor(assetId) != "")
            {
                ckbxRehabilitationDataRectangleFloor.Checked = true;
                tbxRehabilitationDataRectangleFloor.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownFloor(assetId));
            }

            ckbxRehabilitationDataRectangleCeiling.Checked = false;
            tbxRehabilitationDataRectangleCeiling.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownCeiling(assetId) != "")
            {
                ckbxRehabilitationDataRectangleCeiling.Checked = true;
                tbxRehabilitationDataRectangleCeiling.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownCeiling(assetId));
                lblRectangleCeilingLabel.Text = tbxRehabilitationDataRectangleCeiling.Text;
            }

            ckbxRehabilitationDataBenching.Checked = false;
            tbxRehabilitationDataBenching.Text = "";
            if (manholeRehabilitationManholeDetailsGateway.GetDownBenching(assetId) != "")
            {
                ckbxRehabilitationDataBenching.Checked = true;
                tbxRehabilitationDataBenching.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownBenching(assetId));
            }

            tbxRehabilitationDataRectangularSufaceArea.Text = GetValueValidForCalculationsInString(manholeRehabilitationManholeDetailsGateway.GetDownSurfaceArea(assetId));
            lblRectangleSurfaceAreaLabel.Text = tbxRehabilitationDataRectangularSufaceArea.Text;

            // Recalculate Top total surface area
            decimal mixesRectangleSurfaceArea = GetValueValidForCalculations(tbxRehabilitationDataRectangularSufaceArea.Text);
            decimal mixesRectangleFloor = GetValueValidForCalculations(tbxRehabilitationDataRectangleFloor.Text);
            decimal mixesRectangleCeiling = GetValueValidForCalculations(tbxRehabilitationDataRectangleCeiling.Text);
            decimal mixesRectangleBenching = GetValueValidForCalculations(tbxRehabilitationDataBenching.Text);

            decimal mixesRectangleTotalSurfaceArea = decimal.Round(mixesRectangleSurfaceArea + mixesRectangleFloor + mixesRectangleCeiling + mixesRectangleBenching, 2);
            Distance mixesRectangleTotalSurfaceAreaDistance = new Distance(mixesRectangleTotalSurfaceArea.ToString());
            tbxRehabilitationDataMixedRectangleTotalSurfaceArea.Text = mixesRectangleTotalSurfaceAreaDistance.ToStringInEng3();

            tbxRehabilitationDataManholeRugs.Text = manholeRehabilitationManholeDetailsGateway.GetManholeRugs(assetId).ToString();

            // ... ... Totals
            tbxRehabilitationDataTotalDepth.Text = GetValueValidForCalculationsInStringWithoutDecimals(manholeRehabilitationManholeDetailsGateway.GetTotalDepth(assetId));
            lblMixedTotalDepthLabel.Text = tbxRehabilitationDataTotalDepth.Text;
            tbxRehabilitationDataTotalSurfaceArea.Text = GetValueValidForCalculationsInStringWithoutDecimals(manholeRehabilitationManholeDetailsGateway.GetTotalSurfaceArea(assetId));
            lblTotalMixedSurfaceAreaLabel.Text = tbxRehabilitationDataTotalSurfaceArea.Text;
        }
コード例 #13
0
 private decimal GetValueValidForCalculations(string value)
 {
     try
     {
         Distance valueDistance = new Distance(value);
         decimal valueValid = decimal.Round(Convert.ToDecimal(valueDistance.ToStringInEng3()), 2);
         return valueValid;
     }
     catch
     {
         return 0;
     }
 }