private void SendUpdateMessageToClient(Boolean toKillProcesses) { if (callback != null) { try { var sysTime = new SYSTEMTIME(); SystemTime.GetSystemTime(ref sysTime); ((IClientContract)callback).SessionUpdated( new SessionMessage( this.SessionStart, this.SessionExpire, this.Tariff, this.IsInternetSession, this.IsPaused, this.TotalPayment ), sysTime, toKillProcesses); toSinchronize = false; } catch (Exception e) { System.Windows.MessageBox.Show(this.Name + ":\n" + "Method: SendUpdateMessageToClient()\n" + e.Message, "", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Warning); } } }
/// <summary> /// 更改系統時間 /// </summary> /// <param name="hostTime">The host time.</param> public void updateSystemTime(DateTime hostTime) { SystemTime st = new SystemTime(); st.FromDateTime(hostTime); SystemTime.SetSystemTime(ref st); SystemTime.GetSystemTime(ref st); logger.Info("Set System Time:{0}", st.ToDateTime().ToString(SCAppConstants.TimestampFormat_16)); }
//[AbpAuthorize] public async Task <SystemTimeDto> Time() { var systemTime = await SystemTime.GetSystemTime().ConfigureAwait(false); var time = new SystemTimeDto(); time.LocalTime = systemTime.LocalTime; time.TimeZone = systemTime.TimeZone; time.VIIDServerID = "DE01195"; time.TimeMode = "1"; return(time); }