/// <summary> /// Get system date /// </summary> /// <returns> /// systemDate: Search successful /// </returns> public static DateTime GetSystemDate() { DateTime systemDate = new DateTime(); try { using (BaseDao context = new BaseDao()) { systemDate = context.GetDateTimeByEntityQuery(); } } catch (Exception ex) { systemDate = DateTime.Now; } return(systemDate); }
/// <summary> /// Get system date /// </summary> /// <param name="systemDate"></param> /// <returns> /// 0: Search successful /// others: Sql Exception /// </returns> public int GetSystemDate(out DateTime systemDate) { int returnCode = CommonData.DbReturnCode.Succeed; try { using (BaseDao context = new BaseDao()) { systemDate = context.GetDateTimeByEntityQuery(); } } catch (Exception ex) { systemDate = DateTime.Now; returnCode = this.ProcessDbException(ex); } return(returnCode); }