コード例 #1
0
 public static MaintenanceRenewalsCheckStatusDAL GetCheckStatus()
 {
     try
     {
         MaintenanceRenewalsCheckStatusDAL renewalsCheckStatusDal = new MaintenanceRenewalsCheckStatusDAL();
         renewalsCheckStatusDal.LoadFromDB();
         return(renewalsCheckStatusDal);
     }
     catch (ResultCountException ex)
     {
         MaintenanceRenewalsCheckStatusDAL.log.DebugFormat("Can't find maintenance renewals check status record in DB.", Array.Empty <object>());
         return((MaintenanceRenewalsCheckStatusDAL)null);
     }
 }
コード例 #2
0
        // Token: 0x060007C5 RID: 1989 RVA: 0x00037640 File Offset: 0x00035840
        public static void SetLastUpdateCheck(double timeout, bool forceCheck)
        {
            DateTime utcNow = DateTime.UtcNow;
            MaintenanceRenewalsCheckStatusDAL checkStatus = MaintenanceRenewalsCheckStatusDAL.GetCheckStatus();

            if (checkStatus == null)
            {
                MaintenanceRenewalsCheckStatusDAL.Insert(new DateTime?(utcNow), new DateTime?(utcNow.AddMinutes(timeout)));
                return;
            }
            checkStatus.LastUpdateCheck = new DateTime?(utcNow);
            if (forceCheck)
            {
                checkStatus.NextUpdateCheck = new DateTime?(utcNow.AddMinutes(timeout));
            }
            checkStatus.Update();
        }
コード例 #3
0
        // Token: 0x060007C2 RID: 1986 RVA: 0x000374AC File Offset: 0x000356AC
        public static MaintenanceRenewalsCheckStatusDAL GetCheckStatus()
        {
            MaintenanceRenewalsCheckStatusDAL result;

            try
            {
                MaintenanceRenewalsCheckStatusDAL maintenanceRenewalsCheckStatusDAL = new MaintenanceRenewalsCheckStatusDAL();
                maintenanceRenewalsCheckStatusDAL.LoadFromDB();
                result = maintenanceRenewalsCheckStatusDAL;
            }
            catch (ResultCountException)
            {
                MaintenanceRenewalsCheckStatusDAL.log.DebugFormat("Can't find maintenance renewals check status record in DB.", Array.Empty <object>());
                result = null;
            }
            return(result);
        }
コード例 #4
0
        // Token: 0x060007C3 RID: 1987 RVA: 0x000374F4 File Offset: 0x000356F4
        public static MaintenanceRenewalsCheckStatusDAL Insert(DateTime?lastCheck, DateTime?nextCheck)
        {
            MaintenanceRenewalsCheckStatusDAL result;

            using (SqlCommand textCommand = SqlHelper.GetTextCommand("INSERT INTO MaintenanceRenewalsCheckStatus (LastUpdateCheck, NextUpdateCheck)\r\n                                                        VALUES (@LastUpdateCheck, @NextUpdateCheck)"))
            {
                textCommand.Parameters.AddWithValue("@LastUpdateCheck", (lastCheck != null) ? lastCheck : DBNull.Value);
                textCommand.Parameters.AddWithValue("@NextUpdateCheck", (nextCheck != null) ? nextCheck : DBNull.Value);
                if (SqlHelper.ExecuteNonQuery(textCommand) == 0)
                {
                    result = null;
                }
                else
                {
                    result = new MaintenanceRenewalsCheckStatusDAL
                    {
                        LastUpdateCheck = lastCheck,
                        NextUpdateCheck = nextCheck
                    };
                }
            }
            return(result);
        }