示例#1
0
        public async Task <IActionResult> PutIdentityTypes(int id, IdentityTypes identityTypes)
        {
            if (id != identityTypes.IdentityTypesId)
            {
                return(BadRequest());
            }

            _context.Entry(identityTypes).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!IdentityTypesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutPaymentDetails(int id, PaymentDetails paymentDetails)
        {
            if (id != paymentDetails.PaymentDetailsId)
            {
                return(BadRequest());
            }

            _context.Entry(paymentDetails).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PaymentDetailsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#3
0
        public async Task <IActionResult> PutStateLocalGovernment(short id, StateLocalGovernment stateLocalGovernment)
        {
            if (id != stateLocalGovernment.StateLocalGovernmentId)
            {
                return(BadRequest());
            }

            _context.Entry(stateLocalGovernment).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!StateLocalGovernmentExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <IActionResult> PutTitle(int id, Title title)
        {
            if (id != title.TitleId)
            {
                return(BadRequest());
            }

            _context.Entry(title).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TitleExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#5
0
        public async Task <IActionResult> PutBanks(byte id, Banks banks)
        {
            if (id != banks.BankId)
            {
                return(BadRequest());
            }

            _context.Entry(banks).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BanksExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public ActionResult VerifyOTP(string email, string code)
        {
            var otp = _context.OtpTable.Where(x => x.UserEmail.Equals(email) && x.Code.Equals(code) && x.IsActive.Equals(true)).FirstOrDefault();

            if (otp != null)
            {
                otp.IsActive              = false;
                otp.DateOtpverified       = DateTime.Now;
                _context.Entry(otp).State = EntityState.Modified;
                _context.SaveChanges();
                return(Ok(true));
            }
            else
            {
                return(BadRequest(false));
            }
        }