public ActionResult DeleteConfirmed(int id)
        {
            CustomerAccountApplication customerAccountApplication = db.Customers.Find(id);

            db.Customers.Remove(customerAccountApplication);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "id,customerName,phoneNumber,address,email,accountType,applicationStatus,password,confirmPassword")] CustomerAccountApplication customerAccountApplication)
 {
     if (ModelState.IsValid)
     {
         db.Entry(customerAccountApplication).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(customerAccountApplication));
 }
Example #3
0
        public ActionResult OpenNewBankAccount()
        {
            var userEmail = User.Identity.Name;
            var customer  = new CustomerAccountApplication();

            ViewBag.accountType = new List <string> {
                "current", "savings"
            };
            if (customerImplementation.AccountExist(userEmail))
            {
                return(RedirectToAction("Index", "Home", new { applicationMessage = " you cannot have more than 1 account" }));
            }
            return(View(customer));
        }
        // GET: Admin/Dashboard/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CustomerAccountApplication customerAccountApplication = db.Customers.Find(id);

            if (customerAccountApplication == null)
            {
                return(HttpNotFound());
            }
            return(View(customerAccountApplication));
        }
 public bool OpenNewBankAccount(string userEmail, CustomerAccountApplication customer)
 {
     //ApplicationUser appUser = new ApplicationUser();
     if (customer != null)
     {
         customer.applicationStatus = "pending";
         customer.email             = userEmail;
         customer.accountNumber     = adminImplementation.GenerateAccountNumber();
         db.Customers.Add(customer);
         db.SaveChanges();
         return(true);
     }
     return(false);
     // throw new NotImplementedException();
 }
Example #6
0
        public ActionResult OpenNewBankAccount(CustomerAccountApplication customer)
        {
            var userEmail = User.Identity.Name;

            if (ModelState.IsValid)
            {
                var isSubmitted = customerImplementation.OpenNewBankAccount(userEmail, customer);
                if (isSubmitted)
                {
                    return(RedirectToAction("index", "Home", new { applicationMessage = "dear " + customer.customerName + " your application will be reviewed shortly" }));
                }
            }

            return(View(customer));
        }