// GET: Admin/ParameterGroups/Edit/5 public ActionResult Edit(int id) { var group = _unitOfWork.ParameterGroups.Get(id); var model = new ParameterGroupViewModel() { Name = group.Name }; return(View(model)); }
public ActionResult Edit(ParameterGroupViewModel model, int id) { if (ModelState.IsValid) { var group = _unitOfWork.ParameterGroups.Get(id); group.Name = model.Name; _unitOfWork.Complete(); return(RedirectToAction("Index")); } return(View(model)); }
public ActionResult Create(ParameterGroupViewModel model) { if (ModelState.IsValid) { var group = new ParameterGroup() { Name = model.Name }; _unitOfWork.ParameterGroups.Add(group); _unitOfWork.Complete(); return(RedirectToAction("Index")); } return(View(model)); }