Ejemplo n.º 1
0
        public ActionResult <StudentDocumentAddViewModel> AddStudentDocument(StudentDocumentAddViewModel studentDocumentAddViewModel)
        {
            StudentDocumentAddViewModel studentDocoumentAdd = new StudentDocumentAddViewModel();

            try
            {
                if (studentDocumentAddViewModel.studentDocuments.FirstOrDefault().SchoolId > 0)
                {
                    studentDocoumentAdd = _studentService.SaveStudentDocument(studentDocumentAddViewModel);
                }
                else
                {
                    studentDocoumentAdd._token      = studentDocumentAddViewModel._token;
                    studentDocoumentAdd._tenantName = studentDocumentAddViewModel._tenantName;
                    studentDocoumentAdd._failure    = true;
                    studentDocoumentAdd._message    = "Please enter valid school id";
                }
            }
            catch (Exception es)
            {
                studentDocoumentAdd._failure = true;
                studentDocoumentAdd._message = es.Message;
            }
            return(studentDocoumentAdd);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Delete StudentDocument
        /// </summary>
        /// <param name="studentDocumentAddViewModel"></param>
        /// <returns></returns>
        public StudentDocumentAddViewModel DeleteStudentDocument(StudentDocumentAddViewModel studentDocumentAddViewModel)
        {
            StudentDocumentAddViewModel studentDocumentdelete = new StudentDocumentAddViewModel();

            if (TokenManager.CheckToken(studentDocumentAddViewModel._tenantName + studentDocumentAddViewModel._userName, studentDocumentAddViewModel._token))
            {
                studentDocumentdelete = this.studentRepository.DeleteStudentDocument(studentDocumentAddViewModel);
            }
            else
            {
                studentDocumentdelete._failure = true;
                studentDocumentdelete._message = TOKENINVALID;
            }
            return(studentDocumentdelete);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Save StudentDocument
        /// </summary>
        /// <param name="studentDocumentAddViewModel"></param>
        /// <returns></returns>
        public StudentDocumentAddViewModel SaveStudentDocument(StudentDocumentAddViewModel studentDocumentAddViewModel)
        {
            StudentDocumentAddViewModel studentDocumentAdd = new StudentDocumentAddViewModel();

            if (TokenManager.CheckToken(studentDocumentAddViewModel._tenantName, studentDocumentAddViewModel._token))
            {
                studentDocumentAdd = this.studentRepository.AddStudentDocument(studentDocumentAddViewModel);
            }
            else
            {
                studentDocumentAdd._failure = true;
                studentDocumentAdd._message = TOKENINVALID;
            }
            return(studentDocumentAdd);
        }