示例#1
0
        public ActionResult Create(EmailType emailtype)
        {
            if (ModelState.IsValid)
            {
                db.EmailTypes.Add(emailtype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(emailtype);
        }
示例#2
0
 public ActionResult Edit(EmailType emailtype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(emailtype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(emailtype);
 }