public ActionResult <StudentCommentAddViewModel> DeleteStudentComment(StudentCommentAddViewModel studentCommentAddViewModel) { StudentCommentAddViewModel studentCommentDelete = new StudentCommentAddViewModel(); try { if (studentCommentAddViewModel.studentComments.SchoolId > 0) { studentCommentDelete = _studentService.DeleteStudentComment(studentCommentAddViewModel); } else { studentCommentDelete._token = studentCommentAddViewModel._token; studentCommentDelete._tenantName = studentCommentAddViewModel._tenantName; studentCommentDelete._failure = true; studentCommentDelete._message = "Please enter valid school id"; } } catch (Exception es) { studentCommentDelete._failure = true; studentCommentDelete._message = es.Message; } return(studentCommentDelete); }
/// <summary> /// Delete StudentComment /// </summary> /// <param name="studentCommentAddViewModel"></param> /// <returns></returns> public StudentCommentAddViewModel DeleteStudentComment(StudentCommentAddViewModel studentCommentAddViewModel) { StudentCommentAddViewModel studentCommentDelete = new StudentCommentAddViewModel(); if (TokenManager.CheckToken(studentCommentAddViewModel._tenantName + studentCommentAddViewModel._userName, studentCommentAddViewModel._token)) { studentCommentDelete = this.studentRepository.DeleteStudentComment(studentCommentAddViewModel); } else { studentCommentDelete._failure = true; studentCommentDelete._message = TOKENINVALID; } return(studentCommentDelete); }
/// <summary> /// Save StudentComment /// </summary> /// <param name="studentCommentAddViewModel"></param> /// <returns></returns> public StudentCommentAddViewModel SaveStudentComment(StudentCommentAddViewModel studentCommentAddViewModel) { StudentCommentAddViewModel studentCommentAdd = new StudentCommentAddViewModel(); if (TokenManager.CheckToken(studentCommentAddViewModel._tenantName, studentCommentAddViewModel._token)) { studentCommentAdd = this.studentRepository.AddStudentComment(studentCommentAddViewModel); } else { studentCommentAdd._failure = true; studentCommentAdd._message = TOKENINVALID; } return(studentCommentAdd); }