Пример #1
0
        private void LoadTrigers()
        {
            Trigers.Clear();

            string    strSelectTrigers = "SELECT * FROM USER_TRIGGERS T";
            DataTable dtTrigers        = new DataTable();

            this.FillDataTable(ref dtTrigers, strSelectTrigers);
            LogManager.LogWriter.Debug(dtTrigers.Rows.Count.ToString() + " Trigger Bulundu...");
            foreach (DataRow row in dtTrigers.Rows)
            {
                Triger trg = new Triger()
                {
                    Name  = row["TRIGGER_NAME"].ToString(),
                    Owner = this
                };
                Trigers.Add(trg);
                LogManager.LogWriter.Info("Triger Yapısı Okundu : " + trg.Name);
                FireEvent("Triger Generated : " + trg.Name);
            }
        }
Пример #2
0
        private void LoadProcedure()
        {
            string strSelectSql = "SELECT DISTINCT OBJECT_NAME,OBJECT_TYPE FROM USER_PROCEDURES";

            DataTable dtProcedure = new DataTable();

            this.FillDataTable(ref dtProcedure, strSelectSql);
            LogManager.LogWriter.Debug(dtProcedure.Rows.Count.ToString() + " Procedure Bulundu");
            foreach (DataRow dataRow in dtProcedure.Rows)
            {
                if (dataRow["OBJECT_TYPE"].ToString() == "FUNCTION")
                {
                    Function func = new Function()
                    {
                        Name = dataRow["OBJECT_NAME"].ToString()
                    };
                    func.Owner = this;
                    func.BuildSql();
                    this.Functions.Add(func);

                    LogManager.LogWriter.Info("Function Yapısı Okundu : " + func.Name);
                    FireEvent("Function Created : " + func.Name);
                }
                else if (dataRow["OBJECT_TYPE"].ToString() == "TRIGGER")
                {
                    try
                    {
                        Triger trg = new Triger()
                        {
                            Name = dataRow["OBJECT_NAME"].ToString()
                        };
                        trg.Owner = this;
                        trg.BuildSql();
                        this.Trigers.Add(trg);
                        LogManager.LogWriter.Info("Triger Yapısı Okundu : " + trg.Name);
                        FireEvent("Triger Created : " + trg.Name);
                    }
                    catch (Exception ex)
                    {
                        LogManager.LogWriter.Error("Triger Oluşturulamadı !: " + ex.Message);
                    }
                }
                else if (dataRow["OBJECT_TYPE"].ToString() == "PACKAGE")
                {
                    Package pck = new Package()
                    {
                        Name = dataRow["OBJECT_NAME"].ToString()
                    };
                    pck.Owner = this;
                    pck.BuildSql();
                    this.Packages.Add(pck);

                    LogManager.LogWriter.Info("PACKAGE Yapısı Okundu : " + pck.Name);

                    FireEvent("Triger Package : " + pck.Name);
                }
                else if (dataRow["OBJECT_TYPE"].ToString() == "PROCEDURE")
                {
                    Procedure proc = new Procedure()
                    {
                        Name = dataRow["OBJECT_NAME"].ToString()
                    };
                    proc.Owner = this;
                    proc.BuildSql();
                    this.Procedures.Add(proc);
                    LogManager.LogWriter.Info("PROCEDURE Yapısı Okundu : " + proc.Name);
                    FireEvent("Triger Procedure : " + proc.Name);
                }
            }
        }