Protected Sub calculatememButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calculatememButton.Click Dim E_member As Double Dim W_member As Double Dim E_result As String Dim w_result As String Dim e_factor As Double Dim w_factor As Double E_member = electricitytxtmem.Text W_member = watertxtmem.Text E_result = E_result_mem_lbl.Text w_result = W_result_mem_lbl.Text e_factor = e_mem_f_DropDownList.Text w_factor = W_mem_f_DropDownList.Text E_result = E_member * e_factor w_result = W_member * w_factor If IsDBNull(objReader("E_result")) = False Then E_result_mem_lbl.Text = " * The value you've entered is: ( " & E_member & " ) and this value represents your Electrecity consumption rate for building 1. <br> <br> * Your Electricity carbon footprint is: (" & E_result & ") Metric Tons." ElseIf IsDBNull(objReader("E_result")) = True Then W_result_mem_lbl.Text = "* The value you've entered is: ( " & W_member & " ) and this value represents your Water consumption rate for building 1. <br> <br> * Your water carbon footprint is: (" & w_result & ") Metric tons." Else Response.Write.("") End If End Sub
Protected Sub calculatememButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calculatememButton.Click
Dim E_member As Double
Dim W_member As Double
Dim E_result As String
Dim w_result As String
Dim e_factor As Double
Dim w_factor As Double
E_member = electricitytxtmem.Text
W_member = watertxtmem.Text
E_result = E_result_mem_lbl.Text
w_result = W_result_mem_lbl.Text
e_factor = e_mem_f_DropDownList.Text
w_factor = W_mem_f_DropDownList.Text
E_result = E_member * e_factor
w_result = W_member * w_factor
If IsDBNull(objReader("E_result")) = False Then
E_result_mem_lbl.Text = " * The value you've entered is: ( " & E_member & " ) and this value represents your Electrecity consumption rate for building 1. <br> <br> * Your Electricity carbon footprint is: (" & E_result & ") Metric Tons."
ElseIf
IsDBNull(objReader("E_result")) = True Then
W_result_mem_lbl.Text = "* The value you've entered is: ( " & W_member & " ) and this value represents your Water consumption rate for building 1. <br> <br> * Your water carbon footprint is: (" & w_result & ") Metric tons."
Else
Response.Write.("")
End If
End Sub