/// <summary> /// Retrieves a display name of the specified CMS user field, and returns it. /// </summary> /// <param name="fieldName">The CMS user field name.</param> /// <returns>A display name of the specified CMS user field, if found; otherwise, an empty string.</returns> protected string GetUserFieldDisplayName(string fieldName) { FormFieldInfo field = UserFormInfo.GetFormField(fieldName); if (field == null) { return(String.Empty); } return(ResHelper.LocalizeString(field.GetPropertyValue(FormFieldPropertyEnum.FieldCaption, MacroContext.CurrentResolver))); }
public void Save(UserFormInfo model) { var entity = DB.UserFormInfos.FirstOrDefault(e => e.InfoId == model.InfoId && e.UserId == model.UserId); if (entity != null) { entity.FlowStatus = model.FlowStatus; } else { DB.UserFormInfos.Add(model); } DB.SaveChanges(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); ScriptHelper.RegisterWOpenerScript(Page); ScriptHelper.RegisterJQuery(Page); PageTitle.TitleText = GetString("fb.mapping.editor.title"); ShowWarning(GetString("fb.mapping.editor.introduction")); ShowInformation(GetString("fb.mapping.editor.instruction")); UserMappingItemRepeater.ItemDataBound += UserMappingItemRepeater_ItemDataBound; UserSettingsMappingItemRepeater.ItemDataBound += UserSettingsMappingItemRepeater_ItemDataBound; Save += (s, ea) => Confirm(); try { RestoreParameters(); UserMappingItemRepeater.DataSource = UserFormInfo.GetFields(true, true); UserMappingItemRepeater.DataBind(); UserSettingsMappingItemRepeater.DataSource = UserSettingsFormInfo.GetFields(true, true); UserSettingsMappingItemRepeater.DataBind(); } catch (Exception exception) { HandleError(exception); } }