// To protect from overposting attacks, please 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(UnitType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UnitTypeExists(UnitType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
// To protect from overposting attacks, please 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.Tenancy.Add(Tenancy); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
// To protect from overposting attacks, please 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.UnitPrices.Add(UnitPrice); await _context.SaveChangesAsync(); return(RedirectToPage("./Index", new { UnitId = UnitPrice.UnitId })); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Property = await _context.Properties.FindAsync(id); if (Property != null) { _context.Properties.Remove(Property); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Unit = await _context.Units.FindAsync(id); if (Unit != null) { _context.Units.Remove(Unit); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Tenancy = await _context.Tenancy.FindAsync(id); if (Tenancy != null) { _context.Tenancy.Remove(Tenancy); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }