Esempio n. 1
0
        // 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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }