protected void LoadControls() { sp_Skill_BLL SkillBLL = new sp_Skill_BLL(); rTreeViewSkills.DataTextField = "SkillName"; rTreeViewSkills.DataFieldID = "SkillID"; rTreeViewSkills.DataFieldParentID = "MstrSkillID"; rTreeViewSkills.DataSource = SkillBLL.ListSkills(false); rTreeViewSkills.DataBind(); rTreeViewSkills.ExpandAllNodes(); rLBUnslottedSkills.DataSource = SkillBLL.ListSkills(true); rLBUnslottedSkills.DataBind(); }
public void testListSkills() { string[] fnames = { "Volunteer.xlsx", "Group.xlsx", "GroupVol.xlsx", "VolAddress.xlsx", "VolAddr.xlsx", "Skill.xlsx", "VolSkill.xlsx", "VolState.xlsx", "VolEmail.xlsx", "VolPhone.xlsx"}; cExcel.RemoveAllData(); cExcel.InsertData(fnames); string directory = cExcel.GetHelperFilesDir(); sp_Skill_BLL skillBLL = new sp_Skill_BLL(); string hdir = cExcel.GetHelperFilesDir(); string query = "SELECT * FROM [Sheet1$]"; DataTable dt = cExcel.QueryExcelFile(hdir + "Skill.xlsx", query); foreach (sp_Skill_DM skill in skillBLL.ListSkills()) { var selectedRow = dt.Select(string.Format("SkillID = '{0}'", skill.SkillID)); Assert.AreEqual(selectedRow.Length, 1); Assert.AreEqual(selectedRow[0]["SkillName"], skill.SkillName); var tmp = skill.MstrSkillID == null ? (object)"" : skill.MstrSkillID.Value.ToString(); Assert.AreEqual(tmp, selectedRow[0]["MStrSkillID"].ToString().ToLower()); System.Console.WriteLine(skill.ActiveFlg); Assert.AreEqual(skill.ActiveFlg, Convert.ToInt32(selectedRow[0]["ActiveFlg"])); } cExcel.RemoveData(fnames); }