Esempio n. 1
0
        private static void CheckPayed(object obj, ElapsedEventArgs e)
        {
            var            orderService = InjectDependency.GetInstance().GetOrderService();
            RequestCreator request      = new RequestCreator();
            string         response     = request.GetAnythink();

            var result = Serializer.Deserialize(response);

            List <Order> ordersFromFreeKasa = result.CollectionProperty.ToList();

            foreach (var orderFromKassa in ordersFromFreeKasa)
            {
                var order = orderService.Get(orderFromKassa.Id);

                if (order != null)
                {
                    if (order.Status == "new" && orderFromKassa.Status == "paid")
                    {
                        ChangeStatus(order, orderService, "paid");
                    }

                    if (order.Status == "new" && orderFromKassa.Status == "completed ")
                    {
                        ChangeStatus(order, orderService, "completed");
                    }
                }
            }
        }
Esempio n. 2
0
 public DetailsDeleteCommand(TelegramBotClient telegramBot, Message message, CallbackQuery query)
 {
     this.telegramBot    = telegramBot;
     this.message        = message;
     this.query          = query;
     orderDetailsService = InjectDependency.GetInstance().GetOrderDetailsService();
 }
Esempio n. 3
0
        public override void Execute()
        {
            var corses = InjectDependency.GetInstance().GetCourseService().GetAll();
            List <List <InlineKeyboardButton> > list = new List <List <InlineKeyboardButton> >();

            foreach (var course in corses)
            {
                list.Add(new List <InlineKeyboardButton>
                {
                    SetButtonTextAndCallBackData(course.Name, ComandsName.GetOneCourse + course.Id)
                });
            }

            var keyboard = new InlineKeyboardMarkup(list);

            telegramBot.SendTextMessageAsync(message.Chat.Id, MessageText.ViewCourses, replyMarkup: keyboard);
        }
Esempio n. 4
0
 public BasketItemsCommand(TelegramBotClient telegramBot, Message message)
 {
     this.telegramBot = telegramBot;
     this.message     = message;
     orderService     = InjectDependency.GetInstance().GetOrderService();
 }