Compare commits

..
4 Commits
2 changed files with 11 additions and 6 deletions

No files matched your search

+3 -3
View File
@@ -130,7 +130,7 @@ namespace SunlightAggregationManager.UserClass
client.SendAsync("Account Deactivated");
}
}
else if (password== "SERRVERPASWORD" && deserializedPerson?.User== "SERVERUSER")
else if (password== MainWindowViewModel.SERRVERPASWORD && deserializedPerson?.User== MainWindowViewModel.SERVERUSER)
{
//行为
Dictionary<string, object> myDict = new Dictionary<string, object>();
@@ -253,14 +253,14 @@ namespace SunlightAggregationManager.UserClass
if (com_ == "SYSDB")//本机sqlite数据库
{
DataTable resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet(da_, null)?.Tables[0] ?? new DataTable();
data_.Add("DB", JsonSerializer.Serialize(resultTable));
data_.Add("DB", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
data_.Add("Comm", "SYSDB");
data_.Add("Enterprise", MainWindowViewModel.Enterprise);
}
else if (com_ == "DBCDB")//系统dbc数据库
{
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync(da_);
data_.Add("DB", JsonSerializer.Serialize(resultTable));
data_.Add("DB", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
data_.Add("Comm", "DBCDB");
data_.Add("Enterprise", MainWindowViewModel.Enterprise);
}
+8 -3
View File
@@ -324,9 +324,14 @@ namespace SunlightAggregationManager.ViewModel
{
lock (DB)
{
DataRow drEmployee = DB.Select(key).First();
object? index = drEmployee.Field<object>(name);
return index;
DataRow[] dataRows = DB.Select(key);
if (dataRows.Count() > 0)
{
DataRow drEmployee = dataRows.First();
object? index = drEmployee.Field<object>(name);
return index;
}
else { return null; }
}
}
catch (Exception ex)