private void SetParams(List <sysBpmsStep> listStep, sysBpmsStep currentStep) { this.HasSubmitButton = this.ContentHtml.Rows.Any(r => (r is RowHtml ? ((RowHtml)r).Columns : ((AccordionHtml)r).GetListColumn()).Any(d => d.children.Any(f => f is ButtonHtml && ((ButtonHtml)f).subtype == ButtonHtml.e_subtype.submit))); //if this is call from pop up form which does not have stepID. if (listStep != null && currentStep != null) { listStep = listStep.OrderBy(c => c.Position).ToList(); this.StepID = currentStep.ID; this.StepName = currentStep.Name; this.IsMultiStep = listStep.Count > 1; this.IsLasStep = listStep.LastOrDefault().ID == currentStep.ID; this.IsFirstStep = listStep.FirstOrDefault().ID == currentStep.ID; if (this.IsMultiStep && this.HasSubmitButton) { //set IsMultiStep and IsLastStep into all submit buttons. foreach (ButtonHtml item in this.ContentHtml.FindControlByType <ButtonHtml>().Where(c => c.subtype == ButtonHtml.e_subtype.submit)) { item.IsMultiStep = true; item.IsLastStep = this.IsLasStep; } } if (this.IsMultiStep && !this.IsLasStep) { this.NextStepID = listStep.FirstOrDefault(c => c.Position > currentStep.Position).ID; } if (this.IsMultiStep && !this.IsFirstStep) { this.PreviousStepID = listStep.LastOrDefault(c => c.Position < currentStep.Position).ID; } } }
public FormModel(JObject obj, HtmlElementHelperModel helper, List <sysBpmsStep> listStep, sysBpmsStep currentStep, sysBpmsDynamicForm dynamicForm, bool isFormReadOnly) { helper?.AddScript(dynamicForm?.ConfigXmlModel.OnLoadFunctionBody); helper?.AddStyleSheet(dynamicForm?.ConfigXmlModel.StyleSheetCode); this.ContentHtml = new ContentHtml(obj, helper, dynamicForm.ID, isFormReadOnly); if (helper?.FormAction == HtmlElementHelperModel.e_FormAction.Onload || helper?.FormAction == HtmlElementHelperModel.e_FormAction.Preview) { this.FillDependentControls(); } this.SetParams(listStep, currentStep); this.FormName = dynamicForm?.Name ?? string.Empty; this.IsFormReadOnly = isFormReadOnly; this.IsEncrypted = helper.IsEncrypted; this.DynamicFormID = dynamicForm?.ID ?? Guid.Empty; this.ResultOperation = helper?.ResultOperation ?? new ResultOperation(); this.ContentHtml.CheckAllVisibility(this); }