public override global::System.Data.DataSet Clone()
        {
            DltV cln = ((DltV)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DltV ds = new DltV();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Exemplo n.º 3
0
Arquivo: Gsup.cs Projeto: oeli/yafra
 public void SelTree(System.Windows.Forms.TreeView Atv)
 {
     string sql;
     DltV workDS = new DltV();
     sql = String.Format("Select * from tdbadmin.tdbv_dlt where s_id = {0} and h_dlt_id < 1 order by bez", tdb.User.Ulangid);
     FillDS(workDS, sql, new string[] { "tdbv_dlt" });
     foreach (DltV.tdbv_dltRow Rwork in workDS.tdbv_dlt)
     {
         TreeNode RootNode = new TreeNode(Rwork.BEZ);
         RootNode.Tag = Rwork.DLT_ID;
         Atv.Nodes.Add(RootNode);
         GetChild(Rwork.DLT_ID, RootNode);
     }
 }
Exemplo n.º 4
0
Arquivo: Gsup.cs Projeto: oeli/yafra
        public void SelTree(System.Windows.Forms.TreeView Atv)
        {
            string sql;
            DltV   workDS = new DltV();

            sql = String.Format("Select * from tdbadmin.tdbv_dlt where s_id = {0} and h_dlt_id < 1 order by bez", tdb.User.Ulangid);
            FillDS(workDS, sql, new string[] { "tdbv_dlt" });
            foreach (DltV.tdbv_dltRow Rwork in workDS.tdbv_dlt)
            {
                TreeNode RootNode = new TreeNode(Rwork.BEZ);
                RootNode.Tag = Rwork.DLT_ID;
                Atv.Nodes.Add(RootNode);
                GetChild(Rwork.DLT_ID, RootNode);
            }
        }
Exemplo n.º 5
0
Arquivo: Gsup.cs Projeto: oeli/yafra
        private void GetChild(int Aparentid, TreeNode Aparentnode)
        {
            string sql;
            int    rows;
            DltV   workDS = new DltV();

            sql = String.Format("Select * from tdbadmin.tdbv_dlt where s_id = {0} and h_dlt_id = {1} order by bez", tdb.User.Ulangid, Aparentid);
            FillDS(workDS, sql, new string[] { "tdbv_dlt" });
            rows = workDS.tdbv_dlt.Rows.Count;
            if (rows < 1)
            {
                return;
            }
            foreach (DltV.tdbv_dltRow Rwork in workDS.tdbv_dlt)
            {
                TreeNode ChildNode = new TreeNode(Rwork.BEZ);
                ChildNode.Tag = Rwork.DLT_ID;
                Aparentnode.Nodes.Add(ChildNode);
                GetChild(Rwork.DLT_ID, ChildNode);
            }
        }
Exemplo n.º 6
0
        public override void Get(int Aid, ref int Arows)
        {
            string sql;
            int    rows;
            DltV   workDS;

            // get the first suiteable title and return it
            workDS = new DltV();
            sql    = String.Format("Select * from tdbadmin.tdbv_dlt where dlt_id = {0} and s_id = {1}", Aid, tdb.User.Ulangid);
            FillDs(workDS, sql, new string[] { "tdbv_dlt" });
            Arows = workDS.tdbv_dlt.Rows.Count;
            DltV.tdbv_dltRow Rwork = workDS.tdbv_dlt[0];

            // set variables now
            id       = Rwork.DLT_ID;
            code     = Rwork.CODE;
            bez      = Rwork.BEZ;
            bez_id   = Rwork.BEZ_ID;
            parentid = Rwork.H_DLT_ID;
            host     = Rwork.HOSTID;
            kat_id   = Rwork.CAT_ID;
            kat      = Rwork.CAT;
            typ_id   = Rwork.TYPID;
            suptyp   = Rwork.TYP;
            capacity = Rwork.NUMPLACE;
            level    = Rwork.LEVELPLACE;
            staid    = Rwork.STAID;
            text_id  = Rwork.TEXTID;
            if (text_id > 0)
            {
                rows = GetText();
            }
            else
            {
                text = "";
            }
        }
Exemplo n.º 7
0
Arquivo: Sup.cs Projeto: oeli/yafra
        public void InsUpd(bool Ainsert, string Abez, string Atext, string Acode,
            int Aparentid, bool Ahost, int Acat, int Asupt, int Asta, int Alev, int Acapa)
        {
            int rowsaffected;
            string sql;

            // set Country to this new one
            bez = Abez;
            text = Atext;
            code = Acode;
            if (Ahost == false)
            {
                DltV workDS = new DltV();
                sql = String.Format("Select * from tdbadmin.tdbv_dlt where dlt_id = {0} and s_id = {1}", Aparentid, tdb.User.Ulangid);
                FillDS(workDS, sql, new string[] { "tdbv_dlt" });
                DltV.tdbv_dltRow Rwork = workDS.tdbv_dlt[0];
                parentid = Aparentid;
                host = Rwork.HOSTID;
            }
            kat_id = Acat;
            typ_id = Asupt;
            capacity = Acapa;
            level = Alev;
            staid = Asta;

            // Begin Trx
            BeginTrx();

            if (Ainsert)
            {
                // first get a new unique ID for bez and then sai
                id = NewID("dienst_traeger", "DLT_ID");
                if (Ahost == true)
                {
                    parentid = -1;
                    host = id;
                }
                rowsaffected = InsBez();
                rowsaffected = InsText();
                // insert
                sql = String.Format("insert into tdbadmin.dienst_traeger values({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})",
                    id, code, bez_id, kat_id, parentid, dlt_grp_id, host, typ_id, text_id, level, staid, capacity);
                rowsaffected = DBcmd(sql);
            }
            else
            {
                if (Ahost == true)
                {
                    parentid = -1;
                    host = id;
                }
                rowsaffected = UpdBez();
                rowsaffected = UpdText();
                // update sai
                sql = String.Format("update tdbadmin.dienst_traeger set h_dlt_id = {0}, host_id = {1}, kat_id = {2}, typ_id = {3}, sta_id ={4}, stufe = {5}, anz = {6}, dlt_grp_id = {7}, code = '{8}', textid = {9} where dlt_id = {10}",
                    parentid, host, kat_id, typ_id, staid, level, capacity, dlt_grp_id, code, text_id, id);
                rowsaffected = DBcmd(sql);
            }
            // commit
            Commit();
        }
Exemplo n.º 8
0
Arquivo: Sup.cs Projeto: oeli/yafra
        public override void Get(int Aid, ref int Arows)
        {
            string sql;
            int rows;
            DltV workDS;

            // get the first suiteable title and return it
            workDS = new DltV();
            sql = String.Format("Select * from tdbadmin.tdbv_dlt where dlt_id = {0} and s_id = {1}", Aid, tdb.User.Ulangid);
            FillDS(workDS, sql, new string[] { "tdbv_dlt" });
            Arows = workDS.tdbv_dlt.Rows.Count;
            DltV.tdbv_dltRow Rwork = workDS.tdbv_dlt[0];

            // set variables now
            id = Rwork.DLT_ID;
            code = Rwork.CODE;
            bez = Rwork.BEZ;
            bez_id = Rwork.BEZ_ID;
            parentid = Rwork.H_DLT_ID;
            host = Rwork.HOSTID;
            kat_id = Rwork.CAT_ID;
            kat = Rwork.CAT;
            typ_id = Rwork.TYPID;
            suptyp = Rwork.TYP;
            capacity = Rwork.NUMPLACE;
            level = Rwork.LEVELPLACE;
            staid = Rwork.STAID;
            text_id = Rwork.TEXTID;
            if (text_id > 0)
                rows = GetText();
            else
                text = "";
        }
Exemplo n.º 9
0
        public void InsUpd(bool Ainsert, string Abez, string Atext, string Acode,
                           int Aparentid, bool Ahost, int Acat, int Asupt, int Asta, int Alev, int Acapa)
        {
            int    rowsaffected;
            string sql;

            // set Country to this new one
            bez  = Abez;
            text = Atext;
            code = Acode;
            if (Ahost == false)
            {
                DltV workDS = new DltV();
                sql = String.Format("Select * from tdbadmin.tdbv_dlt where dlt_id = {0} and s_id = {1}", Aparentid, tdb.User.Ulangid);
                FillDs(workDS, sql, new string[] { "tdbv_dlt" });
                DltV.tdbv_dltRow Rwork = workDS.tdbv_dlt[0];
                parentid = Aparentid;
                host     = Rwork.HOSTID;
            }
            kat_id   = Acat;
            typ_id   = Asupt;
            capacity = Acapa;
            level    = Alev;
            staid    = Asta;

            // Begin Trx
            BeginTrx();

            if (Ainsert)
            {
                // first get a new unique ID for bez and then sai
                id = NewId("dienst_traeger", "DLT_ID");
                if (Ahost == true)
                {
                    parentid = -1;
                    host     = id;
                }
                rowsaffected = InsBez();
                rowsaffected = InsText();
                // insert
                sql = String.Format("insert into tdbadmin.dienst_traeger values({0}, '{1}', {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11})",
                                    id, code, bez_id, kat_id, parentid, dlt_grp_id, host, typ_id, text_id, level, staid, capacity);
                rowsaffected = DBcmd(sql);
            }
            else
            {
                if (Ahost == true)
                {
                    parentid = -1;
                    host     = id;
                }
                rowsaffected = UpdBez();
                rowsaffected = UpdText();
                // update sai
                sql = String.Format("update tdbadmin.dienst_traeger set h_dlt_id = {0}, host_id = {1}, kat_id = {2}, typ_id = {3}, sta_id ={4}, stufe = {5}, anz = {6}, dlt_grp_id = {7}, code = '{8}', textid = {9} where dlt_id = {10}",
                                    parentid, host, kat_id, typ_id, staid, level, capacity, dlt_grp_id, code, text_id, id);
                rowsaffected = DBcmd(sql);
            }
            // commit
            Commit();
        }
Exemplo n.º 10
0
Arquivo: Gsup.cs Projeto: oeli/yafra
 private void GetChild(int Aparentid, TreeNode Aparentnode)
 {
     string sql;
     int rows;
     DltV workDS = new DltV();
     sql = String.Format("Select * from tdbadmin.tdbv_dlt where s_id = {0} and h_dlt_id = {1} order by bez", tdb.User.Ulangid, Aparentid);
     FillDS(workDS, sql, new string[] { "tdbv_dlt" });
     rows = workDS.tdbv_dlt.Rows.Count;
     if (rows < 1)
         return;
     foreach (DltV.tdbv_dltRow Rwork in workDS.tdbv_dlt)
     {
         TreeNode ChildNode = new TreeNode(Rwork.BEZ);
         ChildNode.Tag = Rwork.DLT_ID;
         Aparentnode.Nodes.Add(ChildNode);
         GetChild(Rwork.DLT_ID, ChildNode);
     }
 }
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                DltV ds = new DltV();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "tdbv_dltDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }