Пример #1
0
        public ActionResult Start([FromForm] string value)
        {
            Services.Telephony t = new Services.Telephony(_applicationOptions, _config, _context);

            var members = this.memberSummaryItems();

            t.SendCalloutHeadsupSMS(members);

            Models.Callout.CalloutOccurrence model = new Models.Callout.CalloutOccurrence();

            return(View(model));
        }
Пример #2
0
        public ActionResult Initiate(Models.Callout.CalloutOccurrence model)
        {
            Services.Telephony t = new Services.Telephony(_applicationOptions, _config, _context);

            //send a text message
            var members = this.memberSummaryItems();

            t.SendCalloutHeadsupSMS(members);

            //save the new callout message
            Models.DB.Callout newCallout = new Models.DB.Callout();
            newCallout.Created        = DateTime.UtcNow;
            newCallout.CalloutMessage = model.VoiceMessage = model.VoiceMessage;

            _context.Callout.Add(newCallout);
            _context.SaveChanges();

            t.SendCalloutPhoneCallsandSMS(members, newCallout);

            return(View());
        }