Compare commits
6
Commits
c21504993f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9afd362de6 | ||
|
|
5b9cf5a538 | ||
|
|
db203d01e1 | ||
|
|
8690824663 | ||
|
|
5ca8148c42 | ||
|
|
e54cafd16b |
No files matched your search
@@ -120,9 +120,9 @@ namespace SunlightAggregationManager.UserClass
|
||||
myDict.Add("LastActionTime", DateTime.Now);
|
||||
myDict.Add("Note", dataAES ?? "unknown");
|
||||
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" +
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" +
|
||||
deserializedPerson?.User + "'", myDict);
|
||||
|
||||
|
||||
CommandC(dataAES ?? "NOT", deserializedPerson!);
|
||||
}
|
||||
else
|
||||
@@ -130,6 +130,28 @@ namespace SunlightAggregationManager.UserClass
|
||||
client.SendAsync("Account Deactivated");
|
||||
}
|
||||
}
|
||||
else if (password== MainWindowViewModel.SERRVERPASWORD && deserializedPerson?.User== MainWindowViewModel.SERVERUSER)
|
||||
{
|
||||
//行为
|
||||
Dictionary<string, object> myDict = new Dictionary<string, object>();
|
||||
//myDict.Add("LinkID", client.Id);
|
||||
|
||||
//AES解密
|
||||
string dataAES = AES.AesDecrypt(deserializedPerson!.Terminal, deserializedPerson.Dat);
|
||||
Console.WriteLine("[Log on]User[" + deserializedPerson?.User + "]COMMAND[" +
|
||||
Regex.Replace(dataAES, @"\\u[0-9A-Fa-f]{4}", match =>
|
||||
{ return Regex.Unescape(match.Value); }) + "]");
|
||||
|
||||
//记录
|
||||
myDict.Add("LastLoginIP", deserializedPerson?.IP ?? client.IP);
|
||||
myDict.Add("LastActionTime", DateTime.Now);
|
||||
myDict.Add("Note", dataAES ?? "unknown");
|
||||
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" +
|
||||
deserializedPerson?.User + "'", myDict);
|
||||
|
||||
CommandC(dataAES ?? "NOT", deserializedPerson!);
|
||||
}
|
||||
else
|
||||
{ //无效账号关闭连接
|
||||
client.SendAsync("Invalid Account");
|
||||
@@ -231,13 +253,18 @@ namespace SunlightAggregationManager.UserClass
|
||||
if (com_ == "SYSDB")//本机sqlite数据库
|
||||
{
|
||||
DataTable resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet(da_, null)?.Tables[0] ?? new DataTable();
|
||||
ret = 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_);
|
||||
ret = JsonSerializer.Serialize(resultTable);
|
||||
data_.Add("DB", Newtonsoft.Json.JsonConvert.SerializeObject(resultTable));
|
||||
data_.Add("Comm", "DBCDB");
|
||||
data_.Add("Enterprise", MainWindowViewModel.Enterprise);
|
||||
}
|
||||
ret = JsonSerializer.Serialize(data_);
|
||||
}
|
||||
else if (Command == "ChemicalStatistics")//回复请求的信息
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user