コード例 #1
0
        public ActionResult Create(CreateEditViewModel model)
        {
            var region = new Region();

            Mapper.DynamicMap(model, region);
            regionProvider.AddRegion(region);

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

            return(Json(jsonViewModel));
        }
コード例 #2
0
        public ActionResult Create(CreateEditViewModel model)
        {
            var Region = new DataAccess.Region();

            mapper.Map(model, Region);
            try
            {
                regionProvider.AddRegion(Region);
            }
            catch (Exception ex)
            {
                return(HandleException(ex));
            }
            var jsonViewModel = new AjaxViewModel(true, model, null);

            return(Json(jsonViewModel));
        }