/// <summary> /// returns a list of Knowledge objects that contains the db "programs" /// </summary> public static List <Knowledge> RetKnowledgeList() { DataTable knowledgeTable = KnowledgeDB.GetProgramsTable(); List <Knowledge> knowledgeList = new List <Knowledge>(); if (knowledgeTable == null) { return(null); } foreach (DataRow row in knowledgeTable.Rows) { Knowledge obj = new Knowledge((int)row["ProgramID"], (string)row["PName"].ToString(), (string)row["ProgPath"].ToString()); knowledgeList.Add(obj); } return(knowledgeList); }
/// <summary> /// no. 1 constructor that takes id, user id and profession to create the object. /// </summary> public ProjectPos(int id, int userID, int profession) { this.id = id; this.profession = new Profession(profession); this.userID = userID; DataTable programsTable = ProjectDB.GetProgramsAtPosition(id); if (programsTable != null) { List <Knowledge> Programs = new List <Knowledge>(); foreach (DataRow row in programsTable.Rows) { Knowledge program = new Knowledge(); program.ProgPath = (string)row["ProgPath"]; Programs.Add(program); } this.Programs = Programs; } }