Ejemplo n.º 1
0
        public void registerQueue(List <QueueItem> queueItems, Guid queueId)
        {
            resetTimer();
            this.isQueueFinished = false;
            Console.ResetColor();

            try
            {
                this.queueId = queueId;

                this.queueItems = queueItems;

                using (SMSPortalDBEntities db = new SMSPortalDBEntities())
                {
                    try
                    {
                        message = (from x in db.Queues where x.TFId == queueId select x.Message.TFContent).FirstOrDefault();

                        if (Encoding.BigEndianUnicode.GetBytes(message).Length > SMSTextPacket.MESSAGE_TEXT_COUNTER)
                        {
                            Logger.ShowError(string.Format("Message could not be more than {0} bytes", SMSTextPacket.MESSAGE_TEXT_COUNTER));
                            return;
                        }

                        start  = 0;
                        finish = queueItems.Count() - 1;
                        AbstractPacket packetToSend = new SMSTextPacket(sim_number, message);
                        byte[]         byteToSend   = packetToSend.toRaw();

                        networkManager.Send(byteToSend);
                    }
                    catch (IndexOutOfRangeException e1)
                    {
                        Logger.ShowError(string.Format("Message could not be more than {0} bytes", SMSTextPacket.MESSAGE_TEXT_COUNTER));
                    }
                }
            }
            catch (Exception e)
            {
                Logger.ShowError(e.Message);
            }
        }
Ejemplo n.º 2
0
 public void onMessageTextRead(SMSTextPacket packet)
 {
     throw new NotImplementedException();
 }