Exemple #1
0
        private void PopulateOwners()
        {
            var owners = metadataReader.GetOwners();

            if (owners == null || owners.Count == 0)
            {
                owners = new List <string> {
                    "dbo"
                };
            }
            ownersComboBox.Items.Clear();
            ownersComboBox.Items.AddRange(owners.ToArray());
        }
Exemple #2
0
        private void generateMapclass()
        {
            var    Mapclasssettings = new Connection();
            string mapTempPath      = Path.GetTempPath();

            if (mapTempPath.EndsWith(@"\") == false)
            {
                mapTempPath += @"\";
            }
            mapTempPath += @"Mapping\";
            if (Directory.Exists(mapTempPath) == false)
            {
                Directory.CreateDirectory(mapTempPath);
            }
            Mapclasssettings.Domainfolderpath = mapTempPath;

            Mapclasssettings.EntityName = "Entity";
            if ((RecoEngine_BI.Common.iDBType) == (int)Enums.DBType.Oracle)
            {
                Mapclasssettings.ConnectionString = ConfigurationManager.AppSettings["ConnectionString"];
                Mapclasssettings.Type             = ServerType.Oracle;
            }
            else if ((RecoEngine_BI.Common.iDBType) == (int)Enums.DBType.Mysql)
            {
                Mapclasssettings.ConnectionString = ConfigurationManager.AppSettings["MysqlConnectionString"];
                Mapclasssettings.Type             = ServerType.Mysql;
            }

            //  metadataReader = MetadataFactory.GetReader(Mapclasssettings.Type, Mapclasssettings.ConnectionString);
            var           owners     = metadataReader.GetOwners();
            IList <Table> tblList    = metadataReader.GetTables("RECOUSR");
            int           tableindex = 0;

            for (int i = 0; i < tblList.Count; i++)
            {
                if (tblList[i].Name == "OPPORTUNITY")
                {
                    tableindex = i;
                    break;
                }
            }
            Table table = tblList[tableindex];

            table.PrimaryKey = metadataReader.DeterminePrimaryKeys(table);
            metadataReader.GetTableDetails(table, "RECOUSR");
            var applicationPreferences = GetApplicationPreferences(table, false, Mapclasssettings);

            new ApplicationController(applicationPreferences, table).Generate();
        }
Exemple #3
0
        private void PopulateOwners()
        {
            var owners = metadataReader.GetOwners();

            if (owners == null || owners.Count == 0)
            {
                owners = new List <string> {
                    "dbo"
                };
            }

            tablesListBox.SelectedIndexChanged -= TablesListSelectedIndexChanged;

            ownersComboBox.Items.Clear();
            ownersComboBox.Items.AddRange(owners.ToArray());

            tablesListBox.SelectedIndexChanged += TablesListSelectedIndexChanged;
            ownersComboBox.SelectedIndex        = 0;
        }