/// <summary> /// 验证行是否通过 /// </summary> /// <param name="rowvalue"></param> /// <param name="passed">验证通过</param> /// <param name="failded">验证失败</param> public static void Validate(this RowOldNewValue rowvalue, Action passed, Action failded = null) { rowvalue.ValidateFail = failded; rowvalue.ValidatePassed = passed; //rowvalue.RowActionType = 2; //AYUI.Session[rowvalue.RowId] = rowvalue; }
//public static void SetRowCompleted(this RowOldNewValue rowvalue) //{ // //rowvalue.RowActionType = 1; // AYUI.Session[rowvalue.RowId] = rowvalue; //} public static bool HasChanged(this RowOldNewValue value) { if (value == null) { return(false); } var obj1 = value.OldValue; var obj2 = value.NewValue; Type type1 = obj1.GetType(); Type type2 = obj2.GetType(); System.Reflection.PropertyInfo[] properties1 = type1.GetProperties(); System.Reflection.PropertyInfo[] properties2 = type2.GetProperties(); bool IsMatch = true; for (int i = 0; i < properties1.Length; i++) { string s = properties1[i].Name; if (s == "Selected" || s == "IsMouseOver" || s == "IsExpanded" || s == "IsEnabled" || s == "IsChecked" || s == "IsCheckedThree" || s == "AYID" || s == "IsEditRow" || s == "IsAppendRow" ) { continue; } var _s1 = properties1[i].GetValue(obj1, null); var _s2 = properties2[i].GetValue(obj2, null); if (_s1.ToObjectString() != _s2.ToObjectString()) { IsMatch = false; break; } } return(!IsMatch); }