Example #1
0
 public void FreshList(ShortMessageModel ShortMessageModel)
 {
     ShortMessageModel message = list.Where(x => x.Mobile == ShortMessageModel.Mobile).FirstOrDefault();
     if (list.Remove(message))
     {
         EnList(ShortMessageModel);
     }
 }
Example #2
0
        public ShortMessageModel Post([FromBody] IncomingShortMessageModel incomingMessage)
        {
            if (incomingMessage == null)
            {
                return(new ShortMessageModel());
            }

            ShortMessageModel shortMessageModel = new ShortMessageModel()
            {
                Created = DateTime.Now,
                Text    = incomingMessage.Text
            };

            var consumer = valueRepository.Get(incomingMessage.ConsumerKey);

            //Consumer does not exist
            if (consumer == null)
            {
                consumer        = new ConsumerModel();
                consumer.Key    = incomingMessage.ConsumerKey;
                consumer.Secret = incomingMessage.ConsumerSecret;

                consumer.ShortMessages.Add(shortMessageModel);
                valueRepository.Update(consumer);
            }
            else
            {
                //Consumer already exists, check secret
                if (consumer.Secret == incomingMessage.ConsumerSecret)
                {
                    consumer.ShortMessages.Add(shortMessageModel);
                    valueRepository.Update(consumer);
                }
            }

            return(shortMessageModel);
        }
Example #3
0
 public void FreshList(ShortMessageModel ShortMessageModel)
 {
     return;
 }
Example #4
0
 public void EnList(ShortMessageModel ShortMessageModel)
 {
     return;
 }
Example #5
0
 public void EnList(ShortMessageModel ShortMessageModel)
 {
     list.Add(ShortMessageModel);
 }
Example #6
0
 public void DeList(ShortMessageModel ShortMessageModel)
 {
     list.Remove(ShortMessageModel);
 }
 public IActionResult ResponseAddMessage([FromServices] MessageService messageService, ShortMessageModel data)
 {
     messageService.AddMessage(data);
     this.TempData["responseAddMessage"] = "Add message success";
     return(RedirectToAction("Message"));
 }
Example #8
0
 public void FreshList(ShortMessageModel ShortMessageModel)
 {
     return;
 }
Example #9
0
 public void EnList(ShortMessageModel ShortMessageModel)
 {
     return;
 }