public static void SendSmsSchedular() { DataTable dtLogSms = GetlogsNotSendSms(); const int Approved = 1; DataTable dtOs; foreach (DataRow dtRow in dtLogSms.Rows) { dtOs = ContactBuisnes.GetConatctOstads(dtRow["ID_Group"].ToString()); string textMsg = TextLogSms.GetTextLogSms(dtRow["ID_Group"].ToString(), dtRow["FullName"].ToString()); SendSmsOS(dtOs, textMsg); UpdateWaitingSendSms(dtRow["ID_Group"].ToString(), Approved); } }
public static DataTable InsertSendSms(string idGrp) { DataTable DtInsert = null; if (idGrp != "" && idGrp != null && !(CheckSendedSmsToday(idGrp))) { DataTable dtOs; dtOs = ContactBuisnes.GetConatctOstads(idGrp); if (dtOs != null && dtOs.Rows.Count > 0) { string persianDate = DatePersian.GetDateNow(); string Time = DatePersian.GetTimeNow12(); string fullNameSt = ContactBuisnes.FullNameSt(idGrp); string textMsg = TextLogSms.GetTextLogSms(fullNameSt, idGrp); DtInsert = SendSmsContactDAO.InsertLogSms(fullNameSt, idGrp, persianDate, Time, textMsg, CheckTimeSendSms()); if (CheckTimeSendSms()) { SendSmsOS(dtOs, textMsg); } } } return(DtInsert); }