You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
3.6 KiB
C#

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using SlnMesnac.RfidUpload.Business;
using SlnMesnac.RfidUpload.Model;
using SlnMesnac.RfidUpload.Model.apiParam;
using SlnMesnac.RfidUpload.Model.config;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
#region << 版 本 注 释 >>
/*--------------------------------------------------------------------
* (c) 2024 WenJY
* CLR4.0.30319.42000
* T14-GEN3-7895
* SlnMesnac.RfidUpload.UI.viewModel
* a65ccfd9-c493-46c4-9905-7a7d55ef1508
*
* WenJY
*
* 2024-12-06 16:31:16
* V1.0.0
*
*
*--------------------------------------------------------------------
*
*
*
*
* V1.0.0
*--------------------------------------------------------------------*/
#endregion << 版 本 注 释 >>
namespace SlnMesnac.RfidUpload.UI.viewModel
{
public partial class systemSetWindowViewModel : ObservableObject
{
private AppConfig appConfig = AppConfig.Instance;
public systemSetWindowViewModel()
{
Init();
}
#region << 属性 >>
public string _requestURL = string.Empty;
public string requestURL
{
get => _requestURL;
set => SetProperty(ref _requestURL, value);
}
public string _sysCode = string.Empty;
public string sysCode
{
get => _sysCode;
set => SetProperty(ref _sysCode, value);
}
public string _password = string.Empty;
public string password
{
get => _password;
set => SetProperty(ref _password, value);
}
public string _ak = string.Empty;
public string ak
{
get => _ak;
set => SetProperty(ref _ak, value);
}
public string _sk = string.Empty;
public string sk
{
get => _sk;
set => SetProperty(ref _sk, value);
}
public string _opOrgCode = string.Empty;
public string opOrgCode
{
get => _opOrgCode;
set => SetProperty(ref _opOrgCode, value);
}
public string _devicedId = string.Empty;
public string devicedId
{
get => _devicedId;
set => SetProperty(ref _devicedId, value);
}
public string _localUrl = string.Empty;
public string localUrl
{
get => _localUrl;
set => SetProperty(ref _localUrl, value);
}
#endregion
/// <summary>
/// 初始化参数
/// </summary>
private void Init()
{
requestURL = appConfig.requestURL;
sysCode = appConfig.sysCode;
password = appConfig.password;
ak = appConfig.ak;
sk = appConfig.sk;
opOrgCode = appConfig.opOrgCode;
devicedId = appConfig.devicedId;
localUrl = appConfig.localUrl;
}
[RelayCommand]
private void Submit()
{
appConfig.requestURL = requestURL;
appConfig.sysCode = sysCode;
appConfig.password = password;
appConfig.ak = ak;
appConfig.sk = sk;
appConfig.opOrgCode = opOrgCode;
appConfig.devicedId = devicedId;
appConfig.localUrl = localUrl;
MessageBox.Show("系统参数修改成功!");
}
}
}