static void Main(string[] args) { /* var reader = new RobotChannelReader("http://bots.myrobots.com/channels/{0}/feed.xml?key={1}", "67", "B94DD85F4ED8430B"); var channel = reader.ReadChannel(); Console.WriteLine("Name: {0}", channel.Name); Console.WriteLine("Created: {0}", channel.Description); Console.WriteLine("Feeds:"); foreach (var feed in channel.Feeds) { Console.WriteLine("Created: {0}", feed.Created); Console.WriteLine("Entry ID: {0}", feed.EntryId); Console.WriteLine(); Console.WriteLine("Values:"); foreach (var field in feed.Values) { Console.WriteLine("{0} = {1}", field.Key, field.Value); } Console.WriteLine(); }*/ var notification = new SMSNotification(); notification.PhoneNumber = Properties.Settings.Default.PhoneNumber; notification.GatewayEmail = Properties.Settings.Default.GatewayEmail; notification.Content = "Test"; notification.Send(); }
static void Main(string[] args) { /* * var reader = new RobotChannelReader("http://bots.myrobots.com/channels/{0}/feed.xml?key={1}", "67", "B94DD85F4ED8430B"); * var channel = reader.ReadChannel(); * Console.WriteLine("Name: {0}", channel.Name); * Console.WriteLine("Created: {0}", channel.Description); * Console.WriteLine("Feeds:"); * * foreach (var feed in channel.Feeds) * { * Console.WriteLine("Created: {0}", feed.Created); * Console.WriteLine("Entry ID: {0}", feed.EntryId); * Console.WriteLine(); * Console.WriteLine("Values:"); * foreach (var field in feed.Values) * { * Console.WriteLine("{0} = {1}", field.Key, field.Value); * } * Console.WriteLine(); * }*/ var notification = new SMSNotification(); notification.PhoneNumber = Properties.Settings.Default.PhoneNumber; notification.GatewayEmail = Properties.Settings.Default.GatewayEmail; notification.Content = "Test"; notification.Send(); }
public void RelayMessage(double latitude, double longitude, string emailAddress) { User TempUser = db.Users.Where(x => x.Email == emailAddress).FirstOrDefault(); var TempAlert = db.AlertTypes.Where(x => x.UserId == TempUser.Id).FirstOrDefault(); GeoCoordinate PersonLocation = new GeoCoordinate(latitude, longitude); var locations = db.NoGoZones.Where(x => x.User.Id == TempUser.Id); if (CompareLocations.CompareLocations.Compare(PersonLocation, locations.AsEnumerable())) { var msgData = new MessageData { EMail = TempUser.Email, TelNr = TempUser.TelNr, MsgBody = "You got too close to a no go zone!", MsgHeader = "Alert" }; if (!string.IsNullOrEmpty(TempUser.TelNr) && TempAlert.Text) { INotifications notification = new SMSNotification(); notification.Send(msgData); } if (!string.IsNullOrEmpty(TempUser.Email) && TempAlert.EMail) { INotifications notification = new EMailNotification(); notification.Send(msgData); } if (!string.IsNullOrEmpty(TempUser.Push) && TempAlert.Push) { INotifications notification = new PushFirebase(); notification.Send(msgData); } } }
public void SendSMS() { _sender.Send(_address, _message); }