public int SendSMS() { int Result = 0; try { SoftmindWebservicesEntities Entities = new SoftmindWebservicesEntities(); var MessageResult = Entities.GetTodayMessage(); Way2Sms oway2 = new Way2Sms("8866671361", "9825146475"); oway2.Login(); foreach (GetTodayMessage_Result Msg in MessageResult) { String ContactNo = Msg.MobileNo; string Description = Msg.Description; oway2.SendSms(ContactNo, Description); } } catch (Exception ex) { } return(Result); }
public int SetMessage(string Name, string Subject, string Description, string MobileNo, string ReminderDate) { int Result = 0; try { SoftmindWebservicesEntities Entities = new SoftmindWebservicesEntities(); Message DBMessage = new Message(); DBMessage.Name = Name; DBMessage.Subject = Subject; DBMessage.Description = Description; DBMessage.MobileNo = MobileNo; DBMessage.Date = ReminderDate; Entities.Messages.Add(DBMessage); Entities.SaveChanges(); Result = 1; } catch (Exception) { } return(Result); }