public async Task <IActionResult> Edit(int id, [Bind("Id,Name,RegistereddDate")] PrepaidCustomer prepaidCustomer) { if (id != prepaidCustomer.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(prepaidCustomer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrepaidCustomerExists(prepaidCustomer.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(prepaidCustomer)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Number,Balance,PrepaidCustomerId")] MobileAccount mobileAccount) { if (id != mobileAccount.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mobileAccount); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MobileAccountExists(mobileAccount.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["PrepaidCustomerId"] = new SelectList(_context.Set <PrepaidCustomer>(), "Id", "Id", mobileAccount.PrepaidCustomerId); return(View(mobileAccount)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Description")] TopUpChannel topUpChannel) { if (id != topUpChannel.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(topUpChannel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TopUpChannelExists(topUpChannel.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(topUpChannel)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,MobileAccountId,TopUpChannelId,TopUpAmount")] TopUp topUp) { if (id != topUp.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(topUp); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TopUpExists(topUp.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MobileAccountId"] = new SelectList(_context.MobileAccount, "Id", "Id", topUp.MobileAccountId); ViewData["TopUpChannelId"] = new SelectList(_context.Set <TopUpChannel>(), "Id", "Id", topUp.TopUpChannelId); return(View(topUp)); }