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

            Property_Aucation = await _context.Property_Aucation.FindAsync(id);

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

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

            Property_Aucation = await _context.Property_Aucation
                                .Include(p => p.Customer)
                                .Include(p => p.Dealer)
                                .Include(p => p.Property).FirstOrDefaultAsync(m => m.Id == id);

            if (Property_Aucation == null)
            {
                return(NotFound());
            }
            return(Page());
        }
コード例 #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Property_Aucation = await _context.Property_Aucation
                                .Include(p => p.Customer)
                                .Include(p => p.Dealer)
                                .Include(p => p.Property).FirstOrDefaultAsync(m => m.Id == id);

            if (Property_Aucation == null)
            {
                return(NotFound());
            }
            ViewData["CustomerId"] = new SelectList(_context.Customer, "Id", "Customer_Name");
            ViewData["DealerId"]   = new SelectList(_context.Dealer, "Id", "Dealer_Name");
            ViewData["PropertyId"] = new SelectList(_context.Property, "Id", "Area");
            return(Page());
        }