/// <summary> /// Sets the reader to object. /// </summary> /// <param name="objClassLevel">The object class level.</param> /// <param name="result">The result.</param> private void SetReaderToObject(ref ClassLevelInfo objClassLevel, ref SqlDataReader result) { if (result.HasRows) { objClassLevel.ClassLevelID = (int)result.GetValue(result.GetOrdinal("ClassLevelID")); objClassLevel.BonusFeat = (int)result.GetValue(result.GetOrdinal("BonusFeat")); objClassLevel.Talent = (int)result.GetValue(result.GetOrdinal("Talent")); objClassLevel.ClassID = (int)result.GetValue(result.GetOrdinal("ClassID")); objClassLevel.BaseAttack = (int)result.GetValue(result.GetOrdinal("BaseAttack")); objClassLevel.ClassLevel = (int)result.GetValue(result.GetOrdinal("ClassLevel")); objClassLevel.ForcePointBase = (int)result.GetValue(result.GetOrdinal("ForcePointBase")); //objClassLevel.ExtraClassLevelItemID = (int)result.GetValue(result.GetOrdinal("ExtraClassLevelItem")); //objClassLevel.PrestigeClassSkillID = (int)result.GetValue(result.GetOrdinal("PrestigeClassSkillID")); //objClassLevel.PrestigeClassSkillModifier = (int)result.GetValue(result.GetOrdinal("PrestigeClassSkillModifier")); objClassLevel.ForceTechnique = (int)result.GetValue(result.GetOrdinal("ForceTechnique")); objClassLevel.ForceSecret = (int)result.GetValue(result.GetOrdinal("ForceSecret")); objClassLevel.MedicalSecret = (int)result.GetValue(result.GetOrdinal("MedicalSecret")); Class objClass = new Class(); if (!(objClassLevel.ClassID == 0)) { objClass.GetClass(objClassLevel.ClassID); } objClassLevel.Class = objClass; } }
/// <summary> /// Clones the specified LST ClassLevelInfo. /// </summary> /// <param name="lstClassLevelInfo">The LST ClassLevelInfo.</param> /// <returns>List<ClassLevelInfo></returns> static public List <ClassLevelInfo> Clone(List <ClassLevelInfo> lstClassLevelInfo) { List <ClassLevelInfo> lstCClassLevelInfo = new List <ClassLevelInfo>(); foreach (ClassLevelInfo objClassLevelInfo in lstClassLevelInfo) { lstCClassLevelInfo.Add(ClassLevelInfo.Clone(objClassLevelInfo)); } return(lstCClassLevelInfo); }
/// <summary> /// Determines whether [is class in list] [the specified object class level information]. /// </summary> /// <param name="objClassLevelInfo">The object class level information.</param> /// <param name="lstClassLevelInfo">The LST class level information.</param> /// <returns>Boolean</returns> static public bool IsClassInList(ClassLevelInfo objClassLevelInfo, List <ClassLevelInfo> lstClassLevelInfo) { bool blnClassFound = false; foreach (ClassLevelInfo lstObjClassLevelInfo in lstClassLevelInfo) { if ((objClassLevelInfo.ClassID == lstObjClassLevelInfo.ClassID) && (objClassLevelInfo.ClassLevel == lstObjClassLevelInfo.ClassLevel)) { blnClassFound = true; } } return(blnClassFound); }
/// <summary> /// Sets the reader to object. /// </summary> /// <param name="obCharacterClassLevel">The ob character class level.</param> /// <param name="result">The result.</param> private void SetReaderToObject(ref CharacterClassLevel obCharacterClassLevel, ref SqlDataReader result) { if (result.HasRows) { obCharacterClassLevel.CharacterID = (int)result.GetValue(result.GetOrdinal("CharacterID")); obCharacterClassLevel.ClassID = (int)result.GetValue(result.GetOrdinal("ClassID")); obCharacterClassLevel.ClassLevel = (int)result.GetValue(result.GetOrdinal("ClassLevel")); Class objClass = new Class(); obCharacterClassLevel.objCharacterClass = objClass.GetClass(obCharacterClassLevel.ClassID); ClassLevelInfo objClassLevel = new ClassLevelInfo(); obCharacterClassLevel.objCharacterClassLevelInfo = objClassLevel.GetClassLevels("ClassID=" + obCharacterClassLevel.ClassID.ToString() + " AND ClassLevel <=" + obCharacterClassLevel.ClassLevel.ToString(), ""); } }
/// <summary> /// Gets the class level information list. /// </summary> /// <param name="strSprocName">Name of the string sproc.</param> /// <param name="strWhere">The string where.</param> /// <param name="strOrderBy">The string order by.</param> /// <returns>List of ClassLevelInfo Objects</returns> private List <ClassLevelInfo> GetClassLevelInfoList(string strSprocName, string strWhere, string strOrderBy) { List <ClassLevelInfo> classLevelInfos = new List <ClassLevelInfo>(); SqlDataReader result; DatabaseConnection dbconn = new DatabaseConnection(); SqlCommand command = new SqlCommand(); SqlConnection connection = new SqlConnection(dbconn.SQLSEVERConnString); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.StoredProcedure; command.CommandText = strSprocName; command.Parameters.Add(dbconn.GenerateParameterObj("@strWhere", SqlDbType.VarChar, strWhere, 1000)); command.Parameters.Add(dbconn.GenerateParameterObj("@strOrderBy", SqlDbType.VarChar, strOrderBy, 1000)); result = command.ExecuteReader(); while (result.Read()) { ClassLevelInfo objClassLevelInfo = new ClassLevelInfo(); SetReaderToObject(ref objClassLevelInfo, ref result); classLevelInfos.Add(objClassLevelInfo); } } catch { Exception e = new Exception(); throw e; } finally { command.Dispose(); connection.Close(); } return(classLevelInfos); }
/// <summary> /// Clones the specified object ClassLevelInfo. /// </summary> /// <param name="objClassLevelInfo">The object ClassLevelInfo.</param> /// <returns>ClassLevelInfo</returns> static public ClassLevelInfo Clone(ClassLevelInfo objClassLevelInfo) { ClassLevelInfo objCClassLevelInfo = new ClassLevelInfo(objClassLevelInfo.ClassID, objClassLevelInfo.ClassLevelID); return(objCClassLevelInfo); }