Esempio n. 1
0
        public SmsDataWrapper GetSmsSendingData(DateTime dateFrom, DateTime dateTo)
        {
            var q = (from s in _context.Sms
                     join n in _context.Notification on s.NotificationId equals n.NotificationId
                     where n.DateCreated >= dateFrom && n.DateCreated <= dateTo
                     select new Domain.ReportingManagement.Sms {
                From = s.From,
                PhoneNumber = s.PhoneNumber,
                Content = s.Notification.Content
            }).ToList();
            SmsDataWrapper result = new SmsDataWrapper();

            result.SmsCount = q.Count();
            result.Sms      = q;
            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns a number of sms messages sent in a selected period of time
        /// </summary>
        /// <returns><see cref="IHttpActionResult"/></returns>
        public IHttpActionResult GetSmsSendingData(DateTime dateFrom, DateTime dateTo)
        {
            SmsDataWrapper result = _reportingManipulation.GetSmsSendingData(dateFrom, dateTo);

            return(Ok(result));
        }