/// <summary> /// Добавить комментарий к заказу. БД /// </summary> /// <returns></returns> private async Task <IActionResult> AddOrderTempDesc() { using (MarketBotDbContext db = new MarketBotDbContext()) { var OrderTmp = db.OrderTemp.Where(o => o.FollowerId == FollowerId).FirstOrDefault(); if (OrderTmp != null) { OrderTmp.Text = Update.Message.Text; if (db.SaveChanges() > 0 && await SendMessage(OrderPreviewMsg.BuildMessage()) != null) { return(base.OkResult); } else { return(base.NotFoundResult); } } else { return(base.OkResult); } } }
/// <summary> /// Сообщение с деталями Заказа из таблицы OrderTemp /// </summary> /// <returns></returns> private async Task <IActionResult> SendOrderTemp() { if (OrderPreviewMsg == null) { OrderPreviewMsg = new OrderTempMessage(base.FollowerId, BotInfo.Id); } var message = OrderPreviewMsg.BuildMessage(); if (message != null && await EditMessage(message) != null) { return(base.OkResult); } else { return(base.NotFoundResult); } }