Beispiel #1
0
        public ActionResult Edit(CustomerLevelModel model, bool continueEditing)
        {
            if (ModelState.IsValid)
            {
                var entity = _levelService.GetCustomerLevelById(model.Id);
                entity = model.MapTo <CustomerLevelModel, CustomerLevel>(entity);
                _levelService.UpdateLevel(entity);

                if (continueEditing)
                {
                    return(RedirectToAction("Edit", new { id = model.Id }));
                }
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }
Beispiel #2
0
        public ActionResult Create(CustomerLevelModel model, bool continueEditing)
        {
            if (ModelState.IsValid)
            {
                var entity = model.MapTo <CustomerLevel>();

                var levelId = _levelService.InsertLevel(entity);

                if (continueEditing)
                {
                    return(RedirectToAction("Edit", new { id = levelId }));
                }
                return(RedirectToAction("Index"));
            }

            return(View(model));
        }