예제 #1
0
        public void AddSMSToQueue(Entities.SMSQueueItem queue)
        {
            using (MessagingEntities db = new MessagingEntities())
            {
                SMSQueue smsqueue = new SMSQueue
                {
                    ApplicationID    = queue.ApplicationID,
                    StatusID         = queue.StatusID,
                    SMSObject        = queue.SMSObject,
                    CreatedDate      = queue.CreatedDate,
                    DeliveryDate     = queue.DeliveryDate,
                    NumberOfAttempts = queue.NumberOfAttempts,
                    DeliveryResponse = queue.DeliveryResponse
                };

                db.SMSQueues.Add(smsqueue);
                db.SaveChanges();
            }
        }
예제 #2
0
        public void AddEmailToQueue(Entities.EMailQueueItem queue)
        {
            using (MessagingEntities db = new MessagingEntities())
            {
                EMailQueue mailqueue = new EMailQueue
                {
                    ApplicationID    = queue.ApplicationID,
                    StatusID         = queue.StatusID,
                    EmailObject      = queue.EmailObject,
                    CreatedDate      = queue.CreatedDate,
                    DeliveryDate     = queue.DeliveryDate,
                    NumberOfAttempts = queue.NumberOfAttempts,
                    DeliveryResponse = queue.DeliveryResponse
                };

                db.EMailQueues.Add(mailqueue);
                db.SaveChanges();
            }
        }
예제 #3
0
        public DataOperationStatus UpdateSMSToQueue(Entities.SMSQueueItem queue)
        {
            using (MessagingEntities db = new MessagingEntities())
            {
                var smsqueue = db.SMSQueues.Where(q => q.Id == queue.Id).FirstOrDefault();
                if (smsqueue != null)
                {
                    smsqueue.ApplicationID    = queue.ApplicationID;
                    smsqueue.StatusID         = queue.StatusID;
                    smsqueue.SMSObject        = queue.SMSObject;
                    smsqueue.CreatedDate      = queue.CreatedDate;
                    smsqueue.DeliveryDate     = queue.DeliveryDate;
                    smsqueue.NumberOfAttempts = queue.NumberOfAttempts;
                    smsqueue.DeliveryResponse = queue.DeliveryResponse;

                    db.SaveChanges();
                    return(DataOperationStatus.SavedSuccessfully);
                }
                else
                {
                    return(DataOperationStatus.RecordNotExist);
                }
            }
        }