Exemplo n.º 1
0
 public IActionResult EditDados(MappingLgpdtoken mappingLgpdtoken)
 {
     if (ModelState.IsValid)
     {
         try
         {
             //_repository.UpdatePersistence(mappingLgpdtoken);
             _repository.Update(mappingLgpdtoken);
             _unitOfWork.Commit();
         }
         catch (DbUpdateConcurrencyException)
         {
             if (!MappingLgpdtokenExists(mappingLgpdtoken.TokenReferenceId, mappingLgpdtoken.TokenRequestorId))
             {
                 return(NotFound());
             }
             else
             {
                 throw;
             }
         }
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["TokenRequestorId"] = new SelectList(_repository.FindAll(), "TokenRequestorId", "TokenRequestorId", mappingLgpdtoken.TokenRequestorId);
     return(View(mappingLgpdtoken));
 }
        public void UpdatePersistence(IPersistenceBase entidade)
        {
            MappingLgpdtoken en = (MappingLgpdtoken)entidade;

            _context.Attach(en);
            _context.Entry(en).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            _context.SaveChanges();
        }
Exemplo n.º 3
0
 public IActionResult Create([Bind("TokenRequestorId,TokenReferenceId,Bin,Cpflength,Cpfciphered,LgpdtokenLength,Lgpdtoken,RangeCounter,TokenReferenceIdlength,TokenExpirationDate,EventCounter,TimerEventExpiration,Last4DigitsPan,CodeValidation,TokenLocation,PcikeyIndex,CardHolderDataCiphered")] MappingLgpdtoken mappingLgpdtoken)
 {
     if (ModelState.IsValid)
     {
         //_repository.InsertPersistence(mappingLgpdtoken);
         _repository.Add(mappingLgpdtoken);
         _unitOfWork.Commit();
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["TokenRequestorId"] = new SelectList(_repository.FindAll(), "TokenRequestorId", "TokenRequestorId", mappingLgpdtoken.TokenRequestorId);
     return(View(mappingLgpdtoken));
 }
 public void Update(MappingLgpdtoken mapping)
 {
     _unitOfWork.RegistraUpdate(mapping, this);
 }
 public void Remove(MappingLgpdtoken mapping)
 {
     _unitOfWork.RegistraRemove(mapping, this);
 }
 public void Add(MappingLgpdtoken mapping)
 {
     _unitOfWork.RegistraAdd(mapping, this);
 }