Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,BankNoteAccountLutState,BankNoteID,AccountID")] VoucherAccountLut voucherAccountLut)
        {
            if (id != voucherAccountLut.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(voucherAccountLut);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VoucherAccountLutExists(voucherAccountLut.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccountID"]  = new SelectList(_context.Account, "ID", "ID", voucherAccountLut.AccountID);
            ViewData["BankNoteID"] = new SelectList(_context.Voucher, "ID", "ID", voucherAccountLut.BankNoteID);
            return(View(voucherAccountLut));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,AccountState,MemberID,CurrencyID,WhenCreated")] Account account)
        {
            if (id != account.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(account);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AccountExists(account.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CurrencyID"] = new SelectList(_context.Currency, "ID", "ID", account.CurrencyID);
            return(View(account));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,MemberDetailsState,FirstName,LastName,Address1,Address2,City,State,CountryCode,ZipCode,WhenCreated,MemberID")] MemberDetail memberDetails)
        {
            if (id != memberDetails.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(memberDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MemberDetailsExists(memberDetails.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["MemberID"] = new SelectList(_context.Member, "ID", "ID", memberDetails.MemberID);
            return(View(memberDetails));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,MemberState,WhenCreated")] Member member)
        {
            if (id != member.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(member);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MemberExists(member.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(member));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID")] ExchangeRate exchangeRate)
        {
            if (id != exchangeRate.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(exchangeRate);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExchangeRateExists(exchangeRate.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(exchangeRate));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,PaymentState,FromAccountID,ToAccountID,WhenProposed,WhenAccepted,WhenDeclined,RefundPaymentID")] Payment payment)
        {
            if (id != payment.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(payment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PaymentExists(payment.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(payment));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,BankNoteState,Printed")] Voucher voucher)
        {
            if (id != voucher.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(voucher);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VoucherExists(voucher.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(voucher));
        }