Пример #1
0
 public static void AddNewSubscriber(int userId, int queueElemId)
 {
     CanonDataContext db = Cdb.Instance;
     ManualImportSubscriber subs = new ManualImportSubscriber();
     subs.ManualImportId = queueElemId;
     subs.SubscriptDate = DateTime.Now;
     subs.UserId = userId;
     db.ManualImportSubscribers.InsertOnSubmit(subs);
     db.SubmitChanges();
 }
Пример #2
0
        public static void AddNewSubscriber(int userId, int queueElemId)
        {
            CanonDataContext       db   = Cdb.Instance;
            ManualImportSubscriber subs = new ManualImportSubscriber();

            subs.ManualImportId = queueElemId;
            subs.SubscriptDate  = DateTime.Now;
            subs.UserId         = userId;
            db.ManualImportSubscribers.InsertOnSubmit(subs);
            db.SubmitChanges();
        }
Пример #3
0
        public static void RemoveSubscriber(int userId, int queueElemId)
        {
            CanonDataContext       db   = Cdb.Instance;
            ManualImportSubscriber subs = db.ManualImportSubscribers.Where(m => m.ManualImportId == queueElemId &&
                                                                           m.UserId == userId).FirstOrDefault();

            if (subs != null)
            {
                db.ManualImportSubscribers.DeleteOnSubmit(subs);
                db.SubmitChanges();
            }
        }
Пример #4
0
        public static ManualImportQueue GetCompleteChannelByUser(int userId)
        {
            CanonDataContext       db = Cdb.Instance;
            ManualImportSubscriber ms = db.ManualImportSubscribers.Where(m => m.UserId == userId &&
                                                                         m.ManualImportQueue.Status == (int)ManualImportStatusEnum.ImportComplete).FirstOrDefault();

            if (ms != null)
            {
                return(ms.ManualImportQueue);
            }

            return(null);
        }