コード例 #1
0
        public ActionResult Delete(int id, AccountDetailsTable accountDetailsTable)
        {
            try
            {
                // TODO: Add delete logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
コード例 #2
0
 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());
     }
 }
コード例 #3
0
        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());
            }
        }