/// <summary> /// the method builds a list of userKnowLedge object's by an id of a user given to it. /// * the method return the list after it has filled it by all matching skills in the db /// </summary> public static List <UserKnowledge> GetUserKnowledgeBL(int id) { try { List <UserKnowledge> SkillList = new List <UserKnowledge>(); DataTable SkillTable = UserKnowledgeDB.GetUserKnowledge(id); foreach (DataRow USskill in SkillTable.Rows) { UserKnowledge UserKnow = new UserKnowledge((int)USskill["PKID"], (int)USskill["ProgramID"], (string)USskill["PName"].ToString(), (string)USskill["ProgPath"].ToString()); SkillList.Add(UserKnow); } return(SkillList); } catch (Exception e) { Console.WriteLine(e.ToString()); return(null); } }
/// <summary> /// the function gets an ID and a list of chosen Knowledges/skills /// and inserts the knowledges to the user /// on ProgKnowledge database table. /// </summary> public static int KnowledgeInsert(int userid, List <int> userKnowledgeList) { return(UserKnowledgeDB.InsertUserKnowledge(userid, userKnowledgeList)); }