Exemplo n.º 1
0
        /// <summary>
        /// 删除过期的财务指标
        /// (就是已经不用显示的季度)
        /// </summary>
        private static void DeleteOverdueFinaceIndex(ulong securityID)
        {
            List <DateTime> lstExistDate   = MongoDBHelper.AsQueryable <FinanceIndexInfo>().Where(m => m.SecurityID == securityID).Select(m => m.EndDate).ToList();
            List <DateTime> listDate       = TransferHelper.GetFinanceDate();
            List <DateTime> lstOverdueDate = lstExistDate.Except(listDate).ToList();

            foreach (DateTime overdueDate in lstOverdueDate)
            {
                string delFilter = "EndDate:ISODate(\"" + overdueDate.ToString("yyyy-MM-dd") + "T00:00:00.000+0800\")";
                MongoDBHelper.DeleteManyAsync <FinanceIndexInfo>(delFilter);
            }
        }