// To protect from overposting attacks, please enable the specific properties you want to bind to, for // more details see https://aka.ms/RazorPagesCRUD. //Updates the operator. public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(Operator).State = EntityState.Modified; try { _context.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!OperatorExists(Operator.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. //Creates an operator . public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } _context.Operator.Add(Operator); _context.SaveChanges(); 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. //Creates a performance . public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } _context.TaskPerformance.Add(TaskPerformance); _context.SaveChanges(); return(RedirectToPage("./Index")); }
//Delets the operator. public IActionResult OnPost(int?id) { if (id == null) { return(NotFound()); } Operator = _context.Operator.Find(id); if (Operator != null) { _context.Operator.Remove(Operator); _context.SaveChanges(); } return(RedirectToPage("./Index")); }
//Removes the task public IActionResult OnPost(int?id) { if (id == null) { return(NotFound()); } Task = (from task in _context.Task where task.Id == id select task).FirstOrDefault(); if (Task != null) { _context.Task.Remove(Task); _context.SaveChanges(); } return(RedirectToPage("./Index")); }
//Delets the performance . public IActionResult OnPost(int?id) { if (id == null) { return(NotFound()); } TaskPerformance = (from performance in _context.TaskPerformance where performance.Id == id select performance).FirstOrDefault(); if (TaskPerformance != null) { _context.TaskPerformance.Remove(TaskPerformance); _context.SaveChanges(); } return(RedirectToPage("./Index")); }