添加添加数据库服务器表
修改扫码连接修复扫码闪退问题
This commit is contained in:
1 parent
6c0af56ea9
commit
0801e4875c
64 files changed
+3265
No files matched your search
@@ -0,0 +1,59 @@
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using SunlightAggregationTerminal.Class;
|
||||
using SunlightAggregationTerminal.Models;
|
||||
using System.Data;
|
||||
|
||||
namespace SunlightAggregationTerminal.View;
|
||||
|
||||
public partial class LogPage : ContentPage
|
||||
{
|
||||
public LogPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
WeakReferenceMessenger.Default.Register<string>(this, (r, scannedValue) =>
|
||||
{
|
||||
Enterprise.Text = scannedValue;
|
||||
});
|
||||
}
|
||||
|
||||
private void OnScanButtonClicked(object sender, EventArgs e)
|
||||
{
|
||||
// 跳转到扫码页面
|
||||
var scanPage = new ScanPage(3);
|
||||
Navigation.PushAsync(scanPage);
|
||||
}
|
||||
|
||||
private async void Log_Clicked(object sender, EventArgs e)//登录
|
||||
{
|
||||
TcpServer.Configuration(Enterprise.Text, UsernameEntry.Text, PasswordEntry.Text,
|
||||
Models.AppModels.GetAppUniqueId());
|
||||
|
||||
// while(!App.GlobalData.LogNo);
|
||||
/*
|
||||
var temp_name = AppModels.Select("SELECT * FROM Users WHERE User='" + UsernameEntry.Text + "' LIMIT 1;");
|
||||
if (temp_name != null)
|
||||
{
|
||||
//存在更新账号状态
|
||||
//var name = temp_name.Tables[0].AsEnumerable().FirstOrDefault();
|
||||
|
||||
string sql = @"UPDATE Users SET ServerID = '" + Enterprise.Text
|
||||
+ "', UserPassword = '" + PasswordEntry.Text+
|
||||
"', LogNo = true WHERE User='" + UsernameEntry.Text + "';";
|
||||
AppModels.Updata(sql);
|
||||
}
|
||||
else
|
||||
{
|
||||
//插入账号
|
||||
string sql = @"INSERT INTO Users (User,UserId ,UserName ,UserPassword ,
|
||||
Enterprise ,Department ,ServerID ,Groups ,
|
||||
ProxyID ,LogNo ,LocalAreaNetworkMode ,DarkMode ,
|
||||
MessageNotificationMode ,GUID
|
||||
)VALUES('"+ UsernameEntry.Text + "','SUNLIGHT','SUNLIGHT','"+ PasswordEntry.Text +
|
||||
"','SUNLIGHT','ENGINEER','"+ Enterprise.Text + "','ENGINEER',"+
|
||||
" '',0,0,0,0,'" + Models.AppModels.GetAppUniqueId() + "');";
|
||||
AppModels.INSERT(sql);
|
||||
}*/
|
||||
await Navigation.PopModalAsync();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user