コード例 #1
0
        /// <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);
        }
コード例 #2
0
        /// <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);
        }