Exemplo n.º 1
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

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

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

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

            Property_Oction = await _context.Property_Oction
                .Include(p => p.Customer_Detail)
                .Include(p => p.Dealer_Detail)
                .Include(p => p.Property_Detail).FirstOrDefaultAsync(m => m.Id == id);

            if (Property_Oction == null)
            {
                return NotFound();
            }
            return Page();
        }
Exemplo n.º 3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Property_Oction = await _context.Property_Oction
                              .Include(p => p.Customer_Detail)
                              .Include(p => p.Dealer_Detail)
                              .Include(p => p.Property_Detail).FirstOrDefaultAsync(m => m.Id == id);

            if (Property_Oction == null)
            {
                return(NotFound());
            }
            ViewData["Customer_DetailId"] = new SelectList(_context.Customer_Detail, "Id", "Customer_Name");
            ViewData["Dealer_DetailId"]   = new SelectList(_context.Dealer_Detail, "Id", "Dealer_Name");
            ViewData["Property_DetailId"] = new SelectList(_context.Property_Detail, "Id", "Area");
            return(Page());
        }