public ActionResult Create(PackageModel model) { try { if (ModelState.IsValid) { var package = Mapper.Map<Package>(model); var result = PackageService.AddPackage(package); if (result.Succes) return RedirectToAction("List"); } } catch { return View(model); } return View(model); }
// GET: Package/Edit/5 public ActionResult Edit(int id) { var model = new PackageModel(); return View(model); }
// GET: Package/Create public ActionResult Create() { var model = new PackageModel(); return View(model); }