public ActionResult Edit( [Bind(Include = "Id,Bvn,Mobile,Email,AnnualTurnover,NumberOfEmployees,BankName,AccountNumber,ItemOfImport,BeneficiaryName,BeneficiaryBankName,BeneficiaryBankAdress,Iban,SwiftCode,Amount,AmountInWords,Purpose")] CbnFormQViewModel cbnFormQViewModel) { if (ModelState.IsValid) { db.Entry(cbnFormQViewModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(cbnFormQViewModel)); }
public ActionResult Create(CbnFormQViewModel cbnFormQViewModel, object request, string Bvn, string BankName, string TransactionRef) { if (ModelState.IsValid) { cbnFormQViewModel.Email = User.Identity.GetUserName(); cbnFormQViewModel.SubmissionDate = DateTime.Now.ToLongDateString(); _api = new PayStackApi("sk_test_760c409e1e8e60e037b6e6d7b68ab5f51d3c2f90"); var verifyResponse = _api.Transactions.Verify(TransactionRef); // auto or supplied when initializing; Debug.WriteLine(TransactionRef); db.CbnFormQViewModels.Add(cbnFormQViewModel); db.SaveChanges(); RedirectToAction("Dashboard", "Home"); } return(View(cbnFormQViewModel)); }