public async Task <IActionResult> CreateOrEditArticle(Article article,
                                                              string AuthorFilter,
                                                              int AuthorIdAdd, int AuthorIdRemove, decimal AuthorPart,
                                                              int NirSpecialIdAdd, int NirSpecialIdRemove,
                                                              int NirTemaIdAdd, int NirTemaIdRemove,
                                                              CreateOrEditNirDataModeEnum mode, IFormFile uploadFile)
        {
            Article articleEntry = _articlesRepository.GetArticle(article.ArticleId);

            if (articleEntry == null)
            {
                if (uploadFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadArticleAsync(article, uploadFile);
                }
                _articlesRepository.AddArticle(article);
                articleEntry = article;
            }
            else
            {
                if (uploadFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadArticleAsync(articleEntry, uploadFile);

                    article.FileModelId = articleEntry.FileModelId;
                }
                article.ArticleNirSpecials = articleEntry.ArticleNirSpecials;
                article.ArticleAuthors     = articleEntry.ArticleAuthors;
                article.ArticleNirTemas    = articleEntry.ArticleNirTemas;
                _articlesRepository.UpdateArticle(articleEntry, article);
            }


            switch (mode)
            {
            case CreateOrEditNirDataModeEnum.Saving:
                article.RowStatusId = (int)RowStatusEnum.NotConfirmed;
                _articlesRepository.UpdateArticle(articleEntry, article);
                return(RedirectToAction(nameof(Index)));

            case CreateOrEditNirDataModeEnum.Canceling:
                if (article.RowStatusId == null)
                {
                    await _articlesRepository.RemoveArticleAsync(articleEntry.ArticleId);
                }
                return(RedirectToAction(nameof(Index)));

            case CreateOrEditNirDataModeEnum.AddingAuthor:
                if (AuthorIdAdd != 0 && article.ArticleAuthors != null)
                {
                    var isExists = article.ArticleAuthors.FirstOrDefault(a => a.AuthorId == AuthorIdAdd) != null;
                    if (!isExists)
                    {
                        article.ArticleAuthors.Add(new ArticleAuthor
                        {
                            AuthorId   = AuthorIdAdd,
                            AuthorPart = AuthorPart
                        });
                        _articlesRepository.UpdateArticle(articleEntry, article);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingAuthor:
                break;

            case CreateOrEditNirDataModeEnum.RemovingAuthor:
                if (AuthorIdRemove != 0)
                {
                    var articleAuthorsToRemove = article.ArticleAuthors.FirstOrDefault(aa => aa.AuthorId == AuthorIdRemove);
                    if (articleAuthorsToRemove != null)
                    {
                        article.ArticleAuthors.Remove(articleAuthorsToRemove);
                        _articlesRepository.UpdateArticle(articleEntry, article);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.ApplyAuthorFilter:
                break;

            case CreateOrEditNirDataModeEnum.AddingNirSpecial:
                if (NirSpecialIdAdd != 0)
                {
                    var isExists = article.ArticleNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdAdd) != null;
                    if (!isExists)
                    {
                        article.ArticleNirSpecials.Add(new ArticleNirSpecial {
                            NirSpecialId = NirSpecialIdAdd
                        });
                        _articlesRepository.UpdateArticle(articleEntry, article);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirSpecial:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirSpecial:
                if (NirSpecialIdRemove != 0)
                {
                    var articleToRemove = article.ArticleNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdRemove);
                    if (articleToRemove != null)
                    {
                        article.ArticleNirSpecials.Remove(articleToRemove);
                        _articlesRepository.UpdateArticle(articleEntry, article);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.AddingNirTema:
                if (NirTemaIdAdd != 0)
                {
                    var isExists = article.ArticleNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdAdd) != null;
                    if (!isExists)
                    {
                        article.ArticleNirTemas.Add(new ArticleNirTema {
                            NirTemaId = NirTemaIdAdd
                        });
                        _articlesRepository.UpdateArticle(articleEntry, article);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirTema:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirTema:
                if (NirTemaIdRemove != 0)
                {
                    var articleToRemove = article.ArticleNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdRemove);
                    if (articleToRemove != null)
                    {
                        article.ArticleNirTemas.Remove(articleToRemove);
                        _articlesRepository.UpdateArticle(articleEntry, article);
                    }
                }
                break;

            default:
                break;
            }

            ViewBag.AuthorFilter    = AuthorFilter;
            ViewBag.Authors         = _selectListRepository.GetSelectListAuthors(AuthorFilter);
            ViewBag.ScienceJournals = _selectListRepository.GetSelectListScienceJournals(article.ScienceJournalId);
            ViewBag.Years           = _selectListRepository.GetSelectListYears(article.YearId);
            ViewBag.NirSpecials     = _selectListRepository.GetSelectListNirSpecials();
            ViewBag.NirTemas        = _selectListRepository.GetSelectListNirTemas();

            return(View(articleEntry));
        }
        public IActionResult CreateOrEdit(ScienceJournal scienceJournal,
                                          int CitationBaseIdAdd, int CitationBaseIdRemove,
                                          CreateOrEditNirDataModeEnum mode)
        {
            ScienceJournal scienceJournalEntry = _scienceJournalRepository.GetScienceJournal(scienceJournal.ScienceJournalId);

            if (scienceJournalEntry == null)
            {
                _scienceJournalRepository.CreateScienceJournal(scienceJournal);
                scienceJournalEntry = scienceJournal;
            }
            else
            {
                scienceJournal.ScienceJournalCitationBases = scienceJournalEntry.ScienceJournalCitationBases;
                _scienceJournalRepository.UpdateScienceJournal(scienceJournalEntry, scienceJournal);
            }

            switch (mode)
            {
            case CreateOrEditNirDataModeEnum.Saving:
                _scienceJournalRepository.UpdateScienceJournal(scienceJournalEntry, scienceJournal);
                return(RedirectToAction("Index"));

            case CreateOrEditNirDataModeEnum.Canceling:
                return(RedirectToAction("Index"));

            case CreateOrEditNirDataModeEnum.AddingCitationBase:
                if (CitationBaseIdAdd != 0)
                {
                    var isExists = scienceJournal.ScienceJournalCitationBases.FirstOrDefault(s => s.CitationBaseId == CitationBaseIdAdd) != null;
                    if (!isExists)
                    {
                        scienceJournal.ScienceJournalCitationBases.Add(new ScienceJournalCitationBase {
                            CitationBaseId = CitationBaseIdAdd
                        });
                        _scienceJournalRepository.UpdateScienceJournal(scienceJournalEntry, scienceJournal);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingCitationBase:
                break;

            case CreateOrEditNirDataModeEnum.RemovingCitationBase:
                if (CitationBaseIdRemove != 0)
                {
                    var citationBaseToRemove = scienceJournal.ScienceJournalCitationBases.FirstOrDefault(s => s.CitationBaseId == CitationBaseIdRemove);
                    if (citationBaseToRemove != null)
                    {
                        scienceJournal.ScienceJournalCitationBases.Remove(citationBaseToRemove);
                        _scienceJournalRepository.UpdateScienceJournal(scienceJournalEntry, scienceJournal);
                    }
                }
                break;

            default:
                break;
            }

            ViewBag.CitationBases = _selectListRepository.GetSelectListCitationBases();

            return(View(scienceJournalEntry));
        }
Esempio n. 3
0
        public async Task <IActionResult> CreateOrEditMonograf(Monograf monograf,
                                                               string AuthorFilter,
                                                               int AuthorIdAdd, int AuthorIdRemove, decimal AuthorPart,
                                                               int NirSpecialIdAdd, int NirSpecialIdRemove,
                                                               int NirTemaIdAdd, int NirTemaIdRemove,
                                                               CreateOrEditNirDataModeEnum mode, IFormFile uploadedFile)
        {
            Monograf monografEntry = _userProfileRepository.GetMonograf(monograf.MonografId, User.Identity.Name);

            if (monografEntry == null)
            {
                if (uploadedFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadMonografAsync(monograf, uploadedFile);
                }
                _userProfileRepository.CreateMonograf(monograf, User.Identity.Name);
                monografEntry = monograf;
            }
            else
            {
                if (uploadedFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadMonografAsync(monografEntry, uploadedFile);

                    monograf.FileModelId = monografEntry.FileModelId;
                }
                monograf.MonografNirSpecials = monografEntry.MonografNirSpecials;
                monograf.MonografAuthors     = monografEntry.MonografAuthors;
                monograf.MonografNirTemas    = monografEntry.MonografNirTemas;
                _userProfileRepository.UpdateMonograf(monografEntry, monograf);
            }

            switch (mode)
            {
            case CreateOrEditNirDataModeEnum.Saving:
                monograf.RowStatusId = (int)RowStatusEnum.NotConfirmed;
                _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                return(RedirectToAction("Monografs"));

            case CreateOrEditNirDataModeEnum.Canceling:
                if (monograf.RowStatusId == null)
                {
                    _userProfileRepository.RemoveMonograf(monografEntry.MonografId, User.Identity.Name);
                }
                return(RedirectToAction("Monografs"));

            case CreateOrEditNirDataModeEnum.AddingAuthor:
                if (AuthorIdAdd != 0)
                {
                    var isExists = monograf.MonografAuthors.FirstOrDefault(a => a.AuthorId == AuthorIdAdd) != null;
                    if (!isExists)
                    {
                        monograf.MonografAuthors.Add(new MonografAuthor
                        {
                            AuthorId   = AuthorIdAdd,
                            AuthorPart = AuthorPart
                        });
                        _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingAuthor:
                break;

            case CreateOrEditNirDataModeEnum.RemovingAuthor:
                if (AuthorIdRemove != 0)
                {
                    var monografAuthorsToRemove = monograf.MonografAuthors.FirstOrDefault(aa => aa.AuthorId == AuthorIdRemove);
                    if (monografAuthorsToRemove != null)
                    {
                        monograf.MonografAuthors.Remove(monografAuthorsToRemove);
                        _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.ApplyAuthorFilter:
                break;

            case CreateOrEditNirDataModeEnum.AddingNirSpecial:
                if (NirSpecialIdAdd != 0)
                {
                    var isExists = monograf.MonografNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdAdd) != null;
                    if (!isExists)
                    {
                        monograf.MonografNirSpecials.Add(new MonografNirSpecial {
                            NirSpecialId = NirSpecialIdAdd
                        });
                        _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirSpecial:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirSpecial:
                if (NirSpecialIdRemove != 0)
                {
                    var monografToRemove = monograf.MonografNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdRemove);
                    if (monografToRemove != null)
                    {
                        monograf.MonografNirSpecials.Remove(monografToRemove);
                        _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.AddingNirTema:
                if (NirTemaIdAdd != 0)
                {
                    var isExists = monograf.MonografNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdAdd) != null;
                    if (!isExists)
                    {
                        monograf.MonografNirTemas.Add(new MonografNirTema {
                            NirTemaId = NirTemaIdAdd
                        });
                        _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirTema:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirTema:
                if (NirTemaIdRemove != 0)
                {
                    var monografToRemove = monograf.MonografNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdRemove);
                    if (monografToRemove != null)
                    {
                        monograf.MonografNirTemas.Remove(monografToRemove);
                        _userProfileRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            default:
                break;
            }

            ViewBag.AuthorFilter = AuthorFilter;
            ViewBag.Authors      = _selectListRepository.GetSelectListAuthors(AuthorFilter);
            ViewBag.Years        = _selectListRepository.GetSelectListYears(monograf.YearId);
            ViewBag.NirSpecials  = _selectListRepository.GetSelectListNirSpecials();
            ViewBag.NirTemas     = _selectListRepository.GetSelectListNirTemas();

            return(View(monografEntry));
        }
Esempio n. 4
0
        public async Task <IActionResult> CreateOrEdit(Patent patent,
                                                       string AuthorFilter,
                                                       int AuthorIdAdd, int AuthorIdRemove, decimal AuthorPart,
                                                       int NirSpecialIdAdd, int NirSpecialIdRemove,
                                                       int NirTemaIdAdd, int NirTemaIdRemove,
                                                       CreateOrEditNirDataModeEnum mode, IFormFile uploadFile)
        {
            Patent patentEntry = _patentRepository.GetPatent(patent.PatentId);

            if (patentEntry == null)
            {
                if (uploadFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadPatentAsync(patent, uploadFile);
                }
                _patentRepository.AddPatent(patent);
                patentEntry = patent;
            }
            else
            {
                if (uploadFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadPatentAsync(patentEntry, uploadFile);

                    patent.FileModelId = patentEntry.FileModelId;
                }

                patent.PatentAuthors     = patentEntry.PatentAuthors;
                patent.PatentVid         = patentEntry.PatentVid;
                patent.PatentNirSpecials = patentEntry.PatentNirSpecials;
                patent.PatentNirTemas    = patentEntry.PatentNirTemas;
                _patentRepository.UpdatePatent(patentEntry, patent);
            }

            switch (mode)
            {
            case CreateOrEditNirDataModeEnum.Saving:
                patent.RowStatusId = (int)RowStatusEnum.NotConfirmed;
                _patentRepository.UpdatePatent(patentEntry, patent);
                return(RedirectToAction("Index"));

            case CreateOrEditNirDataModeEnum.Canceling:
                if (patent.RowStatusId == null)
                {
                    _patentRepository.RemovePatentAsync(patentEntry.PatentId);
                }
                return(RedirectToAction("Index"));

            case CreateOrEditNirDataModeEnum.AddingAuthor:
                if (AuthorIdAdd != 0 && patent.PatentAuthors != null)
                {
                    var isExists = patent.PatentAuthors.FirstOrDefault(p => p.AuthorId == AuthorIdAdd) != null;
                    if (!isExists)
                    {
                        patent.PatentAuthors.Add(new PatentAuthor {
                            AuthorId   = AuthorIdAdd,
                            AuthorPart = AuthorPart
                        });
                        _patentRepository.UpdatePatent(patentEntry, patent);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingAuthor:
                break;

            case CreateOrEditNirDataModeEnum.RemovingAuthor:
                if (AuthorIdRemove != 0)
                {
                    var patentAuthorsToRemove = patent.PatentAuthors.FirstOrDefault(pp => pp.AuthorId == AuthorIdRemove);
                    if (patentAuthorsToRemove != null)
                    {
                        patent.PatentAuthors.Remove(patentAuthorsToRemove);
                        _patentRepository.UpdatePatent(patentEntry, patent);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.ApplyAuthorFilter:
                break;

            case CreateOrEditNirDataModeEnum.AddingNirSpecial:
                if (NirSpecialIdAdd != 0)
                {
                    var isExists = patent.PatentNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdAdd) != null;
                    if (!isExists)
                    {
                        patent.PatentNirSpecials.Add(new PatentNirSpecial {
                            NirSpecialId = NirSpecialIdAdd
                        });
                        _patentRepository.UpdatePatent(patentEntry, patent);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirSpecial:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirSpecial:
                if (NirSpecialIdRemove != 0)
                {
                    var patentToRemove = patent.PatentNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdRemove);
                    if (patentToRemove != null)
                    {
                        patent.PatentNirSpecials.Remove(patentToRemove);
                        _patentRepository.UpdatePatent(patentEntry, patent);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.AddingNirTema:
                if (NirTemaIdAdd != 0)
                {
                    var isExists = patent.PatentNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdAdd) != null;
                    if (!isExists)
                    {
                        patent.PatentNirTemas.Add(new PatentNirTema {
                            NirTemaId = NirTemaIdAdd
                        });
                        _patentRepository.UpdatePatent(patentEntry, patent);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirTema:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirTema:
                if (NirTemaIdRemove != 0)
                {
                    var patentToRemove = patent.PatentNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdRemove);
                    if (patentToRemove != null)
                    {
                        patent.PatentNirTemas.Remove(patentToRemove);
                        _patentRepository.UpdatePatent(patentEntry, patent);
                    }
                }
                break;

            default:
                break;
            }

            ViewBag.AuthorFilter = AuthorFilter;
            ViewBag.Authors      = _selectListRepository.GetSelectListAuthors(AuthorFilter);
            ViewBag.Years        = _selectListRepository.GetSelectListYears(patent.YearId);
            ViewBag.NirSpecials  = _selectListRepository.GetSelectListNirSpecials();
            ViewBag.NirTemas     = _selectListRepository.GetSelectListNirTemas();
            ViewBag.PatentVids   = _selectListRepository.GetSelectListPatentVids(patent.PatentVidId == null ? 0 : (int)patent.PatentVidId);

            return(View(patentEntry));
        }
        public async Task <IActionResult> CreateOrEdit(Monograf monograf,
                                                       string AuthorFilter,
                                                       int AuthorIdAdd, int AuthorIdRemove, decimal AuthorPart,
                                                       int NirSpecialIdAdd, int NirSpecialIdRemove,
                                                       int NirTemaIdAdd, int NirTemaIdRemove,
                                                       CreateOrEditNirDataModeEnum mode,
                                                       IFormFile uploadedFile)
        {
            Monograf monografEntry = _monografRepository.GetMonograf(monograf.MonografId);

            if (monografEntry == null)
            {
                if (uploadedFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadMonografAsync(monograf, uploadedFile);
                }
                _monografRepository.AddMonograf(monograf);
                monografEntry = monograf;
            }
            else
            {
                if (uploadedFile != null)
                {
                    FileModel f = await _fileModelRepository.UploadMonografAsync(monografEntry, uploadedFile);

                    monograf.FileModelId = monografEntry.FileModelId;
                }
                monograf.MonografNirSpecials = monografEntry.MonografNirSpecials;
                monograf.MonografAuthors     = monografEntry.MonografAuthors;
                monograf.MonografNirTemas    = monografEntry.MonografNirTemas;
                _monografRepository.UpdateMonograf(monografEntry, monograf);
            }

            switch (mode)
            {
            case CreateOrEditNirDataModeEnum.Saving:
                monograf.RowStatusId = (int)RowStatusEnum.NotConfirmed;
                _monografRepository.UpdateMonograf(monografEntry, monograf);
                return(RedirectToAction(nameof(Index)));

            case CreateOrEditNirDataModeEnum.Canceling:
                if (monograf.RowStatusId == null)
                {
                    _monografRepository.RemoveMonografAsync(monografEntry.MonografId);
                }
                return(RedirectToAction(nameof(Index)));

            case CreateOrEditNirDataModeEnum.AddingAuthor:
                if (AuthorIdAdd != 0 && monograf.MonografAuthors != null)
                {
                    var isExist = monografEntry.MonografAuthors.FirstOrDefault(a => a.AuthorId == AuthorIdAdd) != null;
                    if (!isExist)
                    {
                        monograf.MonografAuthors.Add(new MonografAuthor
                        {
                            AuthorId   = AuthorIdAdd,
                            AuthorPart = AuthorPart
                        });
                        _monografRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingAuthor:
                break;

            case CreateOrEditNirDataModeEnum.RemovingAuthor:
                if (AuthorIdRemove != 0)
                {
                    var monografAuthorsToRemove = monograf.MonografAuthors.FirstOrDefault(aa => aa.AuthorId == AuthorIdRemove);
                    if (monografAuthorsToRemove != null)
                    {
                        monograf.MonografAuthors.Remove(monografAuthorsToRemove);
                        _monografRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.ApplyAuthorFilter:
                break;

            case CreateOrEditNirDataModeEnum.AddingNirSpecial:
                if (NirSpecialIdAdd != 0)
                {
                    var isExist = monograf.MonografNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdAdd) != null;
                    if (!isExist)
                    {
                        monograf.MonografNirSpecials.Add(new MonografNirSpecial {
                            NirSpecialId = NirSpecialIdAdd
                        });
                        _monografRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirSpecial:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirSpecial:
                if (NirSpecialIdRemove != 0)
                {
                    var monografToRemove = monograf.MonografNirSpecials.FirstOrDefault(s => s.NirSpecialId == NirSpecialIdRemove);
                    if (monografToRemove != null)
                    {
                        monograf.MonografNirSpecials.Remove(monografToRemove);
                        _monografRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.AddingNirTema:
                if (NirTemaIdAdd != 0)
                {
                    var isExists = monograf.MonografNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdAdd) != null;
                    if (!isExists)
                    {
                        monograf.MonografNirTemas.Add(new MonografNirTema {
                            NirTemaId = NirTemaIdAdd
                        });
                        _monografRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            case CreateOrEditNirDataModeEnum.EditingNirTema:
                break;

            case CreateOrEditNirDataModeEnum.RemovingNirTema:
                if (NirTemaIdRemove != 0)
                {
                    var monografToRemove = monograf.MonografNirTemas.FirstOrDefault(s => s.NirTemaId == NirTemaIdRemove);
                    if (monografToRemove != null)
                    {
                        monograf.MonografNirTemas.Remove(monografToRemove);
                        _monografRepository.UpdateMonograf(monografEntry, monograf);
                    }
                }
                break;

            default:
                break;
            }
            ViewBag.AuthorFilter = AuthorFilter;
            ViewBag.Authors      = _selectListRepository.GetSelectListAuthors(AuthorFilter);
            ViewBag.Years        = _selectListRepository.GetSelectListYears(monograf.YearId);
            ViewBag.NirSpecials  = _selectListRepository.GetSelectListNirSpecials();
            ViewBag.NirTemas     = _selectListRepository.GetSelectListNirTemas();

            return(View(monografEntry));


            //if (ModelState.IsValid && uploadedFile != null)
            //{

            //    FileModel f = await _fileModelRepository.UploadMonografAsync(monograf, uploadedFile);
            //}
            //ViewData["FileModelId"] = new SelectList(_context.Files, "Id", "Name", monograf.FileModelId);
            //ViewData["RowStatusId"] = new SelectList(_context.RowStatuses, "RowStatusId", "RowStatusName", monograf.RowStatusId);
            //ViewData["YearId"] = new SelectList(_context.Years, "YearId", "YearName", monograf.YearId);
            //return View(monograf);
        }