Example #1
0
        public ActionResult Create(CreateEditViewModel model)
        {
            var role = new Role();

            Mapper.DynamicMap(model, role);
            securityProvider.AddRole(role);

            var jsonViewModel = new AjaxViewModel(true, role, null);

            return(Json(jsonViewModel));
        }
Example #2
0
        public ActionResult Create(CreateEditViewModel model)
        {
            var role = new DataAccess.Role();

            mapper.Map(model, role);
            try
            {
                securityProvider.AddRole(role);
            }
            catch (Exception ex)
            {
                return(HandleException(ex));
            }
            var jsonViewModel = new AjaxViewModel(true, model, null);

            return(Json(jsonViewModel));
        }