public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } TransWarehouseDocSeriesDef = await _context.TransWarehouseDocSeriesDefs.FindAsync(id); if (TransWarehouseDocSeriesDef != null) { _context.TransWarehouseDocSeriesDefs.Remove(TransWarehouseDocSeriesDef); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } TransWarehouseDocSeriesDef = await _context.TransWarehouseDocSeriesDefs .Include(t => t.Company) .Include(t => t.TransWarehouseDocTypeDef).FirstOrDefaultAsync(m => m.Id == id); if (TransWarehouseDocSeriesDef == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } TransWarehouseDocSeriesDef = await _context.TransWarehouseDocSeriesDefs .Include(t => t.Company) .Include(t => t.TransWarehouseDocTypeDef).FirstOrDefaultAsync(m => m.Id == id); if (TransWarehouseDocSeriesDef == null) { return(NotFound()); } ViewData["CompanyId"] = new SelectList(_context.Companies.OrderBy(p => p.Code).AsNoTracking(), "Id", "Code"); ViewData["TransWarehouseDocTypeDefId"] = new SelectList(_context.TransWarehouseDocTypeDefs.OrderBy(p => p.Name).AsNoTracking(), "Id", "Name"); return(Page()); }