public ApplicationController(ApplicationSettings applicationSettings, AbstractMetadataReader metadataReader)
 {
     _applicationSettings = applicationSettings;
     _castleEntityGenerator = new KPCastleEntityGenerator(applicationSettings, metadataReader);
     _castleEntityBoGenerator = new KPCastleEntityBOGenerator(applicationSettings, metadataReader);
     _kpAspNetFormsViewGerenator = new KPAspNetFormsViewGerenator(applicationSettings, metadataReader);
     _kpAspNetFormsViewCSGerenator = new KPAspNetFormsViewCSGerenator(applicationSettings, metadataReader);
     _kpAspNetFormsViewDesignerGerenator = new KPAspNetFormsViewDesignerGerenator(applicationSettings, metadataReader);
     _kpAspNetFormsGerenator = new KPAspNetFormsGerenator(applicationSettings, metadataReader);
     _kpAspNetFormsCSGerenator = new KPAspNetFormsCSGerenator(applicationSettings, metadataReader);
     _kpAspNetFormsDesignerGerenator = new KPAspNetFormsDesignerGerenator(applicationSettings, metadataReader);
 }
        private void tabCodeGenerate_SelectedIndexChanged(object sender, EventArgs e)
        {
            Table table = GetSelectedTable();
            tabConfiguration.Enabled = false;
            UpdatePropertiesControls();

            if (tabCodeGenerate.SelectedTab.Equals(tabTableDetail))
            {
                tabConfiguration.Enabled = true;
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabEntityCode))
            {
                KPCastleEntityGenerator generator = new KPCastleEntityGenerator(ApplicationSettings, MetadataReader);
                txtEntityCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabEntityBOCode))
            {
                KPCastleEntityBOGenerator generator = new KPCastleEntityBOGenerator(ApplicationSettings, MetadataReader);
                txtEntityBOCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabFormViewASPX))
            {
                KPAspNetFormsViewGerenator generator = new KPAspNetFormsViewGerenator(ApplicationSettings, MetadataReader);

                txtFormViewASPXCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabFormViewDesigner))
            {
                KPAspNetFormsViewDesignerGerenator generator = new KPAspNetFormsViewDesignerGerenator(ApplicationSettings, MetadataReader);
                txtFormViewDESIGNERCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabFormViewCS))
            {
                KPAspNetFormsViewCSGerenator generator = new KPAspNetFormsViewCSGerenator(ApplicationSettings, MetadataReader);
                txtFormViewCSCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabFormASPX))
            {
                KPAspNetFormsGerenator generator = new KPAspNetFormsGerenator(ApplicationSettings, MetadataReader);
                txtFormASPXCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabFormDesigner))
            {
                KPAspNetFormsDesignerGerenator generator = new KPAspNetFormsDesignerGerenator(ApplicationSettings, MetadataReader);
                txtFormDESIGNERCode.Text = generator.Generate(table);
            }
            else if (tabCodeGenerate.SelectedTab.Equals(tabFormCS))
            {
                KPAspNetFormsCSGerenator generator = new KPAspNetFormsCSGerenator(ApplicationSettings, MetadataReader);
                txtFormCSCode.Text = generator.Generate(table);
            }
        }