Exemple #1
0
        public static void UpdateDeliveryStatus(string batchID, string[] numbers, int[] deliveryStatus)
        {
            Business.Sms smsController = new Business.Sms();
            Dictionary <int, List <string> > messageStatus = new Dictionary <int, List <string> >();

            for (int i = 0; i < deliveryStatus.Length; i++)
            {
                if (!messageStatus.ContainsKey(deliveryStatus[i]))
                {
                    messageStatus.Add(deliveryStatus[i], new List <string>());
                }

                messageStatus[deliveryStatus[i]].Add(numbers[i]);
            }

            foreach (int state in messageStatus.Keys)
            {
                string recievers = string.Empty;
                foreach (string number in messageStatus[state])
                {
                    recievers += string.Format("'{0}',", number);
                }

                smsController.UpdateDeliveryStatus(batchID, recievers.TrimEnd(','), state);
            }
        }
Exemple #2
0
        //public static void UpdateDeliveryStatus(long messageID, int deliveryStatus)
        //{
        //	Business.Sms smsController = new Business.Sms();
        //	smsController.UpdateDeliveryStatus(messageID, deliveryStatus);
        //}

        public static void UpdateDeliveryStatus(long[] messageIDs, long[] deliveryStatus)
        {
            Business.Sms smsController = new Business.Sms();
            Dictionary <long, List <long> > messageStatus = new Dictionary <long, List <long> >();
            string outerSystemMessageID = string.Empty;

            for (int i = 0; i < deliveryStatus.Length; i++)
            {
                if (!messageStatus.ContainsKey(deliveryStatus[i]))
                {
                    messageStatus.Add(deliveryStatus[i], new List <long>());
                }

                messageStatus[deliveryStatus[i]].Add(messageIDs[i]);
            }

            foreach (int state in messageStatus.Keys)
            {
                outerSystemMessageID = string.Empty;
                foreach (long smsID in messageStatus[state])
                {
                    outerSystemMessageID += string.Format("'{0}',", smsID);
                }

                smsController.UpdateDeliveryStatus(outerSystemMessageID.TrimEnd(','), state);
            }
        }