Exemplo n.º 1
0
        public ActionResult <StudentListAddViewModel> AddStudentList(StudentListAddViewModel studentListAddViewModel)
        {
            StudentListAddViewModel studentListAdd = new StudentListAddViewModel();

            try
            {
                if (studentListAddViewModel.studentAddViewModelList.FirstOrDefault().studentMaster.SchoolId > 0)
                {
                    studentListAdd = _studentService.AddStudentList(studentListAddViewModel);
                }
                else
                {
                    studentListAdd._token      = studentListAddViewModel._token;
                    studentListAdd._tenantName = studentListAddViewModel._tenantName;
                    studentListAdd._failure    = true;
                    studentListAdd._message    = "Please enter valid school id";
                }
            }
            catch (Exception es)
            {
                studentListAdd._failure = true;
                studentListAdd._message = es.Message;
            }
            return(studentListAdd);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add Student List
        /// </summary>
        /// <param name="studentListAddViewModel"></param>
        /// <returns></returns>
        public StudentListAddViewModel AddStudentList(StudentListAddViewModel studentListAddViewModel)
        {
            StudentListAddViewModel studentListAdd = new StudentListAddViewModel();

            if (TokenManager.CheckToken(studentListAddViewModel._tenantName + studentListAddViewModel._userName, studentListAddViewModel._token))
            {
                studentListAdd = this.studentRepository.AddStudentList(studentListAddViewModel);
            }
            else
            {
                studentListAdd._failure = true;
                studentListAdd._message = TOKENINVALID;
            }
            return(studentListAdd);
        }
Exemplo n.º 3
0
        public ActionResult <StudentListAddViewModel> AddStudentList(StudentListAddViewModel studentListAddViewModel)
        {
            StudentListAddViewModel studentListAdd = new StudentListAddViewModel();

            try
            {
                studentListAdd = _studentService.AddStudentList(studentListAddViewModel);
            }
            catch (Exception es)
            {
                studentListAdd._failure = true;
                studentListAdd._message = es.Message;
            }
            return(studentListAdd);
        }