public async Task <IActionResult> Delete(int?id, Reservation reservation)
        {
            if (id == null)
            {
                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                _dbContext.Remove(reservation);
                await _dbContext.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
        }
Esempio n. 2
0
        public async Task <IActionResult> Delete(Billing billing)
        {
            if (billing == null)
            {
                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                _dbContext.Remove(billing);
                await _dbContext.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
                //return View(billing);
            }
        }
Esempio n. 3
0
        public async Task <IActionResult> Delete(int?id, Visitor visitor)
        {
            if (ModelState.IsValid)
            {
                if (id == null)
                {
                    return(RedirectToAction(nameof(Index)));
                }
                else
                {
                    _dbContext.Remove(visitor);
                    await _dbContext.SaveChangesAsync();

                    return(RedirectToAction(nameof(Index)));
                }
            }
            return(View(visitor));
        }