/// <summary>
        /// Удаляет учебный план, если он доступен пользователю
        /// </summary>
        /// <param name="eduPlanId"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        public async Task RemoveEduPlanByUserNameAsync(int eduPlanId, string userName)
        {
            var eduPlan = await GetEduPlanByUserNameAsync(eduPlanId, userName);

            if (eduPlan != null)
            {
                await _eduPlanRepository.RemoveEduPlanAsync(eduPlan);
            }
        }
Exemple #2
0
        public async Task <IActionResult> DeleteConfirmed(int id)
        {
            await _eduPlanRepository.RemoveEduPlanAsync(id);

            //var eduPlan = await _context.EduPlans.SingleOrDefaultAsync(m => m.EduPlanId == id);
            //_context.EduPlans.Remove(eduPlan);

            //KisVuzDotNetCore2.Models.Files.Files.RemoveFile(_context, _appEnvironment, eduPlan?.EduPlanPdfId);

            //await _context.SaveChangesAsync();

            return(RedirectToAction(nameof(Index)));
        }