/// <summary> /// 判断该线条是否通过 /// </summary> /// <param name="formData"></param> /// <param name="conditionJson"></param> /// <returns></returns> private bool IsLineOK(string formData, List <WFLineConditionModel> conditionJson) { bool res = false; //dynamic formDataJson = formData.ToJObject();//获取数据内容 FormOperation formOperation = new FormOperation(); foreach (var item in conditionJson)//轮询该线条上的所有条件 { string fieldId = item.FieldId.Split('|')[1]; string formvalue = formOperation.GetValue(formData, fieldId); // formDataJson[fieldId].ToString(); if (!string.IsNullOrEmpty(formvalue)) { bool compareValue = LineCompared(formvalue, item.FilterId, item.FilterValue); if (item.Logic == "AND") { res = compareValue; if (!compareValue) { break; } } else { if (compareValue) { res = compareValue; } } } } return(res); }
/// <summary> /// 判断该线条是否通过 /// </summary> /// <param name="formDataList"></param> /// <param name="conditionJson"></param> /// <returns></returns> private bool IsLineOK(List <WFVerificationFormModel> formDataList, List <WFLineConditionModel> conditionJson) { bool res = false; string formId = "", formData = "[]"; FormOperation formOperation = new FormOperation(); foreach (var item in conditionJson)//轮询该线条上的所有条件 { string fieldId = item.FieldId.Split('|')[1]; string formId1 = item.FieldId.Split('|')[0]; if (formId1 != formId) { formId = formId1; formData = GetFormData(formId, formDataList); } string formvalue = formOperation.GetValue(formData, fieldId); if (!string.IsNullOrEmpty(formvalue)) { bool compareValue = LineCompared(formvalue, item.FilterId, item.FilterValue); if (item.Logic == "AND") { res = compareValue; if (!compareValue) { break; } } else { if (compareValue) { res = compareValue; } } } } return(res); }