public ActionResult Create(int customerId) { var customer = customerService.GetById(customerId); var vm = new LicenseViewModel { CustomerId = customerId, CustomerName = customer.Name }; return View(vm); }
public ActionResult Create(LicenseViewModel vm) { if (ModelState.IsValid) { var license = new License(); converter.ViewmodelToEntity(vm, ref license); service.Add(license); return RedirectToAction("Edit", "Customer", new { id = vm.CustomerId }); } else { return View(vm); } }
public ActionResult Edit(LicenseViewModel vm) { throw new NotImplementedException(); }