public static List <ProgramareVideoproiectiePojo> GetListOfRecipients(List <ProgramareVideoproiectiePojo> programmingList)
        {
            List <ProgramareVideoproiectiePojo> listOfRecipients = null;

            if (programmingList != null)
            {
                listOfRecipients = new List <ProgramareVideoproiectiePojo>();
                foreach (ProgramareVideoproiectiePojo currentPojo in programmingList)
                {
                    if (currentPojo.DateProgramming.Equals(DateConverterUtil.GetTodayAsString()))
                    {
                        listOfRecipients.Add(currentPojo);
                    }
                    else if (currentPojo.DateProgramming.Equals(DateConverterUtil.GetTomorrowAsString()))
                    {
                        DayOfWeek today = DateTime.Now.DayOfWeek;

                        if ((today == DayOfWeek.Saturday) || (today == DayOfWeek.Sunday))
                        {
                            listOfRecipients.Add(currentPojo);
                        }
                    }
                }
            }

            return(listOfRecipients);
        }
Пример #2
0
        public static String getSMSContent(ProgramareVideoproiectiePojo recipient)
        {
            if (recipient != null)
            {
                string message = "Buna ";
                message = String.Concat(message, recipient.Username);

                if (recipient.DateProgramming.Equals(DateConverterUtil.GetTomorrowAsString()))
                {
                    string sunday_morning = recipient.Sunday_morning;
                    string y = "yes";
                    string n = "no";
                    if (sunday_morning.ToLower().Equals(y.ToLower()))
                    {
                        message = String.Concat(message, ", iti reamintim ca maine dimineata " + DateConverterUtil.GetTomorrowAsString() + " esti la proiectie.Multumim de implicare, echipa VideoProiectie Speranta.");
                    }
                    else if (sunday_morning.ToLower().Equals(n.ToLower()))
                    {
                        message = String.Concat(message, ", iti reamintim ca maine dupamasa " + DateConverterUtil.GetTomorrowAsString() + " esti la proiectie.Multumim de implicare, echipa VideoProiectie Speranta.");
                    }
                }
                else if (recipient.DateProgramming.Equals(DateConverterUtil.GetTodayAsString()))
                {
                    message = String.Concat(message, ", iti reamintim ca astazi " + DateConverterUtil.GetTodayAsString() + " esti la proiectie.Multumim de implicare, echipa VideoProiectie Speranta.");
                }

                return(message);
            }
            return("");
        }
 public static void displayErrorFromService(String recivedStatusFromService, int errorCode)
 {
     LogMessage.PrintEventError("A aparut o eroare la trimiterea SMS-ului in data de "
                                + DateConverterUtil.GetTodayAsString() + " Denumire eroare: " + recivedStatusFromService + " Cod eroare: " + errorCode + " ."
                                + "Pt mai multe detalii consultati siteul https://api.txtlocal.com/docs/sendsms ");
 }