コード例 #1
0
        public ActionResult Create(CmCompany cmcompany)
        {
            if (ModelState.IsValid)
            {
                context.CmCompanies.Add(cmcompany);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.PossibleclCategories = context.ClCategories;
            return View(cmcompany);
        }
コード例 #2
0
 public ActionResult Edit(CmCompany cmcompany)
 {
     if (ModelState.IsValid)
     {
         context.Entry(cmcompany).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.PossibleclCategories = context.ClCategories;
     return View(cmcompany);
 }