Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
        /// <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);
        }