/// <summary> /// Sets the reader to object. /// </summary> /// <param name="objClass">The object class.</param> /// <param name="result">The result.</param> private void SetReaderToObject(ref Class objClass, ref SqlDataReader result) { if (result.HasRows) { objClass.ClassID = (int)result.GetValue(result.GetOrdinal("ClassID")); objClass.IsPrestige = (bool)result.GetValue(result.GetOrdinal("IsPrestige")); objClass.ClassName = result.GetValue(result.GetOrdinal("ClassName")).ToString(); objClass.HitDieType = (int)result.GetValue(result.GetOrdinal("HitDieType")); objClass.StartingSkillNumber = (int)result.GetValue(result.GetOrdinal("StartingSkillNumber")); if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("StartingSkills")).ToString())) { objClass.StartingSkills = (int)result.GetValue(result.GetOrdinal("StartingSkills")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("StartCreditDie")).ToString())) { objClass.StartCreditDie = (int)result.GetValue(result.GetOrdinal("StartCreditDie")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("StartCreditDieNumber")).ToString())) { objClass.StartCreditDieNumber = (int)result.GetValue(result.GetOrdinal("StartCreditDieNumber")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("StartCreditDieModifier")).ToString())) { objClass.StartCreditDieModifier = (int)result.GetValue(result.GetOrdinal("StartCreditDieModifier")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("PrestigeRequiredTalents")).ToString())) { objClass.PrestigeRequiredTalents = (int)result.GetValue(result.GetOrdinal("PrestigeRequiredTalents")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("PrestigeRequiredForceTech")).ToString())) { objClass.PrestigeRequiredForceTech = (bool)result.GetValue(result.GetOrdinal("PrestigeRequiredForceTech")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("PrestigeRequiredDarkside")).ToString())) { objClass.PrestigeRequiredDarkside = (bool)result.GetValue(result.GetOrdinal("PrestigeRequiredDarkside")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("PrestigeRequiredFeats")).ToString())) { objClass.PrestigeRequiredFeats = (int)result.GetValue(result.GetOrdinal("PrestigeRequiredFeats")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("PrestigeRequiredBaseAttack")).ToString())) { objClass.PrestigeRequiredBaseAttack = (int)result.GetValue(result.GetOrdinal("PrestigeRequiredBaseAttack")); } if (!string.IsNullOrEmpty(result.GetValue(result.GetOrdinal("PrestigeRequiredLevel")).ToString())) { objClass.PrestigeRequiredLevel = (int)result.GetValue(result.GetOrdinal("PrestigeRequiredLevel")); } objClass._objComboBoxData.Clear(); objClass._objComboBoxData.Add(objClass.ClassID, objClass.ClassName); } if (objClass.IsPrestige) { Feat objFeat = new Feat();; ClassDefenseType objClassDefenseTypes = new ClassDefenseType(); PrestigeRequirement objPrestigeRequirement = new PrestigeRequirement(); TalentTree objTalentTree = new TalentTree(); Talent objTalent = new Talent(); ForcePower objForcePower = new ForcePower(); Skill objSkill = new Skill(); Race objRace = new Race(); objClass.StartingFeats = objFeat.GetStartingFeats(" ClassID=" + objClass.ClassID.ToString(), "FeatName"); objClass.objClassDefenseTypes = objClassDefenseTypes.GetClassDefenseTypes(" ClassID=" + objClass.ClassID.ToString(), ""); objClass.objPrestigeRequirement = objPrestigeRequirement.GetPrestigeRequirementPrestigeClass(" ClassID=" + objClass.ClassID.ToString(), "PrestigeRequirementDescription"); objClass.objPrestigeRequiredTalentTree = objTalentTree.GetTalentTreesPrestigeClass("ClassID=" + objClass.ClassID.ToString(), "TalentTreeName"); objClass.objPrestigeRequiredTalents = objTalent.GetPrestigeRequiredTalents("ClassID=" + objClass.ClassID.ToString(), "TalentName"); objClass.objPrestigeRequiredFeats = objFeat.GetPrestigeRequiredFeats(" ClassID=" + objClass.ClassID.ToString(), "FeatName"); objClass.objPrestigeRequiredFeatGroup = objFeat.GetPrestigeRequiredFeatGroups(" ClassID=" + objClass.ClassID.ToString(), "FeatName"); objClass.objPrestigeRequiredForcePowers = objForcePower.GetPrestigeRequiredForcePowers(" ClassID=" + objClass.ClassID.ToString(), "ForcePowerName"); objClass.objPrestigeRequiredSkills = objSkill.GetPrestigeRequiredSkills(" ClassID=" + objClass.ClassID.ToString(), "SkillName"); objClass.objPrestigeRequiredRaces = objRace.GetRaceRequirementForClass(" mtmPrestigeRequirementClassRace.ClassID=" + objClass.ClassID.ToString(), "RaceName"); } }