コード例 #1
0
 public ActionResult Create(SupplierModel model)
 {
     if (ModelState.IsValid)
     {
         this.supplierService.Create(model.CreatesupplierFromModel());
         return RedirectToAction("Index");
     }
     return View();
 }
コード例 #2
0
 public ActionResult Edit(SupplierModel model)
 {
     if (ModelState.IsValid)
     {
         var supplier = this.supplierService.GetByID(model.ID);
         supplier.Name = model.Name;
         this.supplierService.Save();
         return RedirectToAction("Index");
     }
     return View();
 }