/// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="objTalentTreeRequirement">The object talent tree requirement.</param>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref TalentTreeRequirement objTalentTreeRequirement, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objTalentTreeRequirement.TalentTreeRequirementID          = (int)result.GetValue(result.GetOrdinal("TalentTreeRequirementID"));
                objTalentTreeRequirement.TalentTreeRequirementDescription = result.GetValue(result.GetOrdinal("TalentTreeRequirementDescription")).ToString();

                objTalentTreeRequirement._objComboBoxData.Add(objTalentTreeRequirement.TalentTreeRequirementID, objTalentTreeRequirement.TalentTreeRequirementDescription);
            }
        }
        /// <summary>
        /// Clones the specified LST TalentTreeRequirement.
        /// </summary>
        /// <param name="lstTalentTreeRequirement">The LST TalentTreeRequirement.</param>
        /// <returns>List<TalentTreeRequirement></returns>
        static public List <TalentTreeRequirement> Clone(List <TalentTreeRequirement> lstTalentTreeRequirement)
        {
            List <TalentTreeRequirement> lstCTalentTreeRequirement = new List <TalentTreeRequirement>();

            foreach (TalentTreeRequirement objTalentTreeRequirement in lstTalentTreeRequirement)
            {
                lstCTalentTreeRequirement.Add(TalentTreeRequirement.Clone(objTalentTreeRequirement));
            }

            return(lstCTalentTreeRequirement);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="objTalentTree">The object talent tree.</param>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref TalentTree objTalentTree, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objTalentTree.TalentTreeID   = (int)result.GetValue(result.GetOrdinal("TalentTreeID"));
                objTalentTree.ForceTalent    = (bool)result.GetValue(result.GetOrdinal("ForceTalent"));
                objTalentTree.TalentTreeName = result.GetValue(result.GetOrdinal("TalentTreeName")).ToString();

                Talent objTalent = new Talent();
                Race   objRace   = new Race();
                TalentTreeRequirement objTalentTreeRequirement = new TalentTreeRequirement();

                objTalentTree.objTalentTreeTalents = objTalent.GetTreeTalents("otmTalentTreeTalent.TalentTreeID=" + objTalentTree.TalentTreeID.ToString(), "");

                objTalentTree.objTalentTreeRaceRequirement = objRace.GetRaceRequirementForTalentTree("TalentTreeID=" + objTalentTree.TalentTreeID.ToString(), " RaceName");

                objTalentTree.objTalentTreeRequirement = objTalentTreeRequirement.GetTalentTreeTalentTreeRequirements("TalentTreeID=" + objTalentTree.TalentTreeID.ToString(), " TalentTreeRequirementDescription ");

                objTalentTree._objComboBoxData.Add(objTalentTree.TalentTreeID, objTalentTree.TalentTreeName);
            }
        }
        /// <summary>
        /// Gets the talent tree requirement 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 TalentTreeRequirement objects</returns>
        private List <TalentTreeRequirement> GetTalentTreeRequirementList(string strSprocName, string strWhere, string strOrderBy)
        {
            List <TalentTreeRequirement> talentTreeRequirements = new List <TalentTreeRequirement>();

            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())
                {
                    TalentTreeRequirement objTalentTreeRequirement = new TalentTreeRequirement();
                    SetReaderToObject(ref objTalentTreeRequirement, ref result);
                    talentTreeRequirements.Add(objTalentTreeRequirement);
                }
            }
            catch
            {
                Exception e = new Exception();
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(talentTreeRequirements);
        }
        /// <summary>
        /// Clones the specified object TalentTreeRequirement.
        /// </summary>
        /// <param name="objTalentTreeRequirement">The object TalentTreeRequirement.</param>
        /// <returns>TalentTreeRequirement</returns>
        static public TalentTreeRequirement Clone(TalentTreeRequirement objTalentTreeRequirement)
        {
            TalentTreeRequirement objCTalentTreeRequirement = new TalentTreeRequirement(objTalentTreeRequirement.TalentTreeRequirementID);

            return(objCTalentTreeRequirement);
        }