Example #1
0
        public IEnumerable <SystemEntityTypeDataModel> ListEntities()
        {
            var data         = new SystemEntityTypeDataModel();
            var listEntities = SystemEntityTypeDataManager.GetEntityDetails(data, SessionVariables.RequestProfile, ApplicationCommon.ReturnAuditInfo);

            return(listEntities);
        }
Example #2
0
        private static void FormatNumericalData(FieldConfigurationDataModel data, RequestProfile requestProfile)
        {
            Type type = null;

            var dataSE = new SystemEntityTypeDataModel();

            dataSE.SystemEntityTypeId = data.SystemEntityTypeId;

            var dt = SystemEntityTypeDataManager.GetEntityDetails(dataSE, requestProfile);

            var entityModel = dt[0].EntityName + "DataModel";

            var currentAssembly = Assembly.GetExecutingAssembly();
            var assemblyNames   = currentAssembly.GetReferencedAssemblies();

            foreach (var aName in assemblyNames)
            {
                try
                {
                    var assembly = Assembly.Load(aName);
                    type = assembly.GetTypes().First(t => t.Name == entityModel);
                    var objInstance = Activator.CreateInstance(type);
                    var objType     = objInstance.GetType();

                    var objProps = objType.GetProperties();

                    foreach (var propInfo in objProps)
                    {
                        if (propInfo.Name.Equals(data.Name))
                        {
                            if (propInfo.PropertyType == typeof(int?) || propInfo.PropertyType == typeof(DateTime))
                            {
                                data.HorizontalAlignment = "Right";
                            }
                        }
                    }
                }
                catch { }
            }
        }