コード例 #1
0
        public ActionResult Create(ManufactorerTypeCreateEditViewModel vm)
        {
            if (ModelState.IsValid)
            {
                _uow.ManufactorerTypes.Add(vm.ManufactorerType);
                _uow.Commit();
                return RedirectToAction("Index");
            }

            return View(vm);
        }
コード例 #2
0
 // GET: ManufactorerTypes/Edit/5
 public ActionResult Edit(int? id)
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     ManufactorerType manufactorerType = _uow.ManufactorerTypes.GetById(id);
     if (manufactorerType == null)
     {
         return HttpNotFound();
     }
     var vm = new ManufactorerTypeCreateEditViewModel()
     {
         ManufactorerType = manufactorerType
     };
     return View(vm);
 }
コード例 #3
0
 // GET: ManufactorerTypes/Create
 public ActionResult Create()
 {
     var vm = new ManufactorerTypeCreateEditViewModel();
     return View(vm);
 }