Exemple #1
0
        public async Task <IActionResult> OnPostDelete(int ID)
        {
            var Connection = _db.ConnectionsItems.Find(ID);

            _db.ConnectionsItems.Remove(Connection);

            await _db.SaveChangesAsync();

            return(RedirectToPage());
        }
Exemple #2
0
        public async Task <IActionResult> OnPost()
        {
            if (ModelState.IsValid)
            {
                await _db.SaveChangesAsync();

                afterAddMessage = "List item updated successfully!";

                return(RedirectToPage("Index"));
            }
            else
            {
                return(RedirectToPage());
            }
        }
Exemple #3
0
        public async Task <IActionResult> Onpost()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            else
            {
                _db.ConnectionsItems.Add(ConnectionsTest);

                await _db.SaveChangesAsync();

                afterAddMessage = "!new connection made!";

                return(RedirectToPage("index"));
            }
        }
Exemple #4
0
        public async Task <IActionResult> OnPost()
        {
            if (ModelState.IsValid)
            {
                var connectionInDb = _db.ConnectionsItems.Find(Connections.ID);
                connectionInDb.Connections           = Connections.gamerGamer;
                connectionInDb.ConnectionDescription = Connections.GameGame;


                await _db.SaveChangesAsync();

                afterAddMessage = "List item updated successfully!";

                return(RedirectToPage("Index"));
            }
            else
            {
                return(RedirectToPage());
            }
        }