// GET: AccountDetails/Edit/5
 public ActionResult Edit(int id)
 {
     using (AccountDetailsDbEntities accountDetailsDbEntities = new AccountDetailsDbEntities())
     {
         return(View(accountDetailsDbEntities.AccountDetailsTables.Where(x => x.accountNumber == id).FirstOrDefault()));
     }
 }
 // GET: AccountDetails
 public ActionResult Index()
 {
     using (AccountDetailsDbEntities accountdetails = new AccountDetailsDbEntities())
     {
         return(View());
     }
 }
 public ActionResult Create(AccountDetailsTable accountDetailsTable)
 {
     try
     {
         // TODO: Add insert logic here
         using (AccountDetailsDbEntities accountDetailsDbEntities = new AccountDetailsDbEntities())
         {
             accountDetailsDbEntities.AccountDetailsTables.Add(accountDetailsTable);
             accountDetailsDbEntities.SaveChanges();
         }
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult Edit(int id, AccountDetailsTable accountDetailsTable)
        {
            try
            {
                using (AccountDetailsDbEntities accountDetailsDbEntities = new AccountDetailsDbEntities())
                {
                    accountDetailsDbEntities.Entry(accountDetailsTable).State = EntityState.Modified;
                    accountDetailsDbEntities.SaveChanges();
                }
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }