// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Rooms).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RoomsExists(Rooms.ID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, enable the specific properties you want to bind to, for // more details, see https://aka.ms/RazorPagesCRUD. public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Clients.Add(Clients); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } Services = await _context.Services.FindAsync(id); if (Services != null) { _context.Services.Remove(Services); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(long?id) { if (id == null) { return(NotFound()); } Employee = await _context.Employee.FindAsync(id); if (Employee != null) { _context.Employee.Remove(Employee); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }