Ejemplo n.º 1
0
        private bool ShowProgressiveField(Control control1)
        {
            IProgressiveFormControl pfc = control1 as IProgressiveFormControl;

            if (pfc != null)
            {
                string fieldName = Helpers.GetFieldName((FieldControl)pfc);

                if (fieldName == _progressiveKeyFieldName)
                {
                    return(true);
                }

                if (!pfc.UsesProgressiveLogic & _priorFormEntry == null)
                {
                    return(true);
                }

                if (pfc.UsesProgressiveLogic & _priorFormEntry == null)
                {
                    return(false);
                }

                if (_priorFormEntry.DoesFieldExist(fieldName) && _priorFormEntry.GetValue(fieldName) != null)
                {
                    return(false);
                }

                if (!pfc.UsesProgressiveLogic & (_priorFormEntry.DoesFieldExist(fieldName) && _priorFormEntry.GetValue(fieldName) == null))
                {
                    return(true);
                }

                if (pfc.UsesProgressiveLogic)
                {
                    List <CriteriaItem> checks = Helpers.DeserializeJSON <List <CriteriaItem> >(pfc.ProgressiveCriteriaSet);

                    foreach (CriteriaItem c in checks)
                    {
                        var checkField = this.FieldControls.Where(fc => ((SimpleScriptView)fc).ID == c.FieldId).SingleOrDefault();

                        if (checkField != null && _priorFormEntry.DoesFieldExist(checkField.MetaField.FieldName) && _priorFormEntry.GetValue(checkField.MetaField.FieldName) == null)
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }
Ejemplo n.º 2
0
        private bool ShowProgressiveField(Control control1)
        {
            IProgressiveFormControl pfc = control1 as IProgressiveFormControl;

            if (pfc != null)
            {
                string fieldName = Helpers.GetFieldName((FieldControl)pfc);

                if (fieldName == _progressiveKeyFieldName)
                {
                    return(true);
                }

                if (!pfc.UsesProgressiveLogic & _priorFormEntry == null)
                {
                    return(true);
                }

                if (pfc.UsesProgressiveLogic & _priorFormEntry == null)
                {
                    return(false);
                }

                if (_priorFormEntry.DoesFieldExist(fieldName) && _priorFormEntry.GetValue(fieldName) != null)
                {
                    return(false);
                }

                if (!pfc.UsesProgressiveLogic & (_priorFormEntry.DoesFieldExist(fieldName) && _priorFormEntry.GetValue(fieldName) == null))
                {
                    return(true);
                }

                if (pfc.UsesProgressiveLogic)
                {
                    List <CriteriaItem> checks = Helpers.DeserializeJSON <List <CriteriaItem> >(pfc.ProgressiveCriteriaSet);

                    foreach (CriteriaItem c in checks)
                    {
                        if (_priorFormEntry.DoesFieldExist(c.FieldName) && _priorFormEntry.GetValue(c.FieldName) == null)
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }