SVN r1105
SVN-Revision: r1105
This commit is contained in:
@@ -56,6 +56,7 @@ namespace Lskj.Main.Model
|
||||
public static string BsName;
|
||||
public static string BsUrl;
|
||||
public static int isAwaitTime = 10;
|
||||
public static int RefreshTime = 0;
|
||||
/// <summary>
|
||||
/// 默认下载地址
|
||||
/// </summary>
|
||||
@@ -112,13 +113,13 @@ namespace Lskj.Main.Model
|
||||
if (isStart)
|
||||
{
|
||||
// Delphi数据库连接检查
|
||||
//if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
|
||||
//{
|
||||
// MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
|
||||
// SplashForm.HideForm();
|
||||
// RunConfigForm();
|
||||
// return;
|
||||
//}
|
||||
if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0)
|
||||
{
|
||||
MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]");
|
||||
SplashForm.HideForm();
|
||||
RunConfigForm();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
SplashForm.HideForm();
|
||||
@@ -161,6 +162,7 @@ namespace Lskj.Main.Model
|
||||
{
|
||||
WhenConstraintLogin();
|
||||
LockApplication();
|
||||
if (SystemInfo.Instance.SubscriptRefreshTime > 0 && !SystemInfo.Instance.RefreshNotify)RefreshSubscript();
|
||||
if (_frmMain != null)
|
||||
{
|
||||
if (ERPInfo.Instance.WatermarkForm != null)
|
||||
@@ -1002,6 +1004,50 @@ namespace Lskj.Main.Model
|
||||
});
|
||||
thread.Start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 刷新数量角标
|
||||
/// </summary>
|
||||
private static void RefreshSubscript()
|
||||
{
|
||||
Thread thread = new Thread(() =>
|
||||
{
|
||||
while (SystemInfo.Instance.SubscriptRefreshTime > 0)
|
||||
{
|
||||
if (RefreshTime >= SystemInfo.Instance.SubscriptRefreshTime)
|
||||
{
|
||||
RefreshTime = 0;
|
||||
if (_frmMain != null && _frmMain.Visible == true)
|
||||
{
|
||||
XtraTabPage tabPage = _frmMain.mainPanelControlEx.tabMain.SelectedTabPage;
|
||||
if (tabPage.TabIndex == 0)
|
||||
{
|
||||
if (!SystemInfo.Instance.RefreshNotify)
|
||||
{
|
||||
Thread threadnew = new Thread(_frmMain.mainPanelControlEx.RefreshSubscript);
|
||||
threadnew.IsBackground = true;
|
||||
threadnew.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
RefreshTime += 1;
|
||||
Thread.Sleep(60000);
|
||||
}
|
||||
});
|
||||
thread.Start();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// url加密
|
||||
/// </summary>
|
||||
@@ -1045,33 +1091,4 @@ namespace Lskj.Main.Model
|
||||
{
|
||||
DateTime dateTime = DateTime.Now.AddDays(1);
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond;
|
||||
pms.Add("exp", timestamp);
|
||||
}
|
||||
return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}";
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 退出主程序,进入登录界面
|
||||
/// </summary>
|
||||
public static void ReLogin()
|
||||
{
|
||||
if (_frmMain != null)
|
||||
{
|
||||
if (ERPInfo.Instance.WatermarkForm != null)
|
||||
{
|
||||
ERPInfo.Instance.WatermarkForm.Close();
|
||||
ERPInfo.Instance.WatermarkForm.Dispose();
|
||||
}
|
||||
_frmMain.Close();
|
||||
_frmMain.Dispose();
|
||||
_frmMain = null;
|
||||
}
|
||||
StartForm();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user