/// <summary> /// Sets the reader to the Paramter Ability object . /// </summary> /// <param name="objArmor">The object armor.</param> /// <param name="result">The result.</param> private void SetReaderToObject(ref Armor objArmor, ref SqlDataReader result) { if (result.HasRows) { objArmor.ArmorID = (int)result.GetValue(result.GetOrdinal("ArmorID")); objArmor.ArmorTypeID = (int)result.GetValue(result.GetOrdinal("ArmorTypeID")); objArmor.ArmorName = result.GetValue(result.GetOrdinal("ArmorName")).ToString(); objArmor.ArmorDescription = result.GetValue(result.GetOrdinal("ArmorDescription")).ToString(); objArmor.ReflexAdjustment = (int)result.GetValue(result.GetOrdinal("ReflexAdjustment")); objArmor.FortitudeAdjustment = (int)result.GetValue(result.GetOrdinal("FortitudeAdjustment")); objArmor.EmplacementPoints = (int)result.GetValue(result.GetOrdinal("EmplacementPoints")); objArmor.Cost = (int)result.GetValue(result.GetOrdinal("Cost")); objArmor.Weight = (decimal)result.GetValue(result.GetOrdinal("Weight")); objArmor.MaxDefBonus = (int)result.GetValue(result.GetOrdinal("MaxDefBonus")); objArmor.BookID = (int)result.GetValue(result.GetOrdinal("BookID")); objArmor.ArmorProficiencyFeatID = (int)result.GetValue(result.GetOrdinal("ArmorProficiencyFeatID")); ArmorType objArmorType = new ArmorType(); if (!(objArmor.ArmorTypeID == 0)) { objArmorType.GetArmorType(objArmor.ArmorTypeID); } objArmor.objArmorType = objArmorType; ItemAvailabilityType objAA = new ItemAvailabilityType(); objArmor.lstArmorAvailability = objAA.GetArmorAvailabilityTypes(objArmor.ArmorID); objArmor.objArmorProfFeat = new Feat(objArmor.ArmorProficiencyFeatID); objArmor.objBook = new Book(objArmor.BookID); objArmor._objComboBoxData.Add(objArmor.ArmorID, objArmor.ArmorName); } }
/// <summary> /// Clones the specified object ArmorType. /// </summary> /// <param name="objArmorType">The object ArmorType.</param> /// <returns>ArmorType</returns> static public ArmorType Clone(ArmorType objArmorType) { ArmorType objCArmorType = new ArmorType(); if (objArmorType.ArmorTypeID != 0) { objCArmorType.GetArmorType(objArmorType.ArmorTypeID); } else { objCArmorType.ArmorTypeID = 0; objCArmorType.ArmorTypeName = objArmorType.ArmorTypeName; objCArmorType.ArmorCheckPenalty = objArmorType.ArmorCheckPenalty; objCArmorType.Speed_6 = objArmorType.Speed_6; objCArmorType.Speed_4 = objArmorType.Speed_4; objCArmorType.Speed_8 = objArmorType.Speed_8; } return(objCArmorType); }