public virtual ActionResult EditWidget(ICoreWidgetInstance instance)
        {
            var widgetModel = new OpenIDLoginWidgetEditModel();

            if (instance != null)
            {
                NHibernate.Models.OpenIDLoginWidget widget = null;
                if (instance.InstanceId != null)
                {
                    var existingWidget = openIdLoginWidgetService.Find((long)instance.InstanceId);

                    if (existingWidget != null)
                    {
                        widget = existingWidget;
                    }
                }
                if (widget == null)
                {
                    widget = new NHibernate.Models.OpenIDLoginWidget();
                }

                widgetModel = widgetModel.MapFrom(widget);
            }

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

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

            return PartialView("EditWidget", model);
        }
        public virtual ActionResult EditWidget(ICoreWidgetInstance instance)
        {
            var widgetModel = new OpenIDLoginWidgetEditModel();
            if (instance != null)
            {
                NHibernate.Models.OpenIDLoginWidget widget = null;
                if (instance.InstanceId != null)
                {
                    var existingWidget = openIdLoginWidgetService.Find((long)instance.InstanceId);

                    if (existingWidget != null)
                        widget = existingWidget;
                }
                if (widget == null)
                {
                    widget = new NHibernate.Models.OpenIDLoginWidget();
                }

                widgetModel = widgetModel.MapFrom(widget);
            }

            return PartialView(widgetModel);
        }