diff --git a/QueryDetail.xaml.cs b/QueryDetail.xaml.cs index f3ac471..f86c033 100644 --- a/QueryDetail.xaml.cs +++ b/QueryDetail.xaml.cs @@ -131,7 +131,7 @@ public partial class QueryDetail : ContentPage } } } - catch (Exception ex) + catch (Exception ) { } } diff --git a/View/LogPage.xaml.cs b/View/LogPage.xaml.cs index 149a7c3..e4bf4e6 100644 --- a/View/LogPage.xaml.cs +++ b/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(); @@ -40,11 +40,13 @@ public partial class LogPage : ContentPage { if (dataRow != null) { + string _SERVER = dataRow.Field("Server")!; + string _SERVERIP = dataRow.Field("ServerID")! + "," + dataRow.Field("ServerHTTP")!; + var dat = new ItemOption { - SERVER = dataRow.Field("Server") ?? "", - SERVERIP = dataRow.Field("ServerID") ?? "" +","+ - dataRow.Field("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); }