private void btnRestoreInspectionPlan_Click(object sender, EventArgs e) { WaitForm2 wf = new WaitForm2(); wf.Show(); dtgvInsHis.Rows.Clear(); RW_ASSESSMENT_BUS rwAssBus = new RW_ASSESSMENT_BUS(); INSPECTION_COVERAGE_BUS insCovBus = new INSPECTION_COVERAGE_BUS(); INSPECTION_PLAN_BUS inPlanBus = new INSPECTION_PLAN_BUS(); INSPECTION_COVERAGE_DETAIL_BUS insCovDeBus = new INSPECTION_COVERAGE_DETAIL_BUS(); DM_ITEMS_BUS dmItemsBus = new DM_ITEMS_BUS(); List <int> listIDCoverage = insCovBus.getlistIDbyEquipmentIDandComponentID(rwAssBus.getEquipmentID(IDAss), rwAssBus.getComponentID(IDAss)); foreach (int i in listIDCoverage) { List <int> listIDDetal = insCovDeBus.getIDbyCoverageID(i); foreach (int j in listIDDetal) { INSPECTION_COVERAGE_DETAIL insCovDe = insCovDeBus.getDataSourcebyID(j); dtgvInsHis.Rows.Add(inPlanBus.getPlanName(insCovBus.getPlanIDbyID(i)), insCovDe.InspectionDate.ToShortDateString(), dmItemsBus.getDMDescriptionbyDMItemID(insCovDe.DMItemID), insCovDe.InspectionSummary, "...", insCovDe.EffectivenessCode, insCovDe.IsCarriedOut, insCovDe.CarriedOutDate.ToShortDateString(), "Delete"); } } int n = dtgvInsHis.RowCount; for (int i = 0; i < n; i++) { dtgvInsHis.Rows[i].ReadOnly = true; dtgvInsHis.Rows[i].Cells[6].ReadOnly = false; dtgvInsHis.Rows[i].Cells[5].ReadOnly = false; dtgvInsHis.Rows[i].Cells[8].ReadOnly = false; dtgvInsHis.Rows[i].Cells[3].ReadOnly = false; } wf.Close(); }
private void initData_CA(int ID) { RW_ASSESSMENT_BUS busAssess = new RW_ASSESSMENT_BUS(); COMPONENT_MASTER_BUS busCompMaster = new COMPONENT_MASTER_BUS(); int[] temp = busAssess.getEquipmentID_ComponentID(ID); int compTypeID = busCompMaster.getComponentTypeID(temp[1]); Console.WriteLine("comTypeID=" + compTypeID + " " + temp[1]); if (compTypeID == 12) { initData_Tank(ID); tabCATankBottom.PageVisible = true; tabCAShell.PageVisible = false; tabCA.PageVisible = false; tabCATankShell.PageVisible = false; TabArea.PageVisible = false; } else if (compTypeID == 8) { initData_Shell(ID); tabCA.PageVisible = false; tabCATankBottom.PageVisible = false; tabCAShell.PageVisible = false; tabCATankShell.PageVisible = true; TabArea.PageVisible = false; } else if (compTypeID == 13) { initData_Shell(ID); tabCA.PageVisible = false; tabCATankBottom.PageVisible = false; TabArea.PageVisible = false; tabCAShell.PageVisible = true; tabCATankShell.PageVisible = true; #region table RW_FULL_COF_TANK RW_FULL_COF_TANK_BUS COFBus = new RW_FULL_COF_TANK_BUS(); RW_FULL_COF_TANK obj = COFBus.getData(ID); txtProdCost.Text = obj.ProdCost.ToString(); txtEquipOutageMultiplier.Text = obj.EquipOutageMultiplier.ToString(); txtEquip.Text = obj.equipcost.ToString(); txtDensity.Text = obj.popdens.ToString(); txtInjury.Text = obj.injcost.ToString(); #endregion } else { riskCA(ID); ShowDataOutputCA(ID); tabCATankBottom.PageVisible = false; tabCAShell.PageVisible = false; tabCA.PageVisible = true; tabCATankShell.PageVisible = false; } }
private void btnAddRow_Click(object sender, EventArgs e) { RW_CORROSION_RATE_TANK_BUS busConRate = new RW_CORROSION_RATE_TANK_BUS(); RW_CORROSION_RATE_TANK obj = new RW_CORROSION_RATE_TANK(); RW_ASSESSMENT_BUS busAssessment = new RW_ASSESSMENT_BUS(); List <RW_ASSESSMENT> listAss = busAssessment.getDataSource(); //int ID = listAss.Max(RW_ASSESSMENT => RW_ASSESSMENT.ID); obj.ID = Proposal_ID; busConRate.add(obj); unitdata(showData(Proposal_ID)); }
public RW_ASSESSMENT getData(int ID) { RW_ASSESSMENT_BUS assBus = new RW_ASSESSMENT_BUS(); int[] temp = assBus.getEquipmentID_ComponentID(ID); RW_ASSESSMENT ass = new RW_ASSESSMENT(); ass.AssessmentDate = dateAssessmentDate.DateTime; ass.RiskAnalysisPeriod = txtRiskAnalysisPeriod.Text != "" ? int.Parse(txtRiskAnalysisPeriod.Text) : 0; ass.IsEquipmentLinked = chkRiskLinksEquipmentRisk.Checked ? 1 : 0; ass.RecordType = cbReportTemplate.Text; ass.ProposalName = txtAssessmentName.Text; ass.AdoptedDate = DateTime.Now; ass.RecommendedDate = DateTime.Now; ass.EquipmentID = temp[0]; ass.ComponentID = temp[1]; return(ass); }
public RW_STREAM getData(int ID) { RW_STREAM stream = new RW_STREAM(); RW_ASSESSMENT_BUS assBus = new RW_ASSESSMENT_BUS(); stream.ID = ID; stream.AmineSolution = cbAmineSolutionComposition.Text; stream.AqueousOperation = chkAqueousPhaseDuringOperation.Checked ? 1 : 0; stream.AqueousShutdown = chkAqueousPhaseShutdown.Checked ? 1 : 0; stream.ToxicConstituent = chkToxicConstituents.Checked ? 1 : 0; stream.Caustic = chkEnvironmentContainsCaustic.Checked ? 1 : 0; stream.Chloride = txtChlorideIon.Text != "" ? float.Parse(txtChlorideIon.Text) : 0; stream.CO3Concentration = txtCO3ConcentrationWater.Text != "" ? float.Parse(txtCO3ConcentrationWater.Text) : 0; stream.Cyanide = chkPresenceCyanides.Checked ? 1 : 0; stream.ExposedToGasAmine = chkExposedAcidGas.Checked ? 1 : 0; stream.ExposedToSulphur = chkExposedSulphurBearing.Checked ? 1 : 0; stream.ExposureToAmine = cbExposureAmine.Text; //stream.FlammableFluidID //stream.FlowRate stream.H2S = chkEnviromentContainsH2S.Checked ? 1 : 0; stream.H2SInWater = txtH2SContentInWater.Text != "" ? float.Parse(txtH2SContentInWater.Text) : 0; stream.Hydrogen = chkProcessContainsHydrogen.Checked ? 1 : 0; //stream.H2SPartialPressure stream.Hydrofluoric = chkPresenceHydrofluoricAcid.Checked ? 1 : 0; stream.MaterialExposedToClInt = chkChlorine.Checked ? 1 : 0; //stream.MaxOperatingPressure //stream.MaxOperatingTemperature //stream.MinOperatingPressure //stream.MinOperatingTemperature //stream.CriticalExposureTemperature //stream.ModelFluidID stream.NaOHConcentration = txtNaOHConcentration.Text != "" ? float.Parse(txtNaOHConcentration.Text) : 0; //stream.NonFlameToxicFluidID stream.ReleaseFluidPercentToxic = txtReleaseFluidPercent.Text != "" ? float.Parse(txtReleaseFluidPercent.Text) : 0; //stream.StoragePhase //stream.ToxicFluidID stream.WaterpH = txtpHWater.Text != "" ? float.Parse(txtpHWater.Text) : 0; //stream.TankFluidName //stream.FluidHeight //stream.FluidLeaveDikePercent //stream.FluidLeaveDikeRemainOnSitePercent //stream.FluidGoOffSitePercent return(stream); }
private void btnAddInspectionPlan_Click(object sender, EventArgs e) { RW_INSPECTION_HISTORY_BUS rwInsHisBus = new RW_INSPECTION_HISTORY_BUS(); RW_ASSESSMENT_BUS rwAssBus = new RW_ASSESSMENT_BUS(); int n = rwInsHisBus.getDataComp(rwAssBus.getComponentID(IDAss)).Count; if (n > 0) { dtgvInsHis.Rows.Add("-", DateTime.Now.ToShortDateString(), "Corrosion Under Insulation", "", "", "E", 0, DateTime.Now.ToShortDateString()); } else { if (dtgvInsHis.RowCount > 0) { dtgvInsHis.Rows.Add("-", DateTime.Now.ToShortDateString(), "Corrosion Under Insulation", "", "", "E", 0, DateTime.Now.ToShortDateString()); } else { MessageBox.Show("This proposal does not have mitigation plan, please add mitigation planning.", "Inspection / Mitigation", MessageBoxButtons.OK, MessageBoxIcon.Hand); return; } } }
public void showDatatoControl(int ID) { EQUIPMENT_TYPE_BUS eqTypeBus = new EQUIPMENT_TYPE_BUS(); EQUIPMENT_MASTER_BUS equipmentMasterBus = new EQUIPMENT_MASTER_BUS(); DESIGN_CODE_BUS designCodeBus = new DESIGN_CODE_BUS(); SITES_BUS siteBus = new SITES_BUS(); FACILITY_BUS facilityBus = new FACILITY_BUS(); MANUFACTURER_BUS manuBus = new MANUFACTURER_BUS(); RW_ASSESSMENT_BUS rwAssBus = new RW_ASSESSMENT_BUS(); COMPONENT_MASTER_BUS comMaBus = new COMPONENT_MASTER_BUS(); COMPONENT_TYPE__BUS comTypeBus = new COMPONENT_TYPE__BUS(); API_COMPONENT_TYPE_BUS apiComponentBus = new API_COMPONENT_TYPE_BUS(); int[] equipmentID_componentID = rwAssBus.getEquipmentID_ComponentID(ID); EQUIPMENT_MASTER eqMa = equipmentMasterBus.getData(equipmentID_componentID[0]); COMPONENT_MASTER comMa = comMaBus.getData(equipmentID_componentID[1]); RW_ASSESSMENT ass = rwAssBus.getData(ID); txtAssessmentName.Text = ass.ProposalName; dateAssessmentDate.DateTime = ass.AssessmentDate; txtRiskAnalysisPeriod.Text = ass.RiskAnalysisPeriod.ToString(); txtEquipmentNumber.Text = eqMa.EquipmentNumber; txtEquipmentType.Text = eqTypeBus.getEquipmentTypeName(eqMa.EquipmentTypeID); txtSites.Text = siteBus.getSiteName(eqMa.SiteID); txtDesignCode.Text = designCodeBus.getDesignCodeName(eqMa.DesignCodeID); txtFacility.Text = facilityBus.getFacilityName(eqMa.FacilityID); txtManufacturer.Text = manuBus.getManuName(eqMa.ManufacturerID); dateComissionDate.DateTime = eqMa.CommissionDate; txtEquipmentName.Text = eqMa.EquipmentName; txtProcessDesciption.Text = eqMa.ProcessDescription; txtComponentNumber.Text = comMa.ComponentNumber; txtComponentType.Text = comTypeBus.getComponentTypeName(comMa.ComponentTypeID); txtAPIComponentType.Text = apiComponentBus.getAPIComponentTypeName(comMa.APIComponentTypeID); txtComponentName.Text = comMa.ComponentName; chkRiskLinksEquipmentRisk.Checked = comMa.IsEquipmentLinked == 1 ? true : false; //foreach(RW_ASSESSMENT a in listAssessment) //{ // if(a.ID == ID) // { // txtAssessmentName.Text = a.ProposalName; // ProposalName = a.ProposalName; // dateAssessmentDate.DateTime = a.AssessmentDate; // txtRiskAnalysisPeriod.Text = a.RiskAnalysisPeriod.ToString(); // foreach (EQUIPMENT_MASTER e in listEquipmentMaster) // { // if (e.EquipmentID == a.EquipmentID) // { // txtEquipmentNumber.Text = e.EquipmentNumber; // dateComissionDate.DateTime = e.CommissionDate; // txtEquipmentName.Text = e.EquipmentName; // foreach (EQUIPMENT_TYPE t in listEquipmentType) // { // if (t.EquipmentTypeID == e.EquipmentTypeID) // txtEquipmentType.Text = t.EquipmentTypeName; // } // foreach (DESIGN_CODE d in listDesignCode) // { // if (d.DesignCodeID == e.DesignCodeID) // txtDesignCode.Text = d.DesignCode; // } // foreach (FACILITY f in listFacility) // { // if (e.FacilityID == f.FacilityID) // txtFacility.Text = f.FacilityName; // } // foreach (SITES s in listSite) // { // if (s.SiteID == e.SiteID) // txtSites.Text = s.SiteName; // } // foreach (MANUFACTURER m in listManu) // { // if (m.ManufacturerID == e.ManufacturerID) // txtManufacturer.Text = m.ManufacturerName; // } // } // break; // } // foreach (COMPONENT_MASTER c in listComMa) // { // if (c.ComponentID == a.ComponentID) // { // txtComponentNumber.Text = c.ComponentNumber; // foreach (COMPONENT_TYPE t in listComponentType) // { // if (c.ComponentTypeID == t.ComponentTypeID) // { // txtComponentType.Text = t.ComponentTypeName; // } // } // txtComponentName.Text = c.ComponentName; // foreach (API_COMPONENT_TYPE a1 in listAPICom) // { // if (a1.APIComponentTypeID == c.APIComponentTypeID) // { // txtAPIComponentType.Text = a1.APIComponentTypeName; // } // } // } // break; // } //} //foreach (RW_ASSESSMENT a in listAssessment) //{ // if (a.ID == assID) // { // txtAssessmentName.Text = a.ProposalName; // } //} //đổ dữ liệu lên control cho Equipment }
public List <RiskSummary> getData() { RW_ASSESSMENT_BUS assBus = new RW_ASSESSMENT_BUS(); List <int> allIDAssessment = assBus.getAllID(); List <RiskSummary> dataRisk = new List <RiskSummary>(); for (int i = 0; i < allIDAssessment.Count; i++) { RiskSummary risk = new RiskSummary(); RW_FULL_POF_BUS busPoF = new RW_FULL_POF_BUS(); RW_FULL_POF fullPoF = busPoF.getData(allIDAssessment[i]); //RW_CA_LEVEL_1_BUS busCA = new RW_CA_LEVEL_1_BUS(); //RW_CA_LEVEL_1 CA = busCA.getData(allIDAssessment[i]); //get EquipmentID ----> get EquipmentTypeName and APIComponentType int equipmentID = assBus.getEquipmentID(allIDAssessment[i]); EQUIPMENT_MASTER_BUS eqMaBus = new EQUIPMENT_MASTER_BUS(); EQUIPMENT_TYPE_BUS eqTypeBus = new EQUIPMENT_TYPE_BUS(); String equipmentTypename = eqTypeBus.getEquipmentTypeName(eqMaBus.getEquipmentTypeID(equipmentID)); COMPONENT_MASTER_BUS comMasterBus = new COMPONENT_MASTER_BUS(); API_COMPONENT_TYPE_BUS apiBus = new API_COMPONENT_TYPE_BUS(); int apiID = comMasterBus.getAPIComponentTypeID(equipmentID); String API_ComponentType_Name = apiBus.getAPIComponentTypeName(apiID); RW_INPUT_CA_LEVEL_1_BUS busInputCA = new RW_INPUT_CA_LEVEL_1_BUS(); RW_INPUT_CA_LEVEL_1 inputCA = busInputCA.getData(allIDAssessment[i]); SITES_BUS busSite = new SITES_BUS(); FACILITY_BUS busFacility = new FACILITY_BUS(); RW_ASSESSMENT_BUS busAssessment = new RW_ASSESSMENT_BUS(); risk.SitesName = busSite.getSiteName(eqMaBus.getSiteID(equipmentID)); risk.FacilityName = busFacility.getFacilityName(eqMaBus.getFacilityID(equipmentID)); risk.AssessmentName = busAssessment.getAssessmentName(allIDAssessment[i]); risk.EquipmentName = eqMaBus.getEquipmentName(equipmentID); risk.EquipmentNumber = eqMaBus.getEquipmentNumber(equipmentID); //Equipment Name or Equipment Number can dc gan lai risk.EquipmentDesc = eqMaBus.getEquipmentDesc(equipmentID); //Equipment Description gan lai risk.EquipmentType = equipmentTypename; //Equipment type risk.ComponentName = comMasterBus.getComponentName(equipmentID); //component name risk.RepresentFluid = inputCA.API_FLUID; //Represent fluid risk.FluidPhase = inputCA.SYSTEM; //fluid phase risk.currentRisk = 0; //current risk //risk.cofcatFlammable = CA.CA_inj_flame; //cofcat. Flammable //risk.cofcatPeople = CA.FC_inj;//cofcat people //risk.cofcatAsset = CA.FC_prod;//cofcat assessment //risk.cofcatEnv = CA.FC_envi;//cofcat envroment //risk.cofcatReputation = 0; //cof reputation //risk.cofcatCombined = CA.FC_total; //combined //risk.componentMaterialGrade; //component material glade risk.initThinningPoF = fullPoF.ThinningAP1; //Thinning POF risk.initEnvCracking = fullPoF.SCCAP1; //Cracking env risk.initOtherPoF = fullPoF.HTHA_AP1 + fullPoF.BrittleAP1; //OtherPOF risk.initPoF = risk.initThinningPoF + risk.initEnvCracking + risk.initOtherPoF; //Init POF risk.extThinningPoF = fullPoF.ExternalAP1; //Ext Thinning POF risk.extEnvCrackingPoF = 0; //ExtEnv Cracking risk.extOtherPoF = 0; //Ext Other POF risk.extPoF = risk.extThinningPoF + risk.extEnvCrackingPoF + risk.extOtherPoF; //Ext POF risk.PoF = risk.initPoF + risk.extPoF; //POF //risk.CurrentRiskCalculation = fullPoF.PoFAP1 * CA.FC_total; //Current risk //risk.futureRisk = fullPoF.PoFAP2 * CA.FC_total; dataRisk.Add(risk); } return(dataRisk); }
public RW_COMPONENT getData(int ID, string diameter, string thickness, string corrosionRate) // save vao base { RW_COMPONENT comp = new RW_COMPONENT(); RW_ASSESSMENT_BUS assBus = new RW_ASSESSMENT_BUS(); BUS_UNITS convUnit = new BUS_UNITS(); comp.ID = ID; // mai if (diameter == "mm") { comp.NominalDiameter = txtNominalDiameter.Text != "" ? float.Parse(txtNominalDiameter.Text) : 0; } else if (diameter == "in") { comp.NominalDiameter = txtNominalDiameter.Text != "" ? (float)(double.Parse(txtNominalDiameter.Text) * convUnit.inch) : 0; // in sang mm } else { comp.NominalDiameter = txtNominalDiameter.Text != "" ? float.Parse(txtNominalDiameter.Text) * 1000 : 0; // m sang mm } if (thickness == "mm") { comp.NominalThickness = txtNominalThickness.Text != "" ? float.Parse(txtNominalThickness.Text) : 0; comp.CurrentThickness = txtCurrentThickness.Text != "" ? float.Parse(txtCurrentThickness.Text) : 0; comp.MinReqThickness = txtMinRequiredThickness.Text != "" ? float.Parse(txtMinRequiredThickness.Text) : 0; } else if (thickness == "in") { comp.NominalThickness = txtNominalThickness.Text != "" ? (float)(double.Parse(txtNominalThickness.Text) * convUnit.inch) : 0; // in sang mm comp.CurrentThickness = txtCurrentThickness.Text != "" ? (float)(double.Parse(txtCurrentThickness.Text) * convUnit.inch) : 0; // in sang mm comp.MinReqThickness = txtMinRequiredThickness.Text != "" ? (float)(double.Parse(txtMinRequiredThickness.Text) * convUnit.inch) : 0; // in sang mm } else { comp.NominalThickness = txtNominalThickness.Text != "" ? (float)(double.Parse(txtNominalThickness.Text) * 1000) : 0; // m sang mm comp.CurrentThickness = txtCurrentThickness.Text != "" ? (float)(double.Parse(txtCurrentThickness.Text) * 1000) : 0; // m sang mm comp.MinReqThickness = txtMinRequiredThickness.Text != "" ? (float)(double.Parse(txtMinRequiredThickness.Text) * 1000) : 0; // m sang mm } if (corrosionRate == "mm/yr") { comp.CurrentCorrosionRate = txtCurrentCorrosionRate.Text != "" ? (float)double.Parse(txtCurrentCorrosionRate.Text) : 0; } else { comp.CurrentCorrosionRate = txtCurrentCorrosionRate.Text != "" ? (float)(double.Parse(txtCurrentCorrosionRate.Text) * convUnit.mil) : 0; // mil/yr sang mm/yr } // end mai comp.BranchDiameter = cbBranchDiameter.Text; comp.BranchJointType = cbJointTypeBranch.Text; comp.BrinnelHardness = cbMaxBrillnessHardness.Text; comp.CracksPresent = chkPresenceCracks.Checked ? 1 : 0; comp.ComplexityProtrusion = cbComplexityProtrusion.Text; comp.ChemicalInjection = chkPresenceInjectionMixPoint.Checked ? 1 : 0; comp.HighlyInjectionInsp = chkHighlyEffectiveMixPoint.Checked ? 1 : 0; comp.CorrectiveAction = cbCorrectiveAction.Text; comp.CyclicLoadingWitin15_25m = cbCyclicLoading.Text; comp.DamageFoundInspection = chkDamageFoundDuringInspection.Checked ? 1 : 0; comp.DeltaFATT = txtDeltaFATT.Text != "" ? float.Parse(txtDeltaFATT.Text) : 0; comp.NumberPipeFittings = cbNumberFittingPipe.Text; comp.PipeCondition = cbPipeCondition.Text; comp.PreviousFailures = cbPreviousFailures.Text; comp.ShakingAmount = cbAmountShakingPipe.Text; comp.ShakingDetected = chkVisibleAudible.Checked ? 1 : 0; comp.ShakingTime = cbAccumalatedTimeShakingPipe.Text; comp.TrampElements = chkTrampElements.Checked ? 1 : 0; //comp.ShellHeight cua shell //comp.ReleasePreventionBarrier = cua tank //comp.ConcreteFoundation = cua tank bottom //comp.SeverityOfVibration cua tank return(comp); }
public RW_COMPONENT getData(int ID, string diameter, string thickness, string corrosionRate, string volumeUnit, string stressUnit) // save vao base { RW_COMPONENT comp = new RW_COMPONENT(); RW_ASSESSMENT_BUS assBus = new RW_ASSESSMENT_BUS(); BUS_UNITS convUnit = new BUS_UNITS(); comp.ID = ID; // Generic Properties if (diameter == "MM") { comp.NominalDiameter = txtNominalDiameter.Text != "" ? float.Parse(txtNominalDiameter.Text) : 0; } else if (diameter == "INCH") { comp.NominalDiameter = txtNominalDiameter.Text != "" ? (float)(double.Parse(txtNominalDiameter.Text) * convUnit.inch) : 0; // in sang mm } if (thickness == "MM") { comp.CurrentThickness = txtCurrentThickness.Text != "" ? float.Parse(txtCurrentThickness.Text) : 0; comp.NominalThickness = txtNominalThickness.Text != "" ? float.Parse(txtNominalThickness.Text) : 0; comp.MinReqThickness = txtMinRequiredThickness.Text != "" ? float.Parse(txtMinRequiredThickness.Text) : 0; comp.BrittleFractureThickness = txtBrittleFractureThickness.Text != "" ? float.Parse(txtBrittleFractureThickness.Text) : 0; comp.StructuralThickness = txtStructuralThickness.Text != "" ? float.Parse(txtStructuralThickness.Text) : 0; } else if (thickness == "INCH") { comp.CurrentThickness = txtCurrentThickness.Text != "" ? (float)(double.Parse(txtCurrentThickness.Text) * convUnit.inch) : 0; comp.NominalThickness = txtNominalThickness.Text != "" ? (float)(double.Parse(txtNominalThickness.Text) * convUnit.inch) : 0; // in sang mm comp.MinReqThickness = txtMinRequiredThickness.Text != "" ? (float)(double.Parse(txtMinRequiredThickness.Text) * convUnit.inch) : 0; // in sang mm comp.BrittleFractureThickness = txtBrittleFractureThickness.Text != "" ? (float)(double.Parse(txtBrittleFractureThickness.Text) * convUnit.inch) : 0; comp.StructuralThickness = txtStructuralThickness.Text != "" ? (float)(double.Parse(txtStructuralThickness.Text) * convUnit.inch) : 0; } if (corrosionRate == "MMYR") { comp.CurrentCorrosionRate = txtCurrentCorrosionRate.Text != "" ? (float)double.Parse(txtCurrentCorrosionRate.Text) : 0; } else { comp.CurrentCorrosionRate = txtCurrentCorrosionRate.Text != "" ? (float)(double.Parse(txtCurrentCorrosionRate.Text) * convUnit.mil) : 0; // mil/yr sang mm/yr } if (volumeUnit == "M3") { comp.ComponentVolume = txtComponentVolume.Text != "" ? float.Parse(txtComponentVolume.Text) : 0; } else { comp.ComponentVolume = txtComponentVolume.Text != "" ? (float)(double.Parse(txtComponentVolume.Text) * convUnit.ft3) : 0; } if (stressUnit == "KSI") { comp.AllowableStress = txtAllowableStress.Text != "" ? (float)(double.Parse(txtAllowableStress.Text) * convUnit.ksi) : 0; } else if (stressUnit == "PSI") { comp.AllowableStress = txtAllowableStress.Text != "" ? (float)(double.Parse(txtAllowableStress.Text) * convUnit.psi) : 0; } else if (stressUnit == "MPA") { comp.AllowableStress = txtAllowableStress.Text != "" ? float.Parse(txtAllowableStress.Text) : 0; } else if (stressUnit == "BAR") { comp.AllowableStress = txtAllowableStress.Text != "" ? (float)(double.Parse(txtAllowableStress.Text) * convUnit.bar) :0; } else if (stressUnit == "NM2") { comp.AllowableStress = txtAllowableStress.Text != "" ? (float)(double.Parse(txtAllowableStress.Text) * convUnit.NpM2) :0; } else { comp.AllowableStress = txtAllowableStress.Text != "" ? (float)(double.Parse(txtAllowableStress.Text) * convUnit.NpCM2) : 0; } comp.WeldJointEfficiency = txtWeldJointEfficiency.Text != "" ? float.Parse(txtWeldJointEfficiency.Text) : 0; comp.ConfidenceCorrosionRate = cbConfidenceCorrosionRate.Text; comp.CracksPresent = chkPresenceCracks.Checked ? 1 : 0; comp.MinimumStructuralThicknessGoverns = chkMinimumStructuralThicknessGoverns.Checked ? 1 : 0; //Governing Brittle Fracture Damage Factor comp.DeltaFATT = txtDeltaFATT.Text != "" ? float.Parse(txtDeltaFATT.Text) : 0; comp.FabricatedSteel = chkFabricatedSteel.Checked ? 1 : 0; comp.EquipmentSatisfied = chkEquipmentSatisfied.Checked ? 1 : 0; comp.NominalOperatingConditions = chkNominalOperating.Checked ? 1 : 0; comp.CETGreaterOrEqual = chkCETGreaterOrEqual.Checked ? 1 : 0; comp.CyclicServiceFatigueVibration = chkCyclicServiceFatigueVibration.Checked ? 1 : 0; comp.EquipmentCircuitShock = chkEquipmentCircuitShock.Checked ? 1 : 0; //High Temperatur Hydrogen Attack Damage Factor comp.HTHADamageObserved = chkHTHADamageObserved.Checked ? 1 : 0; //Governing Stress Corrosion Cracking Damage Factor comp.BrinnelHardness = cbMaxBrillnessHardness.Text; //Governing External Damage Factor comp.ComplexityProtrusion = cbComplexityProtrusion.Text; //Fatigue Damage Factor comp.BranchDiameter = cbBranchDiameter.Text; comp.BranchJointType = cbJointTypeBranch.Text; comp.CorrectiveAction = cbCorrectiveAction.Text; comp.CyclicLoadingWitin15_25m = cbCyclicLoading.Text; comp.NumberPipeFittings = cbNumberFittingPipe.Text; comp.PipeCondition = cbPipeCondition.Text; comp.PreviousFailures = cbPreviousFailures.Text; comp.ShakingAmount = cbAmountShakingPipe.Text; comp.ShakingDetected = chkVisibleAudible.Checked ? 1 : 0; comp.ShakingTime = cbAccumalatedTimeShakingPipe.Text; return(comp); }