public async Task <IActionResult> Edit(string id, [Bind("OtpadmId,PasswordAdm,Status,TryPinCounter,LastDateLogin,LastDateBlocked,LastDateChangePin")] Otpadministration otpadministration)
        {
            if (id != otpadministration.OtpadmId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _repository.Update(otpadministration);
                    _unitOfWork.Commit();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OtpadministrationExists(otpadministration.OtpadmId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(otpadministration));
        }
        public void UpdatePersistence(IPersistenceBase entidade)
        {
            Otpadministration otp = (Otpadministration)entidade;

            _context.Attach(otp);
            _context.Entry(otp).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            _context.SaveChanges();
        }
 public async Task <IActionResult> Create([Bind("OtpadmId,PasswordAdm,Status,TryPinCounter,LastDateLogin,LastDateBlocked,LastDateChangePin")] Otpadministration otpadministration)
 {
     if (ModelState.IsValid)
     {
         _repository.Add(otpadministration);
         _unitOfWork.Commit();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(otpadministration));
 }
 public void Update(Otpadministration otpadmin)
 {
     _unitOfWork.RegistraUpdate(otpadmin, this);
 }
 public void Remove(Otpadministration otpadmin)
 {
     _unitOfWork.RegistraRemove(otpadmin, this);
 }
 public void Add(Otpadministration otpadmin)
 {
     _unitOfWork.RegistraAdd(otpadmin, this);
 }