Beispiel #1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PRODUCTTOSLIDER = await _context.PRODUCTTOSLIDERs.FindAsync(id);

            if (PRODUCTTOSLIDER != null)
            {
                _context.PRODUCTTOSLIDERs.Remove(PRODUCTTOSLIDER);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Beispiel #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PRODUCTTOSLIDER = await _context.PRODUCTTOSLIDERs
                              .Include(p => p.product)
                              .Include(p => p.slidNew_Produc).FirstOrDefaultAsync(m => m.ProductId == id);

            if (PRODUCTTOSLIDER == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Beispiel #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PRODUCTTOSLIDER = await _context.PRODUCTTOSLIDERs
                              .Include(p => p.product)
                              .Include(p => p.slidNew_Produc).FirstOrDefaultAsync(m => m.ProductId == id);

            if (PRODUCTTOSLIDER == null)
            {
                return(NotFound());
            }
            ViewData["ProductId"]        = new SelectList(_context.products, "Id", "Id");
            ViewData["SlidNew_producId"] = new SelectList(_context.slidNew_Producs, "Id", "Id");
            return(Page());
        }