public ActionResult Delete(List <int> ids) { try { if (ids.Count > 0) { int i = 0; foreach (var id in ids) { if (examService.DeleteExam(id) > 0) { i++; continue; } else { break; } } if (i > 0) { Success = "Delete Exam successfully!"; return(RedirectToAction("Index", "Exams")); } } Failure = "Something went wrong, please try again!"; return(RedirectToAction("Index", "Exams")); } catch (System.Exception exception) { Failure = exception.Message; return(RedirectToAction("Index", "Exams")); } }
public bool OtkaziPregled(int id) { var exam = _examService.GetExam(id); if (exam != null && Convert.ToInt32(HttpContext.User.Identity.Name) == exam.PacijentId) { return(_examService.DeleteExam(id)); } return(false); }
public IHttpActionResult DeleteExam(int examId) { Exam exam = examService.DeleteExam(examId); if (exam == null) { return(NotFound()); } return(Ok(exam)); }
public IActionResult Delete(int id) { var deleted = _service.DeleteExam(id); if (deleted) { return(Ok("Exam successfully deleted")); } return(BadRequest("There isn't any exam with that id")); }
public void DeleteExamTest() { IExamService target = CreateIExamService(); // TODO: Initialize to an appropriate value string testingNo = string.Empty; // TODO: Initialize to an appropriate value string examPlaceCode = string.Empty; // TODO: Initialize to an appropriate value ResponseMessage <bool> expected = null; // TODO: Initialize to an appropriate value ResponseMessage <bool> actual; actual = target.DeleteExam(testingNo, examPlaceCode); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public async Task <IActionResult> DeleteExam([FromRoute] int id) // nie trzeba { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var exam = await _service.FindExam(id); if (exam == false) { return(NotFound()); } await _service.DeleteExam(id); return(Ok(exam)); }
public async Task <string> DeleteRemoveExam(int id) { await _examService.DeleteExam(id); return("success"); }
public IActionResult DeleteExam([FromBody] int id) { Exam.DeleteExam(id); return(Content("1")); }
public IActionResult ExamDeleted(int id) { _examService.DeleteExam(id); return(View()); }
public async Task DeleteExam(string id) { await _service.DeleteExam(id); }
public async Task <Exam> DeleteExam([Bind("ExamId", "IndexNumber", "SubjectId")] int examId, string indexNumber, int subjectId) { return(await ExamService.DeleteExam(examId, indexNumber, subjectId)); }
// Delete exam from db. public ActionResult DeleteExam(Guid id, Guid subjectId) { examService.DeleteExam(id); Logger.Log.Info("User " + User.Identity.GetUserId() + "delete exam " + id); return(RedirectToAction("ViewExam", new { id = subjectId })); }