Exemple #1
0
        public static void Build(Database _dbObject)
        {
            //------------------------------------------------------
            _NameSpace = Globals.GetProgramatlyName(_dbObject.Name);
            //------------------------------------------------------
            _ProjectFolder = AppDomain.CurrentDomain.BaseDirectory + _NameSpace;
            if (Directory.Exists(_ProjectFolder))
            {
                Directory.Delete(_ProjectFolder, true);
            }
            Directory.CreateDirectory(_ProjectFolder);
            Directory.CreateDirectory(_ProjectFolder + @"\db\");
            Directory.CreateDirectory(_ProjectFolder + @"\Controllers\");
            Directory.CreateDirectory(_ProjectFolder + @"\Models\");
            Directory.CreateDirectory(_ProjectFolder + @"\Views\");
            //------------------------------------------------------
            db = new CustomDatabase(_dbObject);
            foreach (CustomTable table in db.Tables)
            {
                StoredProcedureBuilder.Create(table);
                Directory.CreateDirectory(_ProjectFolder + @"\Models\" + table.ProgramatlyName);

                SqlProviderBuilder.Create(table);
                FactoryBuilder.Create(table);
                ModelBuilder.Create(table);
                ControllerBuilder.Create(table);

                Directory.CreateDirectory(_ProjectFolder + @"\Views\" + table.ProgramatlyName);
                IndexViewBuilder.Create(table);
                DialogBoxViewBuilder.Create(table);
            }
            Directory.CreateDirectory(_ProjectFolder + @"\Views\Shared\");
            Directory.CreateDirectory(_ProjectFolder + @"\Views\Home\");
            NavigationLinksBuilder.Create(db);
        }
Exemple #2
0
        public static void Create(CustomTable t)
        {
            FactoryBuilder factory = new FactoryBuilder(t);

            string FactoryFile = FileManager.ReadingTextFile(AppDomain.CurrentDomain.BaseDirectory + "Resources/Classes/Factory.cs");

            string genFactoryFile = factory.Prepare(FactoryFile);

            FileManager.SaveFile(".cs", factory.CurrentTable.PathOfFactoryClass, genFactoryFile);
        }