public async Task <IActionResult> Edit(int id, [Bind("BankID,Name,Address")] Bank bank) { if (id != bank.BankID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bank); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BankExists(bank.BankID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bank)); }
public async Task <IActionResult> Edit(int id, [Bind("MoneyTransactionsId,UserId,AmountMoney,BalenceTipId,BalanceGrId,OpaoperationId,BalanceCont,TrDate")] MoneyTransactions moneyTransactions) { if (id != moneyTransactions.MoneyTransactionsId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(moneyTransactions); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MoneyTransactionsExists(moneyTransactions.MoneyTransactionsId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BalanceGrId"] = new SelectList(_context.ExchangeRate, "ExchangeRateId", "ExchangeRateId", moneyTransactions.BalanceGrId); ViewData["BalenceTipId"] = new SelectList(_context.ExchangeRate, "ExchangeRateId", "ExchangeRateId", moneyTransactions.BalenceTipId); ViewData["OpaoperationId"] = new SelectList(_context.Operation, "OperationId", "OperationName", moneyTransactions.OpaoperationId); ViewData["UserId"] = new SelectList(_context.User, "UserId", "UserLastname", moneyTransactions.UserId); return(View(moneyTransactions)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Balance")] 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))); } return(View(account)); }
public async Task <IActionResult> Edit(int id, [Bind("OfferID,BankID,ConditionID,OfferTypeID,Name,Percentage")] Offer offer) { if (id != offer.OfferID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(offer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OfferExists(offer.OfferID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BankID"] = new SelectList(_context.Banks, "BankID", "Address", offer.BankID); ViewData["ConditionID"] = new SelectList(_context.Conditions, "ConditionID", "Mark", offer.ConditionID); ViewData["OfferTypeID"] = new SelectList(_context.OfferTypes, "OfferTypeID", "Description", offer.OfferTypeID); return(View(offer)); }
public async Task <IActionResult> Edit(int id, [Bind("ClientID,Name,PhoneNumber,ClientType")] Client client) { if (id != client.ClientID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(client); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(client.ClientID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(client)); }
public async Task <IActionResult> Edit(int id, [Bind("OfferTypeID,Name,Description")] OfferType offerType) { if (id != offerType.OfferTypeID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(offerType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OfferTypeExists(offerType.OfferTypeID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(offerType)); }
public async Task <IActionResult> Edit(int id, [Bind("UserId,UserName,UserLastname,UserPpNo,UserPass")] User user) { if (id != user.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FromAccount,ToAccount,TransactionDate,TransactionAmount,FromBalance,ToBalance")] Transaction transaction) { if (id != transaction.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(transaction); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TransactionExists(transaction.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(transaction)); }
public async Task <IActionResult> Edit(int id, [Bind("ConditionID,Mark,MaxSum,MinSum,Special")] Condition condition) { if (id != condition.ConditionID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(condition); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConditionExists(condition.ConditionID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(condition)); }
public async Task <IActionResult> Edit(int id, [Bind("ContractID,OfferID,ClientID,SigningDate,FinishDate")] Contract contract, string sum) { if (id != contract.ContractID) { return(NotFound()); } var max = (from c in _context.Offers where (c.OfferID == contract.OfferID) select c.Condition.MaxSum).Max(); var min = (from c in _context.Offers where (c.OfferID == contract.OfferID) select c.Condition.MinSum).Min(); float sumf = float.Parse(sum, CultureInfo.InvariantCulture.NumberFormat); contract.Sum = sumf; if (ModelState.IsValid && contract.SigningDate < contract.FinishDate && max >= (int)contract.Sum && min <= (int)contract.Sum) { try { _context.Update(contract); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContractExists(contract.ContractID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ClientID"] = new SelectList(_context.Clients, "ClientID", "Name", contract.ClientID); ViewData["OfferID"] = new SelectList(_context.Offers, "OfferID", "Name", contract.OfferID); return(View(contract)); }