Esempio n. 1
0
        public static Com.Martin.SMS.Data.SMSOutgoing ProcessRequest(Com.Martin.SMS.Data.SMSIncoming Request) {
            
            //parsing message text split ;  array[0]=type
            // array[1]=name , array[2]...n = parameter list
            char[] cSplitter = {';'};
            String[] arrMSG = Request.MessageText.Split(cSplitter);
            
            //initialisasi sms config loader
            ConfigLoader cfgLoader = new ConfigLoader();
            
            //panggil configloader.CreateRequestCommand() = request
            Com.Martin.SMS.Command.AbstractRequest command = cfgLoader.CreateRequestCommand(arrMSG[0], arrMSG[1]);

            // set request.parameter = parameterlist
            for (int i = 2 ; i < arrMSG.Length ; i++)
            {
                command.Parameters.Add(arrMSG[i]);
            }
            command.RequestSMS= Request;

            SMSOutgoing outSMS = command.Execute();

            SMSHelper.SaveOutgoingMessage(ref outSMS);

            return outSMS;
        }
Esempio n. 2
0
        public static void ProcessBroadcast() {
           
            List<BroadcastScheduler> lstBroadCastSch = SMSHelper.GetBroadcastScheduler(DateTime.Now);
            for (int i = 0; i < lstBroadCastSch.Count; i++) 
            {
                ConfigLoader cfg = new ConfigLoader();
                Com.Martin.SMS.Command.AbstractBroadcast brc = cfg.CreateBroadcastCommand(lstBroadCastSch[i].RegisterType, lstBroadCastSch[i].RegisterName);
                List<SMSOutgoing> lstOut = brc.Execute();
                SMSHelper.SaveBroadcastMessage(lstOut);

                BroadcastScheduler schd = lstBroadCastSch[i];
                schd.CurrentLoop += 1;
                schd.LastExecuteTime = schd.NextExecuteTime;
                schd.NextExecuteTime = schd.NextExecuteTime.AddDays(schd.IntervalDays);

                SMSHelper.SaveBroadcastScheduler( schd);
            }
        }