public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Log).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LogExists(Log.LogID)) { return(NotFound()); } else { throw; } } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Log.Add(Log); await _context.SaveChangesAsync(); return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } bool contains = _context.WorkTask.AsEnumerable().Any(row => WorkTask.TaskName.Equals(row.TaskName)); if (!contains) { _context.WorkTask.Add(WorkTask); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } Project = await _context.Project.FindAsync(id); if (Project != null) { _context.Project.Remove(Project); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } WorkTask = await _context.WorkTask.FindAsync(id); if (WorkTask != null) { _context.WorkTask.Remove(WorkTask); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }