Example #1
0
        public async Task <IActionResult> ImportStudentFromExcelAsync()
        {
            var instituteId = await GetUserCurrentSelectedInstituteIdAsync();

            var user = await _userManager.FindByNameAsync(User.Identity.Name);

            var file = Request.Form.Files;

            if (file.Count != 0)
            {
                return(Ok(new { Message = await _studentManagementRepository.ImportStudentFromExcelAsync(instituteId, file[0], user.Id) }));
            }
            else
            {
                return(Ok(new { Message = "No file found" }));
            }
        }