コード例 #1
0
ファイル: Create.cshtml.cs プロジェクト: mchelikam/MadEasy
 public IActionResult OnGet()
 {
     ViewData["AgentId"]       = new SelectList(_context.Agent, "Id", "FullName");
     ViewData["CityId"]        = new SelectList(_context.City, "Id", "Name");
     ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name");
     return(Page());
 }
コード例 #2
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Agent = await _context.Agent
                    .Include(a => a.SalesOffice).FirstOrDefaultAsync(m => m.Id == id);

            if (Agent == null)
            {
                return(NotFound());
            }
            ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name");
            return(Page());
        }
コード例 #3
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Dwelling = await _context.Dwelling
                       .Include(d => d.Agent)
                       .Include(d => d.City)
                       .Include(d => d.SalesOffice).FirstOrDefaultAsync(m => m.Id == id);

            if (Dwelling == null)
            {
                return(NotFound());
            }
            ViewData["AgentId"]       = new SelectList(_context.Agent, "Id", "FullName");
            ViewData["CityId"]        = new SelectList(_context.City, "Id", "Name");
            ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name");
            return(Page());
        }
コード例 #4
0
 public IActionResult OnGet()
 {
     ViewData["SalesOfficeId"] = new SelectList(_context.Set <SalesOffice>(), "Id", "Name");
     return(Page());
 }