示例#1
0
        public static List <KontenBaum> WurzelKonten(bool recursive)
        {
            List <KontenBaum> rootnodes = new List <KontenBaum>();

            string sql = string.Format(@"SELECT * FROM {0} WHERE idkonten = Konten_idkonten", KontenBaum.TKonto);

            DataRow row = Connection.adapter.Adapter.GetDataRow(sql);

            DataTable table = Connection.adapter.Adapter.GetDataTable(sql);

            if (recursive)
            {
                foreach (DataRow r in table.Rows)
                {
                    KontenBaum k = new KontenBaum(r, true);
                }
            }

            return(rootnodes);
        }
示例#2
0
        public KontenBaum(DataRow row, bool recursive) : base(row)
        {
            AnzahlKinder();

            if (recursive)
            {
                KinderSindDa = true;

                string sql = string.Format(@"SELECT * FROM {0} 
                    WHERE konten_idkonten = {1} AND idkonten <> konten_idkonten", TKonto, ID);

                DataTable table = Connection.adapter.Adapter.GetDataTable(sql);

                foreach (DataRow r in table.Rows)
                {
                    KontenBaum k = new KontenBaum(r, true);
                    this.UnterKonten.Add(k);
                }
            }
        }