Exemplo n.º 1
0
        public static void ShowFunctionDetail(
            System.Windows.Forms.Form oParent,
            Guid DBID,
            string VersionID,
            string FunctionName)
        {
            SQLAutoDocLib.BLL.Function_Factory oFactory  = new SQLAutoDocLib.BLL.Function_Factory();
            SQLAutoDocLib.BLL.Function         oFunction = oFactory.GetFunctionByName(DBID: DBID, FunctionName: FunctionName, VersionID: VersionID);

            StringReader  oReader = new StringReader(oFunction.Configuration);
            XPathDocument oMyDoc  = new XPathDocument(oReader);

            XslCompiledTransform oProcessor = new XslCompiledTransform();
            string sXSL = GetResourceTextFile(oParent, "SQLAutoDoc.xsl.function.xsl");

            oProcessor.Load(XmlReader.Create(new StringReader(sXSL)));

            StringBuilder oBuffer  = new StringBuilder();
            StringWriter  oSWriter = new StringWriter(oBuffer);

            oProcessor.Transform(
                XmlReader.Create(new StringReader(oFunction.Configuration)),
                null,
                oSWriter);

            SetFormFields(
                oParent: oParent,
                VersionID: VersionID,
                Name: FunctionName,
                Desc: oFunction.Description,
                FirstDate: oFunction.FindFirstVersion,
                LastDate: oFunction.FindLastVersion,
                HTML: oSWriter.ToString());

            oSWriter.Flush();
            oSWriter.Dispose();

            Application.DoEvents();
        }
Exemplo n.º 2
0
        private void ShowDesc()
        {
            string VersionID = cmbVersion.SelectedValue.ToString();

            TreeNode CurrentNode = tvwObject.SelectedNode;

            if (CurrentNode.Parent != null)
            {
                if (CurrentNode.Parent.Name == SQLAutoDocLib.UTIL.Constants.TABLENODE)
                {
                    SQLAutoDocLib.BLL.Table_Factory oFactory = new SQLAutoDocLib.BLL.Table_Factory();
                    SQLAutoDocLib.BLL.Table         oTable   = oFactory.GetTableByName(DBID: m_DBID, TableName: CurrentNode.Name, VersionID: VersionID);

                    frmDesc oForm = new frmDesc(
                        ObjectName: CurrentNode.Name,
                        ObjectDesc: oTable.Description,
                        ObjectType: SQLAutoDocLib.UTIL.ObjectType.Table);

                    if (oForm.ShowDialog() == DialogResult.OK)
                    {
                        oTable.Load();
                        oTable.Description = oForm.Desc;
                        oTable.Save();

                        txtDesc.Text = oForm.Desc;
                    }
                }

                else if (CurrentNode.Parent.Name == SQLAutoDocLib.UTIL.Constants.VIEWNODE)
                {
                    SQLAutoDocLib.BLL.View_Factory oFactory = new SQLAutoDocLib.BLL.View_Factory();
                    SQLAutoDocLib.BLL.View         oView    = oFactory.GetViewByName(DBID: m_DBID, ViewName: CurrentNode.Name, VersionID: VersionID);

                    frmDesc oForm = new frmDesc(
                        ObjectName: CurrentNode.Name,
                        ObjectDesc: oView.Description,
                        ObjectType: SQLAutoDocLib.UTIL.ObjectType.View);

                    if (oForm.ShowDialog() == DialogResult.OK)
                    {
                        oView.Load();
                        oView.Description = oForm.Desc;
                        oView.Save();

                        txtDesc.Text = oForm.Desc;
                    }
                }

                else if (CurrentNode.Parent.Name == SQLAutoDocLib.UTIL.Constants.TRIGGERNODE)
                {
                    SQLAutoDocLib.BLL.Trigger_Factory oFactory = new SQLAutoDocLib.BLL.Trigger_Factory();
                    SQLAutoDocLib.BLL.Trigger         oTrigger = oFactory.GetTriggerByName(DBID: m_DBID, TriggerName: CurrentNode.Name, VersionID: VersionID);

                    frmDesc oForm = new frmDesc(
                        ObjectName: CurrentNode.Name,
                        ObjectDesc: oTrigger.Description,
                        ObjectType: SQLAutoDocLib.UTIL.ObjectType.Trigger);

                    if (oForm.ShowDialog() == DialogResult.OK)
                    {
                        oTrigger.Load();
                        oTrigger.Description = oForm.Desc;
                        oTrigger.Save();

                        txtDesc.Text = oForm.Desc;
                    }
                }

                else if (CurrentNode.Parent.Name == SQLAutoDocLib.UTIL.Constants.PROCEDURENODE)
                {
                    SQLAutoDocLib.BLL.Procedure_Factory oFactory   = new SQLAutoDocLib.BLL.Procedure_Factory();
                    SQLAutoDocLib.BLL.Procedure         oProcedure = oFactory.GetProcedureByName(DBID: m_DBID, ProcedureName: CurrentNode.Name, VersionID: VersionID);

                    frmDesc oForm = new frmDesc(
                        ObjectName: CurrentNode.Name,
                        ObjectDesc: oProcedure.Description,
                        ObjectType: SQLAutoDocLib.UTIL.ObjectType.Procedure);

                    if (oForm.ShowDialog() == DialogResult.OK)
                    {
                        oProcedure.Load();
                        oProcedure.Description = oForm.Desc;
                        oProcedure.Save();

                        txtDesc.Text = oForm.Desc;
                    }
                }

                else if (CurrentNode.Parent.Name == SQLAutoDocLib.UTIL.Constants.FUNCTIONNODE)
                {
                    SQLAutoDocLib.BLL.Function_Factory oFactory  = new SQLAutoDocLib.BLL.Function_Factory();
                    SQLAutoDocLib.BLL.Function         oFunction = oFactory.GetFunctionByName(DBID: m_DBID, FunctionName: CurrentNode.Name, VersionID: VersionID);

                    frmDesc oForm = new frmDesc(
                        ObjectName: CurrentNode.Name,
                        ObjectDesc: oFunction.Description,
                        ObjectType: SQLAutoDocLib.UTIL.ObjectType.Function);

                    if (oForm.ShowDialog() == DialogResult.OK)
                    {
                        oFunction.Load();
                        oFunction.Description = oForm.Desc;
                        oFunction.Save();

                        txtDesc.Text = oForm.Desc;
                    }
                }
            }
        }