private void LoadTreeView() { tvWeaponList.Nodes.Clear(); List <WeaponType> lstWeaponType = new List <WeaponType>(); WeaponType objWeaponType = new WeaponType(); List <Weapon> lstWeapons = new List <Weapon>(); Weapon objWeapon = new Weapon(); if (!ckbHideNonProficientWeapons.Enabled) { lstWeaponType = objWeaponType.GetWeaponTypes("", "WeaponTypeName"); } else if (ckbHideNonProficientWeapons.Checked) { //Hide Non Proficent Weapons lstWeaponType = objWeaponType.GetCharacterProficientWeaponTypes(objCharacter.CharacterID); } else { //Show All Weapons lstWeaponType = objWeaponType.GetWeaponTypes("", "WeaponTypeName"); } foreach (WeaponType objListWeaponType in lstWeaponType) { lstWeapons = objWeapon.GetWeaponsByWeaponTypeID(objListWeaponType.WeaponTypeID); TreeNode objWTTN = new TreeNode(); objWTTN.Text = objListWeaponType.WeaponTypeName; objWTTN.Tag = objListWeaponType.WeaponTypeID; foreach (Weapon objListWeapon in lstWeapons) { TreeNode objTN = new TreeNode(); objTN.Text = objListWeapon.WeaponName; objTN.Tag = objListWeapon.WeaponID; objWTTN.Nodes.Add(objTN); } tvWeaponList.Nodes.Add(objWTTN); } }
public void Test_GetWeaponTypes_WithOutOrderBy_NoResult() { string strWhere = "WeaponTypeDescription Like '%Toad%'"; string strOrderBy = ""; WeaponType objWeaponType = new WeaponType(); List <WeaponType> lstWeaponTypes = new List <WeaponType>(); lstWeaponTypes = objWeaponType.GetWeaponTypes(strWhere, strOrderBy); Assert.IsTrue(lstWeaponTypes.Count == 0); }