修改API 输出格式

This commit is contained in:
admin
2021-01-16 15:38:29 +08:00
parent 7b37f40f56
commit 46dd037909
10 changed files with 89 additions and 30 deletions

View File

@@ -78,18 +78,52 @@ namespace NX.ERP.U8
{
if (uiLogin != null)
{
uiLogin.SubLogout(AccID);
uiLogin.SubLogout(this._accid);
uiLogin.ShutDown();
uiLogin = null;
}
}
public string UserId { get; set; } = "003";
public string PassWord { get; set; } = "123456";
private string _userId = "";
public string Server { get; set; } = "192.168.0.250";
public string AccID { get; set; } = "(default)@001";
public string UserId
{
set
{
this._userId = value;
}
}
private string _password = "";
public string PassWord
{
set
{
this._password = value;
}
}
private string _server;
public string Server
{
set
{
this._server = value;
}
}
private string _accid;
public string AccID
{
set
{
this._accid = value;
}
}
public string Serial { get; set; }
/// <summary>
@@ -140,10 +174,24 @@ namespace NX.ERP.U8
}
}
public void Login(bool showlogin = false)
public bool NeedUiLogin
{
if (showlogin)
get
{
return string.IsNullOrEmpty(this._userId) ||
string.IsNullOrEmpty(this._password) ||
string.IsNullOrEmpty(this._server) ||
string.IsNullOrEmpty(this._accid);
}
}
public void Login()
{
if (NeedUiLogin)
{
if (!UiLogin.login("DP"))
{
@@ -152,8 +200,7 @@ namespace NX.ERP.U8
}
else
{
if (!UiLogin.login("DP", "wx999", "!@#qwe123", "192.168.0.168", DateTime.Today.ToString("yyyy-MM-dd"), AccID, Serial))
if (!UiLogin.login("DP", this._userId, this._password, this._server, DateTime.Today.ToString("yyyy-MM-dd"), this._accid, Serial))
{
throw new Exception(UiLogin.ErrDescript);
}
@@ -175,9 +222,9 @@ namespace NX.ERP.U8
}