public static bool IsCleanObject(BusinessObject obj) { if (TemplateObjectList.ContainsKey(obj.AATableName) == false) { TemplateObjectList.Add(obj.AATableName, (BusinessObject)ABCDynamicInvoker.CreateInstanceObject(obj.GetType())); } InitPropertyList(obj.AATableName); BusinessObject objTemplate = TemplateObjectList[obj.AATableName]; if (objTemplate != null) { foreach (PropertyInfo proInfo in PropertyList[obj.AATableName].Values) { object obj1 = proInfo.GetValue(obj, null); object obj2 = proInfo.GetValue(objTemplate, null); if (obj1 == obj2 || (obj1 == null && obj2 == null) || (obj1 != null && obj2 != null && obj1.ToString() == obj2.ToString())) { continue; } return(false); } } return(true); }
public static void GetAllController(AppDomain domain, String strAssFileName) { try { Assembly assEntities = domain.Load(AssemblyName.GetAssemblyName(strAssFileName)); if (assEntities == null) { return; } foreach (Type type in assEntities.GetTypes()) { if (typeof(BusinessObjectController).IsAssignableFrom(type)) { BusinessObjectController Ctrl = (BusinessObjectController)ABCDynamicInvoker.CreateInstanceObject(type); if (Ctrl != null) { BusControllersList.Add(type.Name, Ctrl); } } } } catch (Exception ex) { } }
public static BusinessObject GetBusinessObject(String strTableName) { Type type = GetBusinessObjectType(strTableName); if (type != null) { return((BusinessObject)ABCDynamicInvoker.CreateInstanceObject(type)); } return(null); }
public static bool IsCleanField(BusinessObject obj, String strFieldName) { if (TemplateObjectList.ContainsKey(obj.AATableName) == false) { TemplateObjectList.Add(obj.AATableName, (BusinessObject)ABCDynamicInvoker.CreateInstanceObject(obj.GetType())); } InitPropertyList(obj.AATableName); BusinessObject objTemplate = TemplateObjectList[obj.AATableName]; if (objTemplate != null && PropertyList[obj.AATableName].ContainsKey(strFieldName)) { PropertyInfo proInfo = PropertyList[obj.AATableName][strFieldName]; object obj1 = proInfo.GetValue(obj, null); object obj2 = proInfo.GetValue(objTemplate, null); if (obj1 == obj2 || (obj1 == null && obj2 == null) || (obj1 != null && obj2 != null && obj1.ToString() == obj2.ToString())) { return(true); } } return(false); }