예제 #1
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PartnerCompany = await _context.PartnerCompanies
                             .Include(p => p.Person).FirstOrDefaultAsync(m => m.Id == id);

            if (PartnerCompany == null)
            {
                return(NotFound());
            }
            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnPostAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PartnerCompany = await _context.PartnerCompanies.FindAsync(id);

            if (PartnerCompany != null)
            {
                PartnerCompany.IsDeleted = true;
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
예제 #3
0
        public async Task <IActionResult> OnGetAsync(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            PartnerCompany = await _context.PartnerCompanies
                             .Include(p => p.Person).FirstOrDefaultAsync(m => m.Id == id);

            if (PartnerCompany == null)
            {
                return(NotFound());
            }
            ViewData["PersonId"] = new SelectList(_context.People, "Id", "Id");
            return(Page());
        }