Пример #1
0
        public virtual ActionResult UpdateWidget(LoginHolderWidgetEditModel model)
        {
            if (ModelState.IsValid)
            {
                var widget = new NHibernate.Models.LoginHolderWidget();
                if (model.Id > 0)
                {
                    widget = loginHolderWidgetService.Find(model.Id);
                }
                widget = model.MapTo(widget);
                loginHolderWidgetService.Save(widget);
                model.MapFrom(widget);
                Success(HttpContext.Translate("Messages.Success",
                                              ResourceHelper.GetControllerScope(this)));
            }

            return(PartialView("EditWidget", model));
        }
        public virtual ActionResult UpdateWidget(LoginHolderWidgetEditModel model)
        {
            if (ModelState.IsValid)
            {
                var widget = new NHibernate.Models.LoginHolderWidget();
                if (model.Id > 0)
                {
                    widget = loginHolderWidgetService.Find(model.Id);
                }
                widget = model.MapTo(widget);
                loginHolderWidgetService.Save(widget);
                model.MapFrom(widget);
                Success(HttpContext.Translate("Messages.Success",
                                              ResourceHelper.GetControllerScope(this)));
            }

            return PartialView("EditWidget", model);
        }