<%@ Page Language="vb" Debug="true" %> <% @Import NameSpace="System.Data" %> <% @Import NameSpace="System.Data.SQLClient" %> <% @Import NameSpace="System.Diagnostics.Debug" %> <% @Import Namespace="System.Web.Mail" %> <% @Import Namespace="System.Text.RegularExpressions" %> <% @Import NameSpace="System.Data.OleDb" %> <%@ Import namespace="System.IO" %> <%@ Import namespace="System.Net" %> <% Messaggio.Text = Messaggio.Text & ("


"& Read_File("inc\Lang\Languages.aspx",40) &"

") Dim Codice = DeCripta(Request.QueryString ("Codice")) If Codice = "aggiusta_mura" Then Dim Var_E_Sold_20 sqlConn.Open() sqlComm = New SqlCommand("SELECT Ris_Pietra, E_Sold_19, E_Sold_20 FROM Pianeti JOIN Esercito ON Pianeti.Id = Esercito.Id_Paese WHERE Id = '"& Id_Paese &"' ", sqlConn) r = sqlComm.ExecuteReader() While r.Read() Ris_Pietra = r("Ris_Pietra") Var_E_Sold_20 = r("E_Sold_20") End While r.Close() sqlConn.Close() If Not (Ris_Pietra < (100 - (Split(Var_E_Sold_20,",")(1)/100)) * 100) AND (Split(Var_E_Sold_20,",")(1)/100) > 0 Then sqlConn.Open() sqlComm = New SqlCommand("UPDATE Pianeti SET Ris_Pietra = Ris_Pietra - "& CInt((100 - (Split(Var_E_Sold_20,",")(1)/100)) * 100) &" WHERE Id = '"& Id_Paese &"' ",sqlConn) result = sqlComm.ExecuteNonQuery() sqlConn.Close() Ris_Pietra = Ris_Pietra - CInt((100 - (Split(Var_E_Sold_20,",")(1)/100)) * 100) sqlConn.Open() sqlComm = New SqlCommand("UPDATE Esercito SET E_Sold_20 = '"& Abs(Int(-Var_E_Sold_20))&"' WHERE Id_Paese = '"& Id_Paese &"' ",sqlConn) result = sqlComm.ExecuteNonQuery() sqlConn.Close() Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",480) &"") End If If Ris_Pietra < (100 - (Split(Var_E_Sold_20,",")(1)/100)) * 100 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",482) &"") End If End If If Codice = "aggiusta_torrette" Then Dim Var_E_Sold_19 sqlConn.Open() sqlComm = New SqlCommand("SELECT Ris_Pietra, E_Sold_19, E_Sold_20 FROM Pianeti JOIN Esercito ON Pianeti.Id = Esercito.Id_Paese WHERE Id = '"& Id_Paese &"' ", sqlConn) r = sqlComm.ExecuteReader() While r.Read() Ris_Pietra = r("Ris_Pietra") Var_E_Sold_19 = r("E_Sold_19") End While r.Close() sqlConn.Close() If Not (Ris_Pietra < (100 - (Split(Var_E_Sold_19,",")(1)/100)) * 100) AND (Split(Var_E_Sold_19,",")(1)/100) > 0 Then sqlConn.Open() sqlComm = New SqlCommand("UPDATE Pianeti SET Ris_Pietra = Ris_Pietra - "& CInt((100 - (Split(Var_E_Sold_19,",")(1)/100)) * 100) &" WHERE Id = '"& Id_Paese &"' ",sqlConn) result = sqlComm.ExecuteNonQuery() sqlConn.Close() Ris_Pietra = Ris_Pietra - CInt((100 - (Split(Var_E_Sold_19,",")(1)/100)) * 100) sqlConn.Open() sqlComm = New SqlCommand("UPDATE Esercito SET E_Sold_19 = '"& Abs(Int(-Var_E_Sold_19))&"' WHERE Id_Paese = '"& Id_Paese &"' ",sqlConn) result = sqlComm.ExecuteNonQuery() sqlConn.Close() Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",481) &"") End If If Ris_Pietra < (100 - (Split(Var_E_Sold_19,",")(1)/100)) * 100 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",482) &"") End If End If If Len(Codice) < 2 Then sqlConn.Open() sqlComm = New SqlCommand("SELECT Ris_Pietra, E_Sold_19, E_Sold_20 FROM Pianeti JOIN Esercito ON Pianeti.Id = Esercito.Id_Paese WHERE Id = '"& Id_Paese &"' ", sqlConn) r = sqlComm.ExecuteReader() While r.Read() Dim arr_M() = (Split(CStr(r("E_Sold_20")),",")) Dim arr_T() = (Split(CStr(r("E_Sold_19")),",")) Redim Preserve arr_M(1) Redim Preserve arr_T(1) If arr_M(1) <> "" Then If (Split(r("E_Sold_20"),",")(1)/100) > 0 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",476) &" "& (Split(r("E_Sold_20"),",")(1)/100) &" %") End If End If Messaggio.Text = Messaggio.Text & ("

") If arr_T(1) <> "" Then If (Split(r("E_Sold_19"),",")(1)/100) > 0 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",477) &" "& (Split(r("E_Sold_19"),",")(1)/100) &" %") End If End If Messaggio.Text = Messaggio.Text & ("


") If arr_M(1) <> "" Then If (Split(r("E_Sold_20"),",")(1)/100) > 0 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",478) & CInt((100 - (Split(r("E_Sold_20"),",")(1)/100)) * 100) &" "& Read_File("inc\Lang\Languages.aspx",461) &"

") End If End If If arr_T(1) <> "" Then If (Split(r("E_Sold_19"),",")(1)/100) > 0 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",479) & CInt((100 - (Split(r("E_Sold_19"),",")(1)/100)) * 100) &" "& Read_File("inc\Lang\Languages.aspx",461) &"") End If End If If arr_M(1) = 0 AND arr_T(1) = 0 Then Messaggio.Text = Messaggio.Text & ("

"& Read_File("inc\Lang\Languages.aspx",483)) End If End While r.Close() sqlConn.Close() End If %>