public virtual ActionResult UpdateWidget(LoginWidgetEditModel model)
        {
            if (ModelState.IsValid)
            {
                var widget = new FormLoginWidget();
                if (model.Id > 0)
                {
                    widget = formLoginWidgetService.Find(model.Id);
                }
                widget = model.MapTo(widget);
                formLoginWidgetService.Save(widget);
                model.MapFrom(widget);
                Success(HttpContext.Translate("Messages.Success",
                                                                ResourceHelper.GetControllerScope(this)));
            }

            return PartialView("EditWidget", model);
        }
 public LoginHolderWidget()
 {
     FormLoginWidget = new FormLoginWidget();
     OpenIdLoginWidget = new OpenIDLoginWidget();
 }
        public virtual ActionResult EditWidget(ICoreWidgetInstance instance)
        {
            var widgetModel = new LoginWidgetEditModel();
            if (instance != null)
            {
                FormLoginWidget widget = null;
                if (instance.InstanceId != null)
                {
                    var existingWidget = formLoginWidgetService.Find((long)instance.InstanceId);

                    if (existingWidget != null)
                        widget = existingWidget;
                }
                if(widget == null)
                {
                    widget = new FormLoginWidget();
                }

                widgetModel = widgetModel.MapFrom(widget);
            }

            return PartialView(widgetModel);
        }