public HttpResponseMessage PostReply(TwiML message) { string responseText = "La requête n'est pas correcte !"; var parts = message.Body.ToLower().Split(' '); if (parts[0] == "oui") { var shortcode = parts[1]; using (ApplicationDbContext context = new ApplicationDbContext()) { var activity = context .Activities.Include(a => a.UserActivities) .Include("UserActivities.User") .FirstOrDefault(a => a.ShortCode == shortcode); if (activity != null) { var user = context.Users.FirstOrDefault(u => u.PhoneNumber == message.From); if (user != null) { activity.Driver = user; context.SaveChanges(); var smsService = new SmsActivityNotificationService(); smsService.SendDriverConfirmation(activity); responseText = "Merci !"; } } } } HttpResponseMessage response = new HttpResponseMessage() { Content = new StringContent( responseText, Encoding.UTF8, "plain/text") }; return(response); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Identity Append(TwiML childElem) { return((Identity)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Dial Append(TwiML childElem) { return((Dial)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Play Append(TwiML childElem) { return((Play)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Start Append(TwiML childElem) { return((Start)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Gather Append(TwiML childElem) { return((Gather)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Task Append(TwiML childElem) { return((Task)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Connect Append(TwiML childElem) { return((Connect)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Refer Append(TwiML childElem) { return((Refer)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Number Append(TwiML childElem) { return((Number)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Sms Append(TwiML childElem) { return((Sms)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Stop Append(TwiML childElem) { return((Stop)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Autopilot Append(TwiML childElem) { return((Autopilot)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Room Append(TwiML childElem) { return((Room)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new SsmlProsody Append(TwiML childElem) { return((SsmlProsody)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Conference Append(TwiML childElem) { return((Conference)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Client Append(TwiML childElem) { return((Client)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new SsmlS Append(TwiML childElem) { return((SsmlS)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Message Append(TwiML childElem) { return((Message)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Prompt Append(TwiML childElem) { return((Prompt)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Enqueue Append(TwiML childElem) { return((Enqueue)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Media Append(TwiML childElem) { return((Media)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Redirect Append(TwiML childElem) { return((Redirect)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new SsmlBreak Append(TwiML childElem) { return((SsmlBreak)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Stream Append(TwiML childElem) { return((Stream)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Siprec Append(TwiML childElem) { return((Siprec)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Record Append(TwiML childElem) { return((Record)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new Pause Append(TwiML childElem) { return((Pause)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new SsmlEmphasis Append(TwiML childElem) { return((SsmlEmphasis)base.Append(childElem)); }
/// <summary> /// Append a child TwiML element to this element returning this element to allow chaining. /// </summary> /// <param name="childElem"> Child TwiML element to add </param> public new SsmlPhoneme Append(TwiML childElem) { return((SsmlPhoneme)base.Append(childElem)); }