Exemplo n.º 1
0
        private void toolStripButtonGenerate_Click(object sender, EventArgs e)
        {
            _DACGenController = new BakcEndGenController();

            ///TODO: ver estos valores estaticos
            FwkGeneratorHelper.UserDefinedTypes = base.Metadata.UserDefinedTypes;
            FwkGeneratorHelper.TemplateSetting  = base.TemplateSettingObject;

            _DACGenController.SelectedObject = _SelectedObject;

            _DACGenController.ListViewCodeGenerated = this.listViewCodeGenerated1;
            switch (_SelectedObject)
            {
            case CodeGeneratorCommon.SelectedObject.Tables:
            {
                if (ctrlTreeViewTables1.SelectedTable == null)
                {
                    return;
                }
                _DACGenController.Tables = ctrlTreeViewTables1.CheckedTables;
                break;
            }

            case CodeGeneratorCommon.SelectedObject.StoreProcedures:
            {
                if (treeViewStoreProcedures1.SelectedStoreProcedure == null)
                {
                    return;
                }
                //_DACGenController.StoreProcedures = treeViewStoreProcedures1.GetSelectedStoreProcedures();
                break;
            }

            case CodeGeneratorCommon.SelectedObject.Views:
            {
                if (ctrlTreeViewViews1.SelectedView == null)
                {
                    return;
                }
                _DACGenController.Views = ctrlTreeViewViews1.CheckedViews;
                break;
            }
            }

            _DACGenController.Generate();

            if (LastEntityName.Length != 0)
            {
                textCodeEditor1.Text = listViewCodeGenerated1.GetLastSelectedEntityCode(LastParentKey, LastEntityName);
            }
            else
            {
                textCodeEditor1.Text      = String.Empty;
                textCodeEditor1.TitleText = String.Empty;
            }
        }
Exemplo n.º 2
0
        private void toolStripButtonGenerate_Click(object sender, EventArgs e)
        {
            _DACGenController = new BakcEndGenController();

            ///TODO: ver estos valores estaticos
            FwkGeneratorHelper.UserDefinedTypes = base.Metadata.UserDefinedTypes;
            FwkGeneratorHelper.TemplateSetting = base.TemplateSettingObject;
            
            _DACGenController.SelectedObject = _SelectedObject;

            _DACGenController.ListViewCodeGenerated = this.listViewCodeGenerated1;
            switch (_SelectedObject)
            {
                case CodeGeneratorCommon.SelectedObject.Tables:
                    {
                        if (ctrlTreeViewTables1.SelectedTable == null) return;
                            _DACGenController.Tables = ctrlTreeViewTables1.CheckedTables;
                        break;
                    }
                case CodeGeneratorCommon.SelectedObject.StoreProcedures:
                    {
                        if (treeViewStoreProcedures1.SelectedStoreProcedure == null) return;
                        //_DACGenController.StoreProcedures = treeViewStoreProcedures1.GetSelectedStoreProcedures();
                        break;
                    }
                case CodeGeneratorCommon.SelectedObject.Views:
                    {
                        if (ctrlTreeViewViews1.SelectedView == null) return;
                        _DACGenController.Views = ctrlTreeViewViews1.CheckedViews;
                        break;
                    }
            }

            _DACGenController.Generate();

            if(LastEntityName.Length !=0)
                textCodeEditor1.Text = listViewCodeGenerated1.GetLastSelectedEntityCode(LastParentKey, LastEntityName);
            else
            {
                textCodeEditor1.Text = String.Empty;
                textCodeEditor1.TitleText = String.Empty;
            }
        }