public async Task <ActionResult> Create([Bind("ixBotspielBotMessage,sBotspielBotMessage,sMyMessage,sYourReply")] BotspielBotMessagesPost botspielbotmessages)
        {
            long   ixBotspielBotMessage;
            string sMyMessage = "";

            if (ModelState.IsValid)
            {
                botspielbotmessages.UserName = User.Identity.Name;
                ixBotspielBotMessage         = await _botspielbotmessagesService.Create(botspielbotmessages);

                //Custom Code Start | Added Code Block
                _adapter.UpdateConversationUser(User.Identity.Name);
                //Custom Code End

                _adapter.SendTextToBotAsync(botspielbotmessages.sYourReply, ixBotspielBotMessage.ToString(),
                                            async(turnContext, cancellationToken) => await _botSpielBot.OnTurnAsync(turnContext), default(CancellationToken)).Wait();

                _activityBotResponse = _adapter.GetNextReply();

                while (_activityBotResponse != null)
                {
                    sMyMessage          += _activityBotResponse.Text;
                    _activityBotResponse = _adapter.GetNextReply();
                }

                return(RedirectToAction("Create", new { botReply = sMyMessage }));
            }

            return(View(botspielbotmessages));
        }
        public ActionResult DeleteConfirmed(long id)
        {
            BotspielBotMessagesPost botspielbotmessages = _botspielbotmessagesService.GetPost(id);

            botspielbotmessages.UserName = User.Identity.Name;
            _botspielbotmessagesService.Delete(botspielbotmessages);
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind("ixBotspielBotMessage,sBotspielBotMessage,sMyMessage,sYourReply")] BotspielBotMessagesPost botspielbotmessages)
        {
            if (ModelState.IsValid)
            {
                botspielbotmessages.UserName = User.Identity.Name;
                _botspielbotmessagesService.Edit(botspielbotmessages);
                return(RedirectToAction("Index"));
            }

            return(View(botspielbotmessages));
        }
        public ActionResult Edit(long id)
        {
            BotspielBotMessagesPost botspielbotmessages = _botspielbotmessagesService.GetPost(id);

            if (botspielbotmessages == null)
            {
                return(NotFound());
            }

            return(View(botspielbotmessages));
        }
        public ActionResult Create(string botReply = null)
        {
            BotspielBotMessagesPost botspielbotmessages = new BotspielBotMessagesPost();

            botspielbotmessages.sMyMessage = botReply;

            if (botspielbotmessages.sMyMessage == null)
            {
                botspielbotmessages.sMyMessage = "Hi. Say/type putaway, pick or cancel.";
            }
            else
            {
                botspielbotmessages.sMyMessage = botspielbotmessages.sMyMessage.Replace($@"{Environment.NewLine}", "<br>");
            }

            return(View(botspielbotmessages));
        }
Exemple #6
0
        public Task Delete(BotspielBotMessagesPost botspielbotmessagesPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._botspielbotmessagesRepository.RegisterDelete(botspielbotmessagesPost);
            try
            {
                this._botspielbotmessagesRepository.Commit();
            }
            catch (Exception ex)
            {
                this._botspielbotmessagesRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.CompletedTask);
        }
Exemple #7
0
        public Task <Int64> Create(BotspielBotMessagesPost botspielbotmessagesPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._botspielbotmessagesRepository.RegisterCreate(botspielbotmessagesPost);
            try
            {
                this._botspielbotmessagesRepository.Commit();
            }
            catch (Exception ex)
            {
                this._botspielbotmessagesRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.FromResult(botspielbotmessagesPost.ixBotspielBotMessage));
        }
Exemple #8
0
 public void RegisterDelete(BotspielBotMessagesPost botspielbotmessagesPost)
 {
     _context.BotspielBotMessagesPost.Remove(botspielbotmessagesPost);
 }
Exemple #9
0
 public void RegisterEdit(BotspielBotMessagesPost botspielbotmessagesPost)
 {
     _context.Entry(botspielbotmessagesPost).State = EntityState.Modified;
 }
Exemple #10
0
 public void RegisterCreate(BotspielBotMessagesPost botspielbotmessagesPost)
 {
     _context.BotspielBotMessagesPost.Add(botspielbotmessagesPost);
 }