Пример #1
0
        public async Task <bool> EditLastMessageAsync(LastMessageDTO lastmessage)
        {
            var path   = Properties.Resources.editLastMessagePath;
            var result = await _apiHelper.Put(path, lastmessage);

            return(result != null && result.ResponseType == ResponseType.Success);
        }
Пример #2
0
        public void AddLastMessage(LastMessageDTO lastMessageDTO)
        {
            var lastMessage = MapperExtension.mapper.Map <LastMessageDTO, LastMessage>(lastMessageDTO);

            _db.LastMessages.Add(lastMessage);
            _db.SaveChanges();
        }
Пример #3
0
        public void EditLastMessage(LastMessageDTO lastMessageDTO)
        {
            var lastMessage = MapperExtension.mapper.Map <LastMessageDTO, LastMessage>(lastMessageDTO);

            _db.Entry(_db.LastMessages.Find(lastMessageDTO.PairId)).CurrentValues.SetValues(lastMessage);
            _db.SaveChanges();
        }
Пример #4
0
 public bool EditLastMessage(LastMessageDTO lastMessage)
 {
     try
     {
         _repository.EditLastMessage(lastMessage);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Пример #5
0
 public IHttpActionResult EditLastMessage([FromBody] LastMessageDTO lastmessage)
 {
     if (string.IsNullOrEmpty(lastmessage.LastMessage1))
     {
         return(BadRequest());
     }
     if (_bll.EditLastMessage(lastmessage))
     {
         return(Ok());
     }
     return(InternalServerError());
 }