Exemplo n.º 1
0
 public static void MarkEventOccurNotSave(this Agp2pDataContext context, int userId, Agp2pEnums.EventRecordTypeEnum eventType, DateTime occurAt, string remark = null)
 {
     context.li_event_records.InsertOnSubmit(new li_event_records
     {
         userId    = userId,
         eventType = eventType,
         occurAt   = occurAt,
         remark    = remark
     });
 }
Exemplo n.º 2
0
 public static int QueryEventTimesDuring(this Agp2pDataContext context, int userId, Agp2pEnums.EventRecordTypeEnum eventType, TimeSpan timeSpan, string remark = null)
 {
     if (remark == null)
     {
         return(context.li_event_records.Count(r =>
                                               r.userId == userId && r.eventType == eventType && DateTime.Now - timeSpan <= r.occurAt &&
                                               r.remark == null));
     }
     return(context.li_event_records.Count(r =>
                                           r.userId == userId && r.eventType == eventType && DateTime.Now - timeSpan <= r.occurAt &&
                                           r.remark == remark));
 }