Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Arrivals(Notification notification, Arrival arrival)
- {
- var properties = SMSHandler.GetProperties();
- var text = "";
- if (arrival.Note.Equals("Landet"))
- {
- text = properties["TextArrival"].ToString().Replace("{{FlightNo}}", arrival.Flight).Replace("{{From}}", arrival.From);
- helper.Notify(notification.Phone, text);
- // Fjern notification
- context.Notifications.Remove(notification);
- }
- if (arrival.Note.Equals("Tidlig") && notification.State != SMSHelper.SMSState.ArrivalEarly)
- {
- text = properties["TextArrivalEarly"].ToString().Replace("{{FlightNo}}", arrival.Flight).Replace("{{From}}", arrival.From).Replace("{{ETA}}", arrival.Eta);
- helper.Notify(notification.Phone, text);
- notification.State = SMSHelper.SMSState.ArrivalEarly;
- }
- if (arrival.Note.Equals("OnTime") && notification.State != SMSHelper.SMSState.ArrivalOnTime)
- {
- text = properties["TextArrivalOnTime"].ToString().Replace("{{FlightNo}}", arrival.Flight).Replace("{{From}}", arrival.From);
- helper.Notify(notification.Phone, text);
- notification.State = SMSHelper.SMSState.ArrivalOnTime;
- }
- if (arrival.Note.Equals("Forsinket") && notification.State != SMSHelper.SMSState.ArrivalDelayed)
- {
- text = properties["TextArrivalDelayed"].ToString().Replace("{{FlightNo}}", arrival.Flight).Replace("{{From}}", arrival.From).Replace("{{ETA}}", arrival.Eta);
- helper.Notify(notification.Phone, text);
- notification.State = SMSHelper.SMSState.ArrivalDelayed;
- }
- if (arrival.Note.Equals("Aflyst"))
- {
- text = properties["TextCancelled"].ToString().Replace("{{FlightNo}}", arrival.Flight);
- helper.Notify(notification.Phone, text);
- // Fjern notification
- context.Notifications.Remove(notification);
- }
- context.SaveChanges();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement