public ActionResult Edit([Bind(Include = "Id,SmallestAmount,LargestAmount,Fee")] MaintainanceFee maintainanceFee) { if (ModelState.IsValid) { db.Entry(maintainanceFee).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(maintainanceFee)); }
public ActionResult Edit([Bind(Include = "Id,Name,Title,Description,Value")] CR_AccountType cR_AccountType) { if (ModelState.IsValid) { db.Entry(cR_AccountType).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cR_AccountType)); }
public ActionResult Edit([Bind(Include = "Id,Name,ShortCode,CurrentValueToDollar")] CR_Currency cR_Currency) { if (ModelState.IsValid) { db.Entry(cR_Currency).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cR_Currency)); }
public bool Credit(int accountId, double amount) { try { var find = context.CR_Account.Find(accountId); if (find != null) { find.CurrentCryptoBalance += Convert.ToDecimal(amount); context.Entry(find).State = EntityState.Modified; context.SaveChanges(); return(true); } return(false); } catch (Exception e) { Console.WriteLine(e); return(false); } }
public bool SetWithDrawStatus(int id, WithDrawRequestStatus status) { try { var find = context.WithdrawRequests.Find(id); if (find != null) { find.Status = status.ToString(); context.Entry(find).State = EntityState.Modified; context.SaveChanges(); return(true); } return(false); } catch (Exception e) { Console.WriteLine(e); return(false); } }
public ActionResult ApproveTransaction(int id) { inject(); var check = _context.ForwardTransfers.Find(id); if (check == null) { return(RedirectToAction("Transactions")); } var accountService = new Services.Account(); var balance = Convert.ToDecimal(accountService.GetBalance(check.AccountID)); var newBalance = Convert.ToDecimal(balance - check.Amount); accountService.UpdateAccountBalance(check.AccountID, newBalance); check.Status = Services.TransactionStatus.SUCCESSFUL.ToString(); _context.Entry(check); _context.SaveChanges(); return(RedirectToAction("Transactions")); }
public bool UpdateStatus(int verificationId, VerificationStatus status) { try { var find = context.CR_Verification.Find(verificationId); if (find != null) { find.Status = status.ToString(); context.Entry(find).State = EntityState.Modified; context.SaveChanges(); return(true); } return(false); } catch (Exception ex) { return(false); } }
public bool SetStatus(int transactionId, TransactionStatus status) { try { var find = context.CR_Transactions.Find(transactionId); if (find != null) { find.Status = status.ToString(); context.Entry(find).State = EntityState.Modified; context.SaveChanges(); } return(true); } catch (Exception e) { Console.WriteLine(e); return(false); } }