protected internal virtual string RenderFormData(IFormData formData) { if ((formData == null) || (((formData.FormFields == null) || (formData.FormFields.Count == 0)) && ((formData.FormProperties == null) || (formData.FormProperties.Count == 0)))) { return(null); } var formElement = new HtmlElementWriter(FormElement).Attribute(NameAttribute, GeneratedFormName) .Attribute(RoleAttribute, FormRole); var documentBuilder = new HtmlDocumentBuilder(formElement); // render fields foreach (var formField in formData.FormFields) { RenderFormField(formField, documentBuilder); } // render deprecated form properties foreach (var formProperty in formData.FormProperties) { RenderFormField(new FormPropertyAdapter(formProperty), documentBuilder); } // end document element documentBuilder.EndElement(); return(documentBuilder.HtmlString); }
/// <summary> /// Constructor for form /// Not the cleanest MVVM pattern, but for the sake of time, this works /// </summary> /// <param name="AssemblyData">Object containing data to populate controls</param> public MainWindow(IFormData AssemblyData) { //setup bindings and ipmort any data from interface assemblyData = AssemblyData; assemblyData.Cancelled = true; //forces cancel unless user hits okay. availFields = new ObservableCollection <string>(); foreach (var item in assemblyData.AvailableBomFields) { availFields.Add(item.parameterName); } InitializeComponent(); this.Title = "Assembly Manager: " + assemblyData.AssemblyName; TitleBlockListBox.ItemsSource = assemblyData.TitleBlocks; bomDataGrid.ItemsSource = assemblyData.BomFields; Available.ItemsSource = availFields; //initialize values - ToDo: use bindings instead Ortho.IsChecked = assemblyData.Ortho; Top.IsChecked = assemblyData.TopView; Front.IsChecked = assemblyData.FrontView; TagLeders.IsChecked = assemblyData.TagLeaders; }
public void InsertForm(IFormData form) { ISettings settings = new SettingsWrapper(); var autoStoreValues = settings.GetSetting(_providerSettingsPrefix + "AutoStoreValues"); var autoStoreDisabledReplacementValue = settings.GetSetting(_providerSettingsPrefix + "AutoStoreDisabledReplacementValue"); bool storeValuesInSitecore = false; if (bool.TryParse(autoStoreValues, out storeValuesInSitecore) && !storeValuesInSitecore) { if (form != null && form.Fields != null && form.Fields.Any()) { form.Fields.ToList().ForEach(field => { if (!string.IsNullOrEmpty(field.Data)) { field.Data = autoStoreDisabledReplacementValue; } field.Value = autoStoreDisabledReplacementValue; }); } } _defaultAnalyticsDataProvider.InsertForm(form); }
public SearchDialogBox(IFormData f) { InitializeComponent(); button1.Enabled = false; _searcher = new Searcher(); _parentForm = f; }
public void InsertForm(IFormData form) { ISettings settings = new SettingsWrapper(); var autoStoreValues = settings.GetSetting(_providerSettingsPrefix + "AutoStoreValues"); var autoStoreDisabledReplacementValue = settings.GetSetting(_providerSettingsPrefix + "AutoStoreDisabledReplacementValue"); bool storeValuesInSitecore = false; if (bool.TryParse(autoStoreValues, out storeValuesInSitecore) && !storeValuesInSitecore) { if (form != null && form.Fields != null && form.Fields.Any()) { form.Fields.ToList().ForEach(field => { if (!string.IsNullOrEmpty(field.Data)) { field.Data = autoStoreDisabledReplacementValue; } field.Value = autoStoreDisabledReplacementValue; }); } } _defaultAnalyticsDataProvider.InsertForm(form); }
public ServiceRequestCommand(Guid clientId, Guid serviceId, DateTime requestedOn, IFormData data) : base(Guid.NewGuid()) { ClientId = clientId; ServiceId = serviceId; RequestedOn = requestedOn; FormData = data; }
/// <summary> /// Copies the data from one IFormData object to another. Note: this method only copies common draft and non-draft /// data. /// </summary> /// <param name="formFrom">The source object.</param> /// <param name="formTo">The target object.</param> private void CopyFormCommonData <TControlA, TControlB>(IFormData <TControlA> formFrom, IFormData <TControlB> formTo, FormsManager manager) where TControlA : ControlData where TControlB : ControlData { formTo.LastControlId = formFrom.LastControlId; formTo.CssClass = formFrom.CssClass; formTo.FormLabelPlacement = formFrom.FormLabelPlacement; formTo.RedirectPageUrl = formFrom.RedirectPageUrl; formTo.SubmitAction = formFrom.SubmitAction; formTo.SubmitRestriction = formFrom.SubmitRestriction; formTo.SubmitActionAfterUpdate = formFrom.SubmitActionAfterUpdate; formTo.RedirectPageUrlAfterUpdate = formFrom.RedirectPageUrlAfterUpdate; LocalizationHelper.CopyLstring(formFrom.SuccessMessage, formTo.SuccessMessage); LocalizationHelper.CopyLstring(formFrom.SuccessMessageAfterFormUpdate, formTo.SuccessMessageAfterFormUpdate); this.CopyControls(formFrom.Controls, formTo.Controls, manager); manager.CopyPresentation(formFrom.Presentation, formTo.Presentation); }
public FormStoreTests() { var storePropertyChanges = new List <string>(); _storePropertyChanges = storePropertyChanges; _formStore = new FormStore(); _formStore.PropertyChanged += (sender, e) => storePropertyChanges.Add(e.PropertyName); var formPropertyChanges = new List <string>(); _formPropertyChanges = formPropertyChanges; _form = _formStore["test-form"]; _form.PropertyChanged += (sender, e) => formPropertyChanges.Add(e.PropertyName); var fieldPropertyChanges = new List <string>(); _fieldPropertyChanges = fieldPropertyChanges; _field = _form["test-field"]; _field.PropertyChanged += (sender, e) => fieldPropertyChanges.Add(e.PropertyName); }
protected internal virtual string GetFormTemplateString(IFormData formInstance, string formKey) { var deploymentId = formInstance.DeploymentId; //ResourceEntity resourceStream = // Context.CommandContext.ResourceManager.findResourceByDeploymentIdAndResourceName(deploymentId, formKey); //EnsureUtil.EnsureNotNull("Form with formKey '" + formKey + "' does not exist", "resourceStream", // resourceStream); //byte[] resourceBytes = resourceStream.Bytes; var encoding = "UTF-8"; var formTemplateString = ""; try { //formTemplateString = StringHelperClass.NewString(resourceBytes, encoding); } catch (System.Exception e) { throw new ProcessEngineException("Unsupported encoding of :" + encoding, e); } return(formTemplateString); }
public CreateModel(IFormData formData) { this.formData = formData; this.dateTime = DateTime.Today; }
public ListModel(IFormData formData) { this.formData = formData; }
public DetailModel(IFormData formData) { this.formData = formData; }
public Form2(IFormData f) { InitializeComponent(); parentForm = f; }