예제 #1
0
파일: Suptype.cs 프로젝트: oeli/yafra
        public override void Get(int Aid, ref int Arows)
        {
            string sql;
            int rows;
            DlttV workDS;

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

            // set variables now
            id = Rwork.TYP_ID;
            bez = Rwork.BEZ;
            bez_id = Rwork.BEZ_ID;
            htyp_id = Rwork.H_TYP_ID;
            host = Rwork.HOST_TYP;
            text_id = Rwork.TEXTID;
            if (text_id > 0)
                rows = GetText();
            else
                text = "";
        }
예제 #2
0
        public override void Get(int Aid, ref int Arows)
        {
            string sql;
            int    rows;
            DlttV  workDS;

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

            // set variables now
            id      = Rwork.TYP_ID;
            bez     = Rwork.BEZ;
            bez_id  = Rwork.BEZ_ID;
            htyp_id = Rwork.H_TYP_ID;
            host    = Rwork.HOST_TYP;
            text_id = Rwork.TEXTID;
            if (text_id > 0)
            {
                rows = GetText();
            }
            else
            {
                text = "";
            }
        }
        public override global::System.Data.DataSet Clone()
        {
            DlttV cln = ((DlttV)(base.Clone()));

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

            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);
        }
예제 #5
0
        public void InsUpd(bool Ainsert, string Abez, string Atext, int Aparentid, bool Ahost)
        {
            int    rowsaffected;
            string sql;

            // set Country to this new one
            bez  = Abez;
            text = Atext;
            if (Ahost == false)
            {
                DlttV workDS = new DlttV();
                sql = String.Format("Select * from tdbadmin.tdbv_dltt where typ_id = {0} and s_id = {1}", Aparentid, tdb.User.Ulangid);
                FillDS(workDS, sql, new string[] { "tdbv_dltt" });
                DlttV.tdbv_dlttRow Rwork = workDS.tdbv_dltt[0];
                htyp_id = Aparentid;
                host    = Rwork.HOST_TYP;
            }

            // Begin Trx
            BeginTrx();

            if (Ainsert)
            {
                // first get a new unique ID for bez and then sai
                id = NewID("traeger_typ", "TYP_ID");
                if (Ahost == true)
                {
                    htyp_id = -1;
                    host    = id;
                }
                rowsaffected = InsBez();
                rowsaffected = InsText();
                // insert
                sql          = String.Format("insert into tdbadmin.traeger_typ values({0}, {1}, {2}, {3}, {4})", id, bez_id, htyp_id, host, text_id);
                rowsaffected = DBcmd(sql);
            }
            else
            {
                if (Ahost == true)
                {
                    htyp_id = -1;
                    host    = id;
                }
                rowsaffected = UpdBez();
                rowsaffected = UpdText();
                // update sai
                sql          = String.Format("update tdbadmin.traeger_typ set h_typ_id = {0}, host_typ = {1}, textid = {2} where typ_id = {3}", htyp_id, host, text_id, id);
                rowsaffected = DBcmd(sql);
            }
            // commit
            Commit();
        }
예제 #6
0
파일: Gsupt.cs 프로젝트: oeli/yafra
 public void SelTree(System.Windows.Forms.TreeView Atv)
 {
     string sql;
     DlttV workDS = new DlttV();
     sql = String.Format("Select * from tdbadmin.tdbv_dltt where s_id = {0} and h_typ_id < 1 order by bez", tdb.User.Ulangid);
     FillDS(workDS, sql, new string[] { "tdbv_dltt" });
     foreach (DlttV.tdbv_dlttRow Rwork in workDS.tdbv_dltt)
     {
         TreeNode RootNode = new TreeNode(Rwork.BEZ);
         RootNode.Tag = Rwork.TYP_ID;
         Atv.Nodes.Add(RootNode);
         GetChild(Rwork.TYP_ID, RootNode);
     }
 }
예제 #7
0
        public void SelTree(System.Windows.Forms.TreeView Atv)
        {
            string sql;
            DlttV  workDS = new DlttV();

            sql = String.Format("Select * from tdbadmin.tdbv_dltt where s_id = {0} and h_typ_id < 1 order by bez", tdb.User.Ulangid);
            FillDs(workDS, sql, new string[] { "tdbv_dltt" });
            foreach (DlttV.tdbv_dlttRow Rwork in workDS.tdbv_dltt)
            {
                TreeNode RootNode = new TreeNode(Rwork.BEZ);
                RootNode.Tag = Rwork.TYP_ID;
                Atv.Nodes.Add(RootNode);
                GetChild(Rwork.TYP_ID, RootNode);
            }
        }
예제 #8
0
        private void GetChild(int Aparentid, TreeNode Aparentnode)
        {
            string sql;
            int    rows;
            DlttV  workDS = new DlttV();

            sql = String.Format("Select * from tdbadmin.tdbv_dltt where s_id = {0} and h_typ_id = {1} order by bez", tdb.User.Ulangid, Aparentid);
            FillDs(workDS, sql, new string[] { "tdbv_dltt" });
            rows = workDS.tdbv_dltt.Rows.Count;
            if (rows < 1)
            {
                return;
            }
            foreach (DlttV.tdbv_dlttRow Rwork in workDS.tdbv_dltt)
            {
                TreeNode ChildNode = new TreeNode(Rwork.BEZ);
                ChildNode.Tag = Rwork.TYP_ID;
                Aparentnode.Nodes.Add(ChildNode);
                GetChild(Rwork.TYP_ID, ChildNode);
            }
        }
예제 #9
0
파일: Gsupt.cs 프로젝트: oeli/yafra
 private void GetChild(int Aparentid, TreeNode Aparentnode)
 {
     string sql;
     int rows;
     DlttV workDS = new DlttV();
     sql = String.Format("Select * from tdbadmin.tdbv_dltt where s_id = {0} and h_typ_id = {1} order by bez", tdb.User.Ulangid, Aparentid);
     FillDS(workDS, sql, new string[] { "tdbv_dltt" });
     rows = workDS.tdbv_dltt.Rows.Count;
     if (rows < 1)
         return;
     foreach (DlttV.tdbv_dlttRow Rwork in workDS.tdbv_dltt)
     {
         TreeNode ChildNode = new TreeNode(Rwork.BEZ);
         ChildNode.Tag = Rwork.TYP_ID;
         Aparentnode.Nodes.Add(ChildNode);
         GetChild(Rwork.TYP_ID, ChildNode);
     }
 }
예제 #10
0
파일: Suptype.cs 프로젝트: oeli/yafra
        public void InsUpd(bool Ainsert, string Abez, string Atext, int Aparentid, bool Ahost)
        {
            int rowsaffected;
            string sql;

            // set Country to this new one
            bez = Abez;
            text = Atext;
            if (Ahost == false)
            {
                DlttV workDS = new DlttV();
                sql = String.Format("Select * from tdbadmin.tdbv_dltt where typ_id = {0} and s_id = {1}", Aparentid, tdb.User.Ulangid);
                FillDS(workDS, sql, new string[] { "tdbv_dltt" });
                DlttV.tdbv_dlttRow Rwork = workDS.tdbv_dltt[0];
                htyp_id = Aparentid;
                host = Rwork.HOST_TYP;
            }

            // Begin Trx
            BeginTrx();

            if (Ainsert)
            {
                // first get a new unique ID for bez and then sai
                id = NewID("traeger_typ", "TYP_ID");
                if (Ahost == true)
                {
                    htyp_id = -1;
                    host = id;
                }
                rowsaffected = InsBez();
                rowsaffected = InsText();
                // insert
                sql = String.Format("insert into tdbadmin.traeger_typ values({0}, {1}, {2}, {3}, {4})", id, bez_id, htyp_id, host, text_id);
                rowsaffected = DBcmd(sql);
            }
            else
            {
                if (Ahost == true)
                {
                    htyp_id = -1;
                    host = id;
                }
                rowsaffected = UpdBez();
                rowsaffected = UpdText();
                // update sai
                sql = String.Format("update tdbadmin.traeger_typ set h_typ_id = {0}, host_typ = {1}, textid = {2} where typ_id = {3}", htyp_id, host, text_id, id);
                rowsaffected = DBcmd(sql);
            }
            // commit
            Commit();
        }
            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();
                DlttV ds = new DlttV();

                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_dlttDataTable";
                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);
            }