Administrator 1 month ago
parent
commit
aea7c945ae
  1. 2
      QueryDetail.xaml.cs
  2. 17
      View/LogPage.xaml.cs

2
QueryDetail.xaml.cs

@ -131,7 +131,7 @@ public partial class QueryDetail : ContentPage
}
}
}
catch (Exception ex)
catch (Exception )
{
}
}

17
View/LogPage.xaml.cs

@ -29,7 +29,7 @@ public partial class LogPage : ContentPage
//可用服务器列表
AppModels.sqliteHelper.Open();
var userdata = AppModels.sqliteHelper.ExecuteDataSet("select * from Server", null);
var userdata = AppModels.sqliteHelper.ExecuteDataSet("SELECT * FROM Server", null);
AppModels.sqliteHelper.Close();
Items = new ObservableCollection<ItemOption>();
@ -40,11 +40,13 @@ public partial class LogPage : ContentPage
{
if (dataRow != null)
{
string _SERVER = dataRow.Field<string>("Server")!;
string _SERVERIP = dataRow.Field<string>("ServerID")! + "," + dataRow.Field<string>("ServerHTTP")!;
var dat = new ItemOption
{
SERVER = dataRow.Field<string>("Server") ?? "",
SERVERIP = dataRow.Field<string>("ServerID") ?? "" +","+
dataRow.Field<string>("ServerHTTP") ?? ""
SERVER = _SERVER,
SERVERIP = _SERVERIP
};
Items.Add(dat);
}
@ -82,9 +84,10 @@ public partial class LogPage : ContentPage
App.GlobalData.ServerID = result[0]?? "";
//判断是否有http连接信息
if (result.Length == 2)
if (result.Length ==2)
{
App.GlobalData.ServerHTTP = result[1] ?? "";
App.GlobalData.LocalAreaNetworkMode = false;
}
else
{
@ -121,11 +124,11 @@ public partial class LogPage : ContentPage
AppModels.INSERT(sql);
}
int temp_server = AppModels.Select("SELECT * FROM Server WHERE ServerID='' LIMIT 1;")!.Tables[0].Rows.Count;
int temp_server = AppModels.Select("SELECT * FROM Server WHERE Server='"+ App.GlobalData.Enterprise + "' LIMIT 1;")!.Tables[0].Rows.Count;
if (temp_server == 0)
{
string sql = @"INSERT INTO Server ( Server, ServerID,ServerHTTP)VALUES('" + App.GlobalData.Enterprise + "','" +
App.GlobalData.ServerID+ App.GlobalData.ServerHTTP + "');";
App.GlobalData.ServerID+"','"+ App.GlobalData.ServerHTTP + "');";
AppModels.INSERT(sql);
}

Loading…
Cancel
Save