Ejemplo n.º 1
0
        public ActionResult <object> DeleteExam([FromBody] Model.DeleteExam delExam)
        {
            Init();
            if (!ModelState.IsValid)
            {
                Response.StatusCode = 400;
                return("Exam does not exist");
            }
            else
            {
                if (delExam.studentTermRegisterID == null)
                {
                    Response.StatusCode = 400;
                    return("Exam does not exist");
                }
                StringBuilder sbError = new StringBuilder("");

                List <Guid> list = new List <Guid>();
                list.Add(delExam.studentTermRegisterID);
                int numberDeleted = 0;
                var isDeleted     = _examService.Delete(list, delExam.teacherClassSubjectID, ref numberDeleted, ref sbError);

                if (!isDeleted)
                {
                    Response.StatusCode = 400;
                    return("Exam Delete failed");
                }
                else
                {
                    Response.StatusCode = 200;
                    return((string)"Exam Deleted Successfully");
                }
            }
        }