/// <summary> /// Sets the reader to object. /// </summary> /// <param name="objForcePower">The object force power.</param> /// <param name="result">The result.</param> private void SetReaderToObject(ref ForcePower objForcePower, ref SqlDataReader result) { if (result.HasRows) { objForcePower.ForcePowerID = (int)result.GetValue(result.GetOrdinal("ForcePowerID")); objForcePower.ForcePowerName = result.GetValue(result.GetOrdinal("ForcePowerName")).ToString(); objForcePower.ForcePowerDescription = result.GetValue(result.GetOrdinal("ForcePowerDescription")).ToString(); //objForcePower.ForcePowerDescriptorID = (int)result.GetValue(result.GetOrdinal("ForcePowerDescriptorID")); objForcePower.TurnSegmentID = (int)result.GetValue(result.GetOrdinal("TurnSegmentID")); objForcePower.ForcePowerTarget = result.GetValue(result.GetOrdinal("ForcePowerTarget")).ToString(); objForcePower.ForcePowerSpecial = result.GetValue(result.GetOrdinal("ForcePowerSpecial")).ToString(); ForcePowerDescriptor FPD = new ForcePowerDescriptor(); objForcePower.objForcePowerDescriptors = FPD.GetForcePowerForcePowerDescriptors(" ForcePowerID=" + objForcePower.ForcePowerID.ToString(), " ForcePowerDescriptorName "); if (objForcePower.TurnSegmentID != 0) { TurnSegment TS = new TurnSegment(); objForcePower.objTurnSegment = TS.GetTurnSegment(objForcePower.TurnSegmentID); } objForcePower._objComboBoxData.Add(objForcePower.ForcePowerID, objForcePower.ForcePowerName); } }
/// <summary> /// Sets the reader to object. /// </summary> /// <param name="objTurnSegment">The object turn segment.</param> /// <param name="result">The result.</param> private void SetReaderToObject(ref TurnSegment objTurnSegment, ref SqlDataReader result) { if (result.HasRows) { objTurnSegment.TurnSegmentID = (int)result.GetValue(result.GetOrdinal("TurnSegmentID")); objTurnSegment.TurnSegmentName = result.GetValue(result.GetOrdinal("TurnSegmentName")).ToString(); objTurnSegment.TurnSegmentDescription = result.GetValue(result.GetOrdinal("TurnSegmentDescription")).ToString(); objTurnSegment._objComboBoxData.Add(objTurnSegment.TurnSegmentID, objTurnSegment.TurnSegmentName); } }
/// <summary> /// Clones the specified LST TurnSegment. /// </summary> /// <param name="lstTurnSegment">The LST TurnSegment.</param> /// <returns>List<TurnSegment></returns> static public List <TurnSegment> Clone(List <TurnSegment> lstTurnSegment) { List <TurnSegment> lstCTurnSegment = new List <TurnSegment>(); foreach (TurnSegment objTurnSegment in lstTurnSegment) { lstCTurnSegment.Add(TurnSegment.Clone(objTurnSegment)); } return(lstCTurnSegment); }
/// <summary> /// Sets the reader to object. /// </summary> /// <param name="result">The result.</param> private void SetReaderToObject(ref SqlDataReader result) { if (result.HasRows) { this.TalentID = (int)result.GetValue(result.GetOrdinal("TalentID")); this.TalentName = result.GetValue(result.GetOrdinal("TalentName")).ToString(); this.TalentDescription = result.GetValue(result.GetOrdinal("TalentDescription")).ToString(); this.TalentTreeID = (int)result.GetValue(result.GetOrdinal("TalentTreeID")); this.MultipleSelection = (int)result.GetValue(result.GetOrdinal("MultipleSelection")); this.BookID = (int)result.GetValue(result.GetOrdinal("BookID")); this.TalentSpecial = result.GetValue(result.GetOrdinal("TalentSpecial")).ToString(); this._objComboBoxData.Add(this.TalentID, this.TalentName); TurnSegment objTurnSegment = new TurnSegment(); if (!(this.TurnSegmentID == 0)) { objTurnSegment.GetTurnSegment(this.TurnSegmentID); } this.objTurnSegment = objTurnSegment; Talent objPreTalent = new Talent(); this.objPrerequsiteTalent = objPreTalent.GetPrerequisteTalents(" otmTalentPrerequisteTalent.TalentID=" + this.TalentID.ToString(), "TalentName"); //List<Ability> objPrerequisteAbility TalentPrerequisteAbility objTalentPrerequisteAbility = new TalentPrerequisteAbility(); this.objTalentPrerequisteAbility = objTalentPrerequisteAbility.GetTalentPrerequisteAbilities("TalentID=" + this.TalentID.ToString(), ""); Skill objSkill = new Skill(); this.objTalentPrerequsiteSkill = objSkill.GetTalentRequiredSkills("TalentID=" + this.TalentID.ToString(), ""); Feat objFeat = new Feat(); this.objTalentPrerequsiteFeat = objFeat.GetTalentPrerequisiteFeats("TalentID=" + this.TalentID.ToString(), ""); ForcePower objPreForcePower = new ForcePower(); this.objTalentPrerequisteForcePower = objPreForcePower.GetTalentPrequisteForcePowers("TalentID=" + this.TalentID.ToString(), ""); BaseAttack objBaseAttack = new BaseAttack(); this.objBaseAttackPrerequisite = objBaseAttack.GetFeatPrequisiteBaseAttackBonus(this.TalentID); } }
/// <summary> /// Gets the turn segment 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 TurnSegment objects</returns> private List <TurnSegment> GetTurnSegmentList(string strSprocName, string strWhere, string strOrderBy) { List <TurnSegment> turnSegments = new List <TurnSegment>(); 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()) { TurnSegment objTurnSegment = new TurnSegment(); SetReaderToObject(ref objTurnSegment, ref result); turnSegments.Add(objTurnSegment); } } catch { Exception e = new Exception(); throw e; } finally { command.Dispose(); connection.Close(); } return(turnSegments); }
/// <summary> /// Clones the specified object TurnSegment. /// </summary> /// <param name="objTurnSegment">The object TurnSegment.</param> /// <returns>TurnSegment</returns> static public TurnSegment Clone(TurnSegment objTurnSegment) { TurnSegment objCTurnSegment = new TurnSegment(objTurnSegment.TurnSegmentID); return(objCTurnSegment); }