コード例 #1
0
        public ActionResult Create(ECustomers ecustomers)
        {
            if (ModelState.IsValid)
            {
                ecustomers.ID = Guid.NewGuid();
                db.Customers.Add(ecustomers);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(ecustomers);
        }
コード例 #2
0
 public ActionResult Edit(ECustomers ecustomers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ecustomers).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(ecustomers);
 }