添加项目文件。

This commit is contained in:
sc committed 2026-05-01 14:44:49 +08:00
1 parent 6c0af56ea9
commit 54eaa8a836
64 files changed
+3176

No files matched your search

+65
View File
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SunlightAggregationTerminal.View.LogPage"
Title="LogPage">
<VerticalStackLayout Padding="30" Spacing="20"
VerticalOptions="Center"
HorizontalOptions="Center"
MaximumWidthRequest="600">
<Grid RowDefinitions="Auto, *" ColumnDefinitions="*, Auto">
<HorizontalStackLayout VerticalOptions="Center" Spacing="15">
<!-- 信息 -->
<VerticalStackLayout Grid.Row="0"
Grid.Column="0"
VerticalOptions="Center">
<HorizontalStackLayout VerticalOptions="Center">
<Label Text="服务器:" FontSize="26" TextColor="Black" />
<Entry x:Name="Enterprise"
Text="IP"
FontSize="26"
TextColor="Gray"
WidthRequest="300"/>
</HorizontalStackLayout>
</VerticalStackLayout>
</HorizontalStackLayout>
<Button Grid.Row="0" Grid.Column="1"
Clicked="OnScanButtonClicked"
BackgroundColor="Transparent"
WidthRequest="60"
HeightRequest="60" >
<Button.ImageSource>
<!-- 设置图标 -->
<FileImageSource File="lucidescanline.png" />
</Button.ImageSource>
</Button>
</Grid>
<HorizontalStackLayout VerticalOptions="Center">
<Label Text="用户:" FontSize="26" TextColor="Black" />
<!-- 用户名输入 -->
<Entry x:Name="UsernameEntry"
Placeholder="请输入用户名"
FontSize="26"
WidthRequest="380"/>
</HorizontalStackLayout>
<HorizontalStackLayout VerticalOptions="Center">
<Label Text="密码:" FontSize="26" TextColor="Black"/>
<!-- 密码输入 -->
<Entry x:Name="PasswordEntry"
Placeholder="请输入密码"
IsPassword="True"
FontSize="26"
WidthRequest="380"/>
</HorizontalStackLayout>
<!-- 登录按钮 -->
<Button Text="登 录"
BackgroundColor="#512BD4"
TextColor="White"
HeightRequest="50"
WidthRequest="100"
CornerRadius="10"
Margin="0,10,0,0"
Clicked="Log_Clicked"/>
</VerticalStackLayout>
</ContentPage>
+61
View File
@@ -0,0 +1,61 @@
using SunlightAggregationTerminal.Class;
using SunlightAggregationTerminal.Models;
using System.Data;
namespace SunlightAggregationTerminal.View;
public partial class LogPage : ContentPage
{
public static Action<string>? OnScanProfile;
public LogPage()
{
InitializeComponent();
OnScanProfile = (result) =>
{
MainThread.BeginInvokeOnMainThread(() =>
{
Enterprise.Text = result;
});
};
}
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();
}
}
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<Window xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="SunlightAggregationTerminal.View.LogWindow"
Title="LogWindow">
</Window>
+19
View File
@@ -0,0 +1,19 @@
namespace SunlightAggregationTerminal.View;
public partial class LogWindow : Window
{
public LogWindow()
{
InitializeComponent();
Page = new ContentPage()
{
Content = new VerticalStackLayout
{
Children = {
new Label { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Text = "Welcome to .NET MAUI!"
}
}
}
};
}
}