Exemplo n.º 1
0
        public static void CleanFreCount()
        {
            DataTable   dt           = new MemcachedGetFrequencyDAL().SelectTableId();
            IList <int> frequencyIds = new List <int>();

            foreach (DataRow row in dt.Rows)
            {
                frequencyIds.Add(int.Parse(row["MemcachedGetFrequencyId"].ToString()));
            }
            MemcachedGetFrequencyDAL dal = new MemcachedGetFrequencyDAL();

            foreach (int frequenceId in frequencyIds)
            {
                try
                {
                    MemcachedGetFrequencyEntity entity = dal.Select(frequenceId);
                    if (entity != null)
                    {
                        entity.FreCount            = 0;
                        entity.DataChange_LastTime = DateTime.Now;
                        entity.LastGetDateTime     = DateTime.Now;
                        dal.Update(entity);
                    }
                }
                catch (Exception ex)
                {
                    Logging.HHLogHelperV2.ERRORGlobalException(ex);
                }
            }
        }
Exemplo n.º 2
0
 public static void CleanFreCount()
 {
     DataTable dt = new MemcachedGetFrequencyDAL().SelectTableId();
     IList<int> frequencyIds = new List<int>();
     foreach (DataRow row in dt.Rows)
     {
         frequencyIds.Add(int.Parse(row["MemcachedGetFrequencyId"].ToString()));
     }
     MemcachedGetFrequencyDAL dal = new MemcachedGetFrequencyDAL();
     foreach (int frequenceId in frequencyIds)
     {
         try
         {
             MemcachedGetFrequencyEntity entity = dal.Select(frequenceId);
             if (entity != null)
             {
                 entity.FreCount = 0;
                 entity.DataChange_LastTime = DateTime.Now;
                 entity.LastGetDateTime = DateTime.Now;
                 dal.Update(entity);
             }
         }
         catch (Exception ex)
         {
             Logging.HHLogHelperV2.ERRORGlobalException(ex);
         }
     }
 }
Exemplo n.º 3
0
 public static void UpdateFreCount(string key, int freCount)
 {
     try
     {
         MemcachedGetFrequencyDAL    frequencyDAL = new MemcachedGetFrequencyDAL();
         MemcachedGetFrequencyEntity entity       = frequencyDAL.Select(string.Format("CacheKey='{0}'", key));
         if (entity != null)
         {
             entity.FreCount           += freCount;
             entity.LastGetDateTime     = DateTime.Now;
             entity.DataChange_LastTime = DateTime.Now;
             frequencyDAL.Update(entity);
         }
     }
     catch (Exception ex)
     {
         Logging.HHLogHelperV2.ERRORGlobalException(ex);
     }
 }
Exemplo n.º 4
0
 public static void UpdateFreCount(string key, int freCount)
 {
     try
     {
         MemcachedGetFrequencyDAL frequencyDAL = new MemcachedGetFrequencyDAL();
         MemcachedGetFrequencyEntity entity = frequencyDAL.Select(string.Format("CacheKey='{0}'", key));
         if (entity != null)
         {
             entity.FreCount += freCount;
             entity.LastGetDateTime = DateTime.Now;
             entity.DataChange_LastTime = DateTime.Now;
             frequencyDAL.Update(entity);
         }
     }
     catch (Exception ex)
     {
         Logging.HHLogHelperV2.ERRORGlobalException(ex);
     }
 }