Esempio n. 1
0
        public static void startSendSMS()
        {
            listOfRecipients = ReadJSON.getListProgramming(FileUtil.filePathJSONProgramming);

            if (listOfRecipients != null)
            {
                if (listOfRecipients != null && listOfRecipients.Count != 0)
                {
                    foreach (VideoproiectiePojo currentRecipient in listOfRecipients)
                    {
                        String serviceResponse = SendSmsAPI.SendSMSToRecipient(currentRecipient);
                        //mesaje in eventViewer de succes respectiv eroare.
                        if (serviceResponse.Contains("\"status\":\"success\""))
                        {
                            String notification = "SMS trimis cu succes catre " + currentRecipient.Username + " la nr tel " + currentRecipient.PhoneNumber + " " + " In data de " + DateTime.Now;
                            LogMessage.PrintEventMessage(notification);
                            EmailUtil.SendEmailToAdministrator(notification, "Notification sending SMS");
                        }
                        else
                        {
                            HandlerErrorsUtil.handlerErrorFromService(serviceResponse);
                        }
                    }
                }
                else
                {
                    HandlerErrorsUtil.handlerWarningFromFileJSON(1);
                }
            }
            else
            {
                HandlerErrorsUtil.handlerWarningFromFileJSON(2);
            }
        }