Esempio n. 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);
        }
        public void AddLastMessage(LastMessageDTO lastMessageDTO)
        {
            var lastMessage = MapperExtension.mapper.Map <LastMessageDTO, LastMessage>(lastMessageDTO);

            _db.LastMessages.Add(lastMessage);
            _db.SaveChanges();
        }
        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();
        }
Esempio n. 4
0
 public bool EditLastMessage(LastMessageDTO lastMessage)
 {
     try
     {
         _repository.EditLastMessage(lastMessage);
     }
     catch
     {
         return(false);
     }
     return(true);
 }
Esempio n. 5
0
 public IHttpActionResult EditLastMessage([FromBody] LastMessageDTO lastmessage)
 {
     if (string.IsNullOrEmpty(lastmessage.LastMessage1))
     {
         return(BadRequest());
     }
     if (_bll.EditLastMessage(lastmessage))
     {
         return(Ok());
     }
     return(InternalServerError());
 }