Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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)
            {
            }
        }
Exemplo n.º 3
0
        public static BusinessObject GetBusinessObject(String strTableName)
        {
            Type type = GetBusinessObjectType(strTableName);

            if (type != null)
            {
                return((BusinessObject)ABCDynamicInvoker.CreateInstanceObject(type));
            }

            return(null);
        }
Exemplo n.º 4
0
        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);
        }