public async Task <IActionResult> PutCustomEvaluation(int id, CustomEvaluation customEvaluation) { if (id != customEvaluation.Id) { return(BadRequest()); } _context.Entry(customEvaluation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomEvaluationExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutEval(int id, Eval eval) { if (id != eval.EvalId) { return(BadRequest()); } _context.Entry(eval).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EvalExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTemplates(int id, Templates templates) { if (id != templates.Id) { return(BadRequest()); } _context.Entry(templates).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TemplatesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCrsmtr(string id, Crsmtr crsmtr) { if (id != crsmtr.CourseNo) { return(BadRequest()); } _context.Entry(crsmtr).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CrsmtrExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutQuestionAnswer(int id, QuestionAnswer questionAnswer) { if (id != questionAnswer.QuestionId) { return(BadRequest()); } _context.Entry(questionAnswer).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!QuestionAnswerExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutAllocate(int id, Allocate allocate) { if (id != allocate.AllId) { return(BadRequest()); } _context.Entry(allocate).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AllocateExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutTemplateType(AssignTemplates assignTemplates) { var templateType = _context.TemplateType.Where(t => t.AssignTo.StartsWith(assignTemplates.assignTo)).FirstOrDefault(); templateType.Tid = assignTemplates.tid; _context.Entry(templateType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { } return(Ok()); }