예제 #1
0
        public IActionResult DeleteClaimAddScienceJournal(ScienceJournalAddingClaim claim)
        {
            var myScienceJournalAddingClaims = _userProfileRepository.GetScienceJournalAddingClaims(User.Identity.Name);
            var claimEntry = myScienceJournalAddingClaims.FirstOrDefault(c => c.ScienceJournalAddingClaimId == claim.ScienceJournalAddingClaimId);

            if (claim == null)
            {
                return(NotFound());
            }
            _userProfileRepository.RemoveClaimAddScienceJournal(claimEntry);

            return(RedirectToAction(nameof(ScienceJournalAddingClaims)));
        }
예제 #2
0
        public IActionResult CreateClaimAddScienceJournal(ScienceJournalAddingClaim newClaim)
        {
            var appUser = _userProfileRepository.GetAppUser(User.Identity.Name);

            if (appUser == null)
            {
                return(NotFound());
            }

            newClaim.AppUserId   = appUser.Id;
            newClaim.RowStatusId = (int)RowStatusEnum.NotConfirmed;
            _userProfileRepository.CreateClaimAddScienceJournal(newClaim);

            return(RedirectToAction(nameof(ScienceJournalAddingClaims)));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("ScienceJournalAddingClaimId,ScienceJournalName,IsVak,IsZarubejn,ELibraryLink,CitationBasesList,RowStatusId")] ScienceJournalAddingClaim scienceJournalAddingClaim)
        {
            if (ModelState.IsValid)
            {
                if (scienceJournalAddingClaim.RowStatusId == null)
                {
                    scienceJournalAddingClaim.RowStatusId = (int?)RowStatusEnum.NotConfirmed;
                }
                scienceJournalAddingClaim.AppUserId = _userProfileRepository.GetAppUser(User.Identity.Name).Id;
                if (scienceJournalAddingClaim.AppUserId == null)
                {
                    return(NotFound());
                }

                _context.Add(scienceJournalAddingClaim);
                await _context.SaveChangesAsync();

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

            return(View(scienceJournalAddingClaim));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ScienceJournalAddingClaimId,ScienceJournalName,IsVak,IsZarubejn,ELibraryLink,CitationBasesList,RowStatusId")] ScienceJournalAddingClaim scienceJournalAddingClaim)
        {
            if (id != scienceJournalAddingClaim.ScienceJournalAddingClaimId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                if (scienceJournalAddingClaim.RowStatusId == null)
                {
                    scienceJournalAddingClaim.RowStatusId = (int?)RowStatusEnum.NotConfirmed;
                }

                try
                {
                    scienceJournalAddingClaim.AppUserId = _userProfileRepository.GetAppUser(User.Identity.Name).Id;
                    _context.Update(scienceJournalAddingClaim);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ScienceJournalAddingClaimExists(scienceJournalAddingClaim.ScienceJournalAddingClaimId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }

            return(View(scienceJournalAddingClaim));
        }
 /// <summary>
 /// Удаление заявки на добавление научного журнала в справочник
 /// </summary>
 /// <param name="claimEntry"></param>
 public void RemoveClaimAddScienceJournal(ScienceJournalAddingClaim claimEntry)
 {
     _context.ScienceJournalAddingClaims.Remove(claimEntry);
     _context.SaveChanges();
 }
 /// <summary>
 /// Добавление заявки на добавление научного журнала в справочник
 /// </summary>
 /// <param name="newClaim"></param>
 public void CreateClaimAddScienceJournal(ScienceJournalAddingClaim newClaim)
 {
     _context.ScienceJournalAddingClaims.Add(newClaim);
     _context.SaveChanges();
 }