예제 #1
0
        public List<Program> GetAllProgramme()
        {
            List<Program> programme = new List<Program>();

            String query = @"select pname, path, 'x' as x, i_typ_name, o_typ_name from web_programm";

            OdbcCommand command = new OdbcCommand(query, con);
            OdbcDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                Typ out_typ = null;
                if (!reader.IsDBNull(4))
                    out_typ = new Typ(reader.GetString(4));

                Typ input_typ = null;
                if (!reader.IsDBNull(3))
                    input_typ = new Typ(reader.GetString(3));

                Program p = new Program();
                p.Name = reader.GetString(0);
                p.Path = reader.GetString(1);
                p.OutputTyp = out_typ;
                p.InputTyp = input_typ;

                programme.Add(p);

            }

            return programme;
        }
        public List<Program> GetProgramsOfType(Typ t)
        {
            Console.WriteLine("GetProgramsOfType(Typ t)");

            List<Program> all = this.GetAllProgramme();
            List<Program> progs = new List<Program>();
            foreach (Program p in all)
                if (p.InputTyp != null && p.InputTyp.Name.Equals(t.Name))
                    progs.Add(p);
            return progs;
        }
        public List<ArbeitsAuftrag> GetArbeitsAuftraege()
        {
            List<ArbeitsAuftrag> arbeitsauftraege = new List<ArbeitsAuftrag>();

            String query = "select programm.pname, programm.path, programm.type, programm.i_typ_name, "
                         + "programm.i_typ_name, daten.did, daten.typ_tname, daten.data from AA "
                         + "join programm on (AA.programm_pname = programm.pname) "
                         + "join daten on (daten.did = AA.daten_did);";

            OdbcCommand command = new OdbcCommand(query, con);
            OdbcDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {

                ObjectHandle h = Activator.CreateInstanceFrom(
                    stdPath + reader.GetString(1),
                    reader.GetString(2)
                );

                Typ in_typ = null;
                if (!reader.IsDBNull(3))
                    in_typ = new Typ(reader.GetString(4));

                Typ out_typ = null;
                if (!reader.IsDBNull(4))
                    out_typ = new Typ(reader.GetString(4));

                Program p = (Program)h.Unwrap();
                p.Name = reader.GetString(0);
                p.OutputTyp = out_typ;
                p.InputTyp = in_typ;

                arbeitsauftraege.Add(
                    new ArbeitsAuftrag(
                        p,
                        new Uebergabedaten(
                            reader.GetInt32(5),
                            new Typ(reader.GetString(6)),
                            reader.GetString(7)
                        )
                    )
                );
            }

            return arbeitsauftraege;
        }
        public List<Program> GetProgramsOfType(Typ t)
        {
            List<Program> programme = new List<Program>();

            String query = @"select pname, path, type, i_typ_name, o_typ_name from programm where i_typ_name = ?";

            OdbcCommand command = new OdbcCommand(query, con);
            command.Parameters.Add("i_typ_name", OdbcType.VarChar, 50, "i_typ_name");
            command.Parameters["i_typ_name"].Value = t.Name;

            OdbcDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {

                ObjectHandle h = Activator.CreateInstanceFrom(
                    stdPath + reader.GetString(1),
                    reader.GetString(2)
                );

                Typ out_typ = null;
                if (!reader.IsDBNull(4))
                    out_typ = new Typ(reader.GetString(4));

                Typ in_typ = null;
                if (!reader.IsDBNull(3))
                    in_typ = new Typ(reader.GetString(3));

                Program p = (Program)h.Unwrap();
                p.Name = reader.GetString(0);
                p.OutputTyp = out_typ;
                p.InputTyp = in_typ;

                programme.Add(p);

            }

            return programme;
        }
        public List<Program> GetProgramme()
        {
            List<Program> programme = new List<Program>();

            String query = @"select pname, path, type, i_typ_name, o_typ_name from programm where i_typ_name is null";

            OdbcCommand command = new OdbcCommand(query, con);
            OdbcDataReader reader = command.ExecuteReader();

            while(reader.Read()) {

                ObjectHandle h = Activator.CreateInstanceFrom(
                    stdPath + reader.GetString(1),
                    reader.GetString(2)
                );

                Typ out_typ = null;
                if (!reader.IsDBNull(4))
                    out_typ = new Typ(reader.GetString(4));

                Program p = (Program)h.Unwrap();
                p.Name = reader.GetString(0);
                p.OutputTyp = out_typ;
                p.InputTyp = null;

                 programme.Add(p);

            }

            return programme;
        }
예제 #6
0
        public List<ArbeitsAuftrag> GetArbeitsAuftraege()
        {
            List<ArbeitsAuftrag> arbeitsauftraege = new List<ArbeitsAuftrag>();

            String query = "select web_programm.pname, web_programm.path, 'x' as x, web_programm.i_typ_name, "
                         + "web_programm.i_typ_name, web_daten.did, web_daten.typ_tname, web_daten.data from web_AA "
                         + "join web_programm on (web_AA.programm_pname = web_programm.pname) "
                         + "join web_daten on (web_daten.did = web_AA.daten_did);";

            OdbcCommand command = new OdbcCommand(query, con);
            OdbcDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {

                Typ in_typ = null;
                if (!reader.IsDBNull(3))
                    in_typ = new Typ(reader.GetString(4));

                Typ out_typ = null;
                if (!reader.IsDBNull(4))
                    out_typ = new Typ(reader.GetString(4));

                Program p = new Program();
                p.Name = reader.GetString(0);
                p.Path = reader.GetString(1);
                p.OutputTyp = out_typ;
                p.InputTyp = in_typ;

                arbeitsauftraege.Add(
                    new ArbeitsAuftrag(
                        p,
                        new Uebergabedaten(
                            reader.GetInt32(5),
                            new Typ(reader.GetString(6)),
                            reader.GetString(7)
                        )
                    )
                );
            }

            return arbeitsauftraege;
        }
예제 #7
0
        public List<Program> GetProgramsOfType(Typ t)
        {
            List<Program> programme = new List<Program>();

            String query = @"select pname, path, 'x' as x, i_typ_name, o_typ_name from web_programm where i_typ_name = ?";

            OdbcCommand command = new OdbcCommand(query, con);
            command.Parameters.Add("i_typ_name", OdbcType.VarChar, 50, "i_typ_name");
            command.Parameters["i_typ_name"].Value = t.Name;

            OdbcDataReader reader = command.ExecuteReader();

            while (reader.Read())
            {
                Program p = new Program();
                p.Name = reader.GetString(0);
                p.Path = reader.GetString(2);

                Typ out_typ = null;
                if (!reader.IsDBNull(4))
                    out_typ = new Typ(reader.GetString(4));

                Typ in_typ = null;
                if (!reader.IsDBNull(3))
                    in_typ = new Typ(reader.GetString(3));

                p.OutputTyp = out_typ;
                p.InputTyp = in_typ;

                programme.Add(p);
            }

            return programme;
        }