private async Task <bool> UpdateResponse(NotificationBody notification) { try { if (notification == null) { return(false); } var answer = notification.Answer; var dictionary = new Dictionary <string, Answer>(); // 6 Hour Time bucket range for Departure Time UpdateDepartureTimeBucket(answer); //6 Hour Time bucket range for Arrival Time UpdateArrivalTimeBucket(answer); //Update if flight is 15 min delay UpdateDelay15Flag(answer); dictionary.Add(answer.Id, answer); return(await CherryClient.UpdateMultiAnswer(dictionary)); } catch (Exception) { return(false); } }
static EnviarNotificacao() { PushNotification.REST_API_KEY = "OGVlZmM0N2UtMWQzMC00ZmFkLWI2NzktOWQwMjY1MDJkMWQ1"; notification = new NotificationBody() { AppId = "b00d5a16-6c5d-4a2d-b9d0-43c37518565e" }; }
public async Task <IActionResult> Postfill(NotificationBody notification) { try { return(Ok(await UpdateResponse(notification))); } catch (Exception) { return(Ok(false)); } }
private async Task <bool> UpdateResponse(NotificationBody notification) { if (notification == null) { return(false); } var answer = notification.Answer; var dictionary = new Dictionary <string, Answer>(); // Assign an age group based on customer's age UpdateAgeGroup(answer); dictionary.Add(answer.Id, answer); return(await CherryClient.UpdateMultiAnswer(dictionary)); }
internal override void GetAndFillTemplate(ERP_DB ctx, Dictionary <string, string> holders, int notificationId) { var spisWezwania = ctx.SpisWezwania.Find(notificationId); if (holders != null) { NotificationBody = spisWezwania.TemplateSMS; foreach (var h in holders) { NotificationBody = NotificationBody.Replace("{" + h.Key + "}", h.Value); } } else { NotificationBody = "Puste wezwanie"; } }
public async Task <IActionResult> Postfill(NotificationBody notification) { return(Ok(await UpdateResponse(notification))); }