public void ShowDataTank(int ID) { groupBox4.Hide(); RW_CA_TANK_BUS busTank = new RW_CA_TANK_BUS(); RW_CA_TANK ca = busTank.getData(ID); txtFC.Text = (ca.FC_Environ + ca.FC_Environ_Leak + ca.FC_Environ_Rupture).ToString(); txtCA.Text = ca.ConsequenceCategory; }
private void initData_Shell(int ID) { RW_CA_TANK_BUS busCA_Tank = new RW_CA_TANK_BUS(); RW_CA_TANK caTank = busCA_Tank.getData(ID); tbFlowRateShellD1.Text = caTank.Flow_Rate_D1.ToString(); tbFlowRateShellD2.Text = caTank.Flow_Rate_D2.ToString(); tbFlowRateShellD3.Text = caTank.Flow_Rate_D3.ToString(); tbFlowRateShellD4.Text = caTank.Flow_Rate_D4.ToString(); tbLeakDurationShellD1.Text = caTank.Leak_Duration_D1.ToString(); tbLeakDurationShellD2.Text = caTank.Leak_Duration_D2.ToString(); tbLeakDurationShellD3.Text = caTank.Leak_Duration_D3.ToString(); tbLeakDurationShellD4.Text = caTank.Leak_Duration_D4.ToString(); tbReleaseVolumeLeakageShellD1.Text = caTank.Release_Volume_Leak_D1.ToString(); tbReleaseVolumeLeakageShellD2.Text = caTank.Release_Volume_Leak_D2.ToString(); tbReleaseVolumeLeakageShellD3.Text = caTank.Release_Volume_Leak_D3.ToString(); tbReleaseVolumeLeakageShellD4.Text = caTank.Release_Volume_Leak_D4.ToString(); tbReleaseVolumeRuptureShell.Text = caTank.Release_Volume_Rupture.ToString(); tbTimeLeakageGroundWaterShell.Text = caTank.Time_Leak_Ground.ToString(); tbVolumeSubsoilShellD1.Text = caTank.Volume_SubSoil_Leak_D1.ToString(); tbVolumeSubsoilShellD4.Text = caTank.Volume_SubSoil_Leak_D4.ToString(); tbVolumeGroundWaterShellD1.Text = caTank.Volume_Ground_Water_Leak_D1.ToString(); tbVolumeGroundWaterShellD4.Text = caTank.Volume_Ground_Water_Leak_D4.ToString(); tbDikeRuptureShell.Text = caTank.Barrel_Dike_Rupture.ToString(); tbOn_siteShell.Text = caTank.Barrel_Onsite_Rupture.ToString(); tbIn_siteShell.Text = caTank.Barrel_Offsite_Rupture.ToString(); tbReachWaterRuptureShell.Text = caTank.Barrel_Water_Rupture.ToString(); tbFCleakageShell.Text = caTank.FC_Environ_Leak.ToString(); tbFCruptureShell.Text = caTank.FC_Environ_Rupture.ToString(); tbTotalF_Shell.Text = caTank.FC_Environ.ToString(); tbComponentDamageCost.Text = caTank.Component_Damage_Cost.ToString(); tbCostBussinessInterruptionShell.Text = caTank.Business_Cost.ToString(); tbTotalConsequenceShell.Text = caTank.Consequence.ToString(); tbConsequenceCategoryShell.Text = caTank.ConsequenceCategory; }
private void initData_Tank(int ID) { RW_CA_TANK_BUS busCA_Tank = new RW_CA_TANK_BUS(); RW_CA_TANK caTank = busCA_Tank.getData(ID); tbHdraulicFluid.Text = caTank.Hydraulic_Fluid.ToString(); tbHdraulicWater.Text = caTank.Hydraulic_Water.ToString(); tbSeepageVelocity.Text = caTank.Seepage_Velocity.ToString(); tbFlowRateD1.Text = caTank.Flow_Rate_D1.ToString(); tbFlowRateD4.Text = caTank.Flow_Rate_D4.ToString(); tbLeakDurationD1.Text = caTank.Leak_Duration_D1.ToString(); tbLeakDurationD4.Text = caTank.Leak_Duration_D4.ToString(); tbRealeaseVolumeFromLeakageD1.Text = caTank.Release_Volume_Leak_D1.ToString(); //MessageBox.Show(caTank.Release_Volume_Leak_D1.ToString()); // MessageBox.Show(caTank.FC_Environ_Rupture.ToString()); tbRealeaseVolumeFromLeakageD4.Text = caTank.Release_Volume_Leak_D4.ToString(); tbReleaseVolumeFromRuptureD1.Text = caTank.Release_Volume_Rupture_D1.ToString(); tbReleaseVolumeFromRuptureD4.Text = caTank.Release_Volume_Rupture_D4.ToString(); tbTimeToInitiate.Text = caTank.Time_Leak_Ground.ToString(); // MessageBox.Show(caTank.Time_Leak_Ground.ToString()); tbVolumeSubsoilFromLeakageD1.Text = caTank.Volume_SubSoil_Leak_D1.ToString(); tbVolumeSubsoilFromLeakageD4.Text = caTank.Volume_SubSoil_Leak_D4.ToString(); tbVolumeGroundWaterFromLeakageD1.Text = caTank.Volume_Ground_Water_Leak_D1.ToString(); tbVolumeGroundWaterFromLeakageD4.Text = caTank.Volume_Ground_Water_Leak_D4.ToString(); tbWithinTheDike.Text = caTank.Barrel_Dike_Rupture.ToString(); tbWithinTheDike.Text = caTank.Barrel_Dike_Rupture.ToString(); tbOnsiteRupture.Text = caTank.Barrel_Onsite_Rupture.ToString(); tbOffsiteRupture.Text = caTank.Barrel_Offsite_Rupture.ToString(); tbReachWater.Text = caTank.Barrel_Water_Rupture.ToString(); tbFC_Env_Leakage.Text = caTank.FC_Environ_Leak.ToString(); tbFC_Env_Rupture.Text = caTank.FC_Environ_Rupture.ToString(); tbMaterialFactor.Text = caTank.Material_Factor.ToString(); tbTotalCost.Text = caTank.FC_Environ.ToString(); tbComponentDamageCost.Text = caTank.Component_Damage_Cost.ToString(); tbCostOfBusinessInterruption.Text = caTank.Business_Cost.ToString(); tbTotalConsequence.Text = caTank.Consequence.ToString(); tbConsequenceCategory.Text = caTank.ConsequenceCategory; }
public void delete(RW_CA_TANK obj) { DAL.delete(obj.ID); }
public void edit(RW_CA_TANK obj) { DAL.edit(obj.ID, obj.Hydraulic_Water, obj.Hydraulic_Fluid, obj.Seepage_Velocity, obj.Flow_Rate_D1, obj.Flow_Rate_D2, obj.Flow_Rate_D3, obj.Flow_Rate_D4, obj.Leak_Duration_D1, obj.Leak_Duration_D2, obj.Leak_Duration_D3, obj.Leak_Duration_D4, obj.Release_Volume_Leak_D1, obj.Release_Volume_Leak_D2, obj.Release_Volume_Leak_D3, obj.Release_Volume_Leak_D4, obj.Release_Volume_Rupture, obj.Liquid_Height, obj.Volume_Fluid, obj.Time_Leak_Ground, obj.Volume_SubSoil_Leak_D1, obj.Volume_SubSoil_Leak_D4, obj.Volume_Ground_Water_Leak_D1, obj.Volume_Ground_Water_Leak_D4, obj.Barrel_Dike_Leak, obj.Barrel_Dike_Rupture, obj.Barrel_Onsite_Leak, obj.Barrel_Onsite_Rupture, obj.Barrel_Offsite_Leak, obj.Barrel_Offsite_Rupture, obj.Barrel_Water_Leak, obj.Barrel_Water_Rupture, obj.FC_Environ_Leak, obj.FC_Environ_Rupture, obj.FC_Environ, obj.Material_Factor, obj.Component_Damage_Cost, obj.Business_Cost, obj.Consequence, obj.ConsequenceCategory); }
public RW_CA_TANK getData(int ID) { RW_CA_TANK obj = new RW_CA_TANK(); SqlConnection conn = MSSQLDBUtils.GetDBConnection(); conn.Open(); String sql = "USE [rbi] " + "SELECT [Hydraulic_Water] " + ",[Hydraulic_Fluid] " + ",[Seepage_Velocity] " + ",[Flow_Rate_D1] " + ",[Flow_Rate_D2] " + ",[Flow_Rate_D3] " + ",[Flow_Rate_D4] " + ",[Leak_Duration_D1] " + ",[Leak_Duration_D2] " + ",[Leak_Duration_D3] " + ",[Leak_Duration_D4] " + ",[Release_Volume_Leak_D1] " + ",[Release_Volume_Leak_D2] " + ",[Release_Volume_Leak_D3] " + ",[Release_Volume_Leak_D4] " + ",[Release_Volume_Rupture] " + ",[Liquid_Height] " + ",[Volume_Fluid] " + ",[Time_Leak_Ground] " + ",[Volume_SubSoil_Leak_D1] " + ",[Volume_SubSoil_Leak_D4] " + ",[Volume_Ground_Water_Leak_D1] " + ",[Volume_Ground_Water_Leak_D4] " + ",[Barrel_Dike_Leak] " + ",[Barrel_Dike_Rupture] " + ",[Barrel_Onsite_Leak] " + ",[Barrel_Onsite_Rupture] " + ",[Barrel_Offsite_Leak] " + ",[Barrel_Offsite_Rupture] " + ",[Barrel_Water_Leak] " + ",[Barrel_Water_Rupture] " + ",[FC_Environ_Leak] " + ",[FC_Environ_Rupture] " + ",[FC_Environ] " + ",[Material_Factor] " + ",[Component_Damage_Cost] " + ",[Business_Cost] " + ",[Consequence] " + ",[ConsequenceCategory] " + " FROM [rbi].[dbo].[RW_CA_TANK] WHERE [ID] ='" + ID + "'"; try { SqlCommand cmd = new SqlCommand(); cmd.Connection = conn; cmd.CommandText = sql; using (DbDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { if (reader.HasRows) { obj.ID = ID; obj.Hydraulic_Water = (float)reader.GetDouble(0); obj.Hydraulic_Fluid = (float)reader.GetDouble(1); obj.Seepage_Velocity = (float)reader.GetDouble(2); obj.Flow_Rate_D1 = (float)reader.GetDouble(3); obj.Flow_Rate_D2 = (float)reader.GetDouble(4); obj.Flow_Rate_D3 = (float)reader.GetDouble(5); obj.Flow_Rate_D4 = (float)reader.GetDouble(6); obj.Leak_Duration_D1 = (float)reader.GetDouble(7); obj.Leak_Duration_D2 = (float)reader.GetDouble(8); obj.Leak_Duration_D3 = (float)reader.GetDouble(9); obj.Leak_Duration_D4 = (float)reader.GetDouble(10); obj.Release_Volume_Leak_D1 = (float)reader.GetDouble(11); obj.Release_Volume_Leak_D2 = (float)reader.GetDouble(12); obj.Release_Volume_Leak_D3 = (float)reader.GetDouble(13); obj.Release_Volume_Leak_D4 = (float)reader.GetDouble(14); obj.Release_Volume_Rupture = (float)reader.GetDouble(15); obj.Liquid_Height = (float)reader.GetDouble(16); obj.Volume_Fluid = (float)reader.GetDouble(17); obj.Time_Leak_Ground = (float)reader.GetDouble(18); obj.Volume_SubSoil_Leak_D1 = (float)reader.GetDouble(19); obj.Volume_SubSoil_Leak_D4 = (float)reader.GetDouble(20); obj.Volume_Ground_Water_Leak_D1 = (float)reader.GetDouble(21); obj.Volume_Ground_Water_Leak_D4 = (float)reader.GetDouble(22); obj.Barrel_Dike_Leak = (float)reader.GetDouble(23); obj.Barrel_Dike_Rupture = (float)reader.GetDouble(24); obj.Barrel_Onsite_Leak = (float)reader.GetDouble(25); obj.Barrel_Onsite_Rupture = (float)reader.GetDouble(26); obj.Barrel_Offsite_Leak = (float)reader.GetDouble(27); obj.Barrel_Offsite_Rupture = (float)reader.GetDouble(28); obj.Barrel_Water_Leak = (float)reader.GetDouble(29); obj.Barrel_Water_Rupture = (float)reader.GetDouble(30); obj.FC_Environ_Leak = (float)reader.GetDouble(31); obj.FC_Environ_Rupture = (float)reader.GetDouble(32); obj.FC_Environ = (float)reader.GetDouble(33); obj.Material_Factor = (float)reader.GetDouble(34); obj.Component_Damage_Cost = (float)reader.GetDouble(35); obj.Business_Cost = (float)reader.GetDouble(36); obj.Consequence = (float)reader.GetDouble(37); obj.ConsequenceCategory = reader.GetString(38); } } } } catch { MessageBox.Show("GET DATA FAIL!", "ERROR!"); } finally { conn.Close(); conn.Dispose(); } return(obj); }
private void initData_Shell(int ID) { RW_CA_TANK_BUS busCA_Tank = new RW_CA_TANK_BUS(); RW_CA_TANK caTank = busCA_Tank.getData(ID); #region consequences area tbFlowRateShellD1.Text = caTank.Flow_Rate_D1.ToString(); tbFlowRateShellD2.Text = caTank.Flow_Rate_D2.ToString(); tbFlowRateShellD3.Text = caTank.Flow_Rate_D3.ToString(); tbFlowRateShellD4.Text = caTank.Flow_Rate_D4.ToString(); tbLeakDurationShellD1.Text = caTank.Leak_Duration_D1.ToString(); tbLeakDurationShellD2.Text = caTank.Leak_Duration_D2.ToString(); tbLeakDurationShellD3.Text = caTank.Leak_Duration_D3.ToString(); tbLeakDurationShellD4.Text = caTank.Leak_Duration_D4.ToString(); tbReleaseVolumeLeakageShellD1.Text = caTank.Release_Volume_Leak_D1.ToString(); tbReleaseVolumeLeakageShellD2.Text = caTank.Release_Volume_Leak_D2.ToString(); tbReleaseVolumeLeakageShellD3.Text = caTank.Release_Volume_Leak_D3.ToString(); tbReleaseVolumeLeakageShellD4.Text = caTank.Release_Volume_Leak_D4.ToString(); tbReleaseVolumeLeakageShellD1.Text = caTank.Release_Volume_Leak_D1.ToString(); tbReleaseVolumeLeakageShellD2.Text = caTank.Release_Volume_Leak_D2.ToString(); tbReleaseVolumeLeakageShellD3.Text = caTank.Release_Volume_Leak_D3.ToString(); tbReleaseVolumeLeakageShellD4.Text = caTank.Release_Volume_Leak_D4.ToString(); tbTimeLeakageGroundWaterShell.Text = caTank.Time_Leak_Ground.ToString(); tbVolumeSubsoilShellD1.Text = caTank.Volume_SubSoil_Leak_D1.ToString(); tbVolumeSubsoilShellD4.Text = caTank.Volume_SubSoil_Leak_D4.ToString(); tbVolumeGroundWaterShellD1.Text = caTank.Volume_Ground_Water_Leak_D1.ToString(); tbVolumeGroundWaterShellD4.Text = caTank.Volume_Ground_Water_Leak_D4.ToString(); tbDikeRuptureShell.Text = caTank.Barrel_Dike_Rupture.ToString(); tbOn_siteShell.Text = caTank.Barrel_Onsite_Rupture.ToString(); tbIn_siteShell.Text = caTank.Barrel_Offsite_Rupture.ToString(); tbReachWaterRuptureShell.Text = caTank.Barrel_Water_Rupture.ToString(); tbFCleakageShell.Text = caTank.FC_Environ_Leak.ToString(); tbFCruptureShell.Text = caTank.FC_Environ_Rupture.ToString(); tbTotalF_Shell.Text = caTank.FC_Environ.ToString(); tbComponentDamageCost.Text = caTank.Component_Damage_Cost.ToString(); tbCostBussinessInterruptionShell.Text = caTank.Business_Cost.ToString(); tbTotalConsequenceShell.Text = caTank.Consequence.ToString(); tbConsequenceCategoryShell.Text = caTank.ConsequenceCategory; #endregion #region Tab COF Financial for Shell tbWithinDikeLeakageShell.Text = caTank.Barrel_Dike_Leak.ToString(); tbWithinDikeRuptureShell.Text = caTank.Barrel_Dike_Rupture.ToString(); tbOn_siteLeakageShell.Text = caTank.Barrel_Onsite_Leak.ToString(); tbOn_siteRuptureShell.Text = caTank.Barrel_Onsite_Rupture.ToString(); tbOff_siteLeakageShell.Text = caTank.Barrel_Offsite_Leak.ToString(); tbOff_siteRupureShell.Text = caTank.Barrel_Offsite_Rupture.ToString(); txtReachWaterLeakageShell.Text = caTank.Barrel_Water_Leak.ToString(); txtReachWaterRuptureShell.Text = caTank.Barrel_Water_Rupture.ToString(); tbFCenvLeakageShell.Text = caTank.FC_Environ_Leak.ToString(); tbFCenvRuptureShell.Text = caTank.FC_Environ_Rupture.ToString(); tbTotalFCenvShell.Text = caTank.FC_Environ.ToString(); tbComponentDamageCostShell.Text = caTank.Component_Damage_Cost.ToString(); //tbDamageSurroundEquipmentShell.Text = caTank. tbCostOfBusinessInterruptionShell.Text = caTank.Business_Cost.ToString(); //tbCostAssociatedPersonInjury.Text = #endregion }