예제 #1
0
        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);
        }
예제 #2
0
 /// <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));
 }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 /// <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));
 }
예제 #6
0
 /// <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));
 }
예제 #7
0
 /// <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));
 }
예제 #8
0
 /// <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));
 }
예제 #9
0
 /// <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));
 }
예제 #10
0
 /// <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));
 }
예제 #11
0
파일: Sms.cs 프로젝트: zmk523/twilio-csharp
 /// <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));
 }
예제 #12
0
 /// <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));
 }
예제 #13
0
 /// <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));
 }
예제 #14
0
 /// <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));
 }
예제 #15
0
 /// <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));
 }
예제 #16
0
 /// <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));
 }
예제 #17
0
 /// <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));
 }
예제 #18
0
 /// <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));
 }
예제 #19
0
 /// <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));
 }
예제 #20
0
 /// <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));
 }
예제 #21
0
 /// <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));
 }
예제 #22
0
 /// <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));
 }
예제 #23
0
 /// <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));
 }
예제 #24
0
 /// <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));
 }
예제 #25
0
 /// <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));
 }
예제 #26
0
 /// <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));
 }
예제 #27
0
 /// <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));
 }
예제 #28
0
 /// <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));
 }
예제 #29
0
 /// <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));
 }
예제 #30
0
 /// <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));
 }