Exemplo n.º 1
0
 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);
        }
Exemplo n.º 3
0
        public IHttpActionResult DeleteExam(int examId)
        {
            Exam exam = examService.DeleteExam(examId);

            if (exam == null)
            {
                return(NotFound());
            }

            return(Ok(exam));
        }
Exemplo n.º 4
0
        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"));
        }
Exemplo n.º 5
0
        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.");
        }
Exemplo n.º 6
0
        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));
        }
Exemplo n.º 7
0
        public async Task <string> DeleteRemoveExam(int id)
        {
            await _examService.DeleteExam(id);

            return("success");
        }
Exemplo n.º 8
0
 public IActionResult DeleteExam([FromBody] int id)
 {
     Exam.DeleteExam(id);
     return(Content("1"));
 }
Exemplo n.º 9
0
 public IActionResult ExamDeleted(int id)
 {
     _examService.DeleteExam(id);
     return(View());
 }
Exemplo n.º 10
0
 public async Task DeleteExam(string id)
 {
     await _service.DeleteExam(id);
 }
Exemplo n.º 11
0
 public async Task <Exam> DeleteExam([Bind("ExamId", "IndexNumber", "SubjectId")] int examId, string indexNumber, int subjectId)
 {
     return(await ExamService.DeleteExam(examId, indexNumber, subjectId));
 }
Exemplo n.º 12
0
 // 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 }));
 }