/// <summary>
        /// Показать платеж по id счета
        /// </summary>
        /// <param name="InvoiceId"></param>
        /// <param name="MessageId"></param>
        /// <returns></returns>
        private async Task <IActionResult> SendViewPayment(int PaymentId, int MessageId = 0)
        {
            try
            {
                var Payment = PaymentsFunction.GetPayment(PaymentId);

                if (Payment != null)
                {
                    BotMessage = new PaymentViewMessage(Payment);
                    await SendMessage(BotMessage.BuildMsg(), MessageId);
                }

                else
                {
                    await AnswerCallback("Данные по оплате отсутствуют", true);
                }

                return(OkResult);
            }

            catch
            {
                return(OkResult);
            }
        }
        /// <summary>
        /// Показать детали платежа /payment[id]
        /// </summary>
        /// <returns></returns>
        private async Task <IActionResult> SendViewPayment()
        {
            try
            {
                int Id = Convert.ToInt32(base.CommandName.Substring(PaymentCmd.Length));

                var Payment = PaymentsFunction.GetPayment(Id);

                BotMessage = new PaymentViewMessage(Payment);
                await SendMessage(BotMessage.BuildMsg());

                return(OkResult);
            }

            catch
            {
                return(OkResult);
            }
        }
Пример #3
0
        public override BotMessage BuildMsg()
        {
            if (Payment == null)
            {
                Payment = PaymentsFunction.GetPayment(PaymentId);
            }

            if (Payment != null && Payment.Invoice != null && Payment.Invoice.Orders.Count > 0)
            {
                ViewOrderBtn = BuildInlineBtn("Детали заказа", BuildCallData(OrderProccesingBot.CmdGetOrderAdmin, OrderProccesingBot.ModuleName, Payment.Invoice.Orders.FirstOrDefault().Id), base.PackageEmodji);

                ViewInvoiceBtn = BuildInlineBtn("Счет", BuildCallData(OrderProccesingBot.ViewInvoiceCmd, OrderProccesingBot.ModuleName, Payment.Invoice.Orders.FirstOrDefault().Id), base.PaperEmodji);

                SearchPaymentBtn = InlineKeyboardButton.WithSwitchInlineQueryCurrentChat("Платежи" + base.CreditCardEmodji, InlineFind.Payment + "|");

                base.TextMessage = "Платеж №" + Payment.Id.ToString() + " для Заказа №" + Payment.Invoice.Orders.FirstOrDefault().Number.ToString()
                                   + NewLine() + Bold("Дата добавления платежа:") + Payment.TimestampDataAdd.ToString() + NewLine() +
                                   Bold("Сумма:") + Payment.Summ.ToString() + NewLine() +
                                   Bold("ID Транзакции:") + Payment.TxId.ToString();

                base.MessageReplyMarkup = new InlineKeyboardMarkup(new[]
                {
                    new[]
                    {
                        ViewInvoiceBtn
                    },
                    new[]
                    {
                        ViewOrderBtn
                    },
                    new[]
                    {
                        SearchPaymentBtn
                    }
                });
            }
            return(this);
        }