Exemple #1
0
        /// <summary>
        /// Clones the specified LST RaceLanguage.
        /// </summary>
        /// <param name="lstRaceLanguage">The LST RaceLanguage.</param>
        /// <returns>List<RaceLanguage></returns>
        static public List <RaceLanguage> Clone(List <RaceLanguage> lstRaceLanguage)
        {
            List <RaceLanguage> lstCRaceLanguage = new List <RaceLanguage>();

            foreach (RaceLanguage objRaceLanguage in lstRaceLanguage)
            {
                lstCRaceLanguage.Add(RaceLanguage.Clone(objRaceLanguage));
            }

            return(lstCRaceLanguage);
        }
Exemple #2
0
        private void SetReaderToObject(ref RaceLanguage objRaceLanguage, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objRaceLanguage.RaceID         = (int)result.GetValue(result.GetOrdinal("RaceID"));
                objRaceLanguage.LanguageID     = (int)result.GetValue(result.GetOrdinal("LanguageID"));
                objRaceLanguage.UnderstandOnly = (bool)result.GetValue(result.GetOrdinal("UnderstandOnly"));
                objRaceLanguage.SpeakOnly      = (bool)result.GetValue(result.GetOrdinal("SpeakOnly"));

                Language objLang = new Language(objRaceLanguage.LanguageID);
                objRaceLanguage.objLanguage = objLang;
            }
        }
Exemple #3
0
        private List <RaceLanguage> GetRaceLanguageList(string strSprocName, string strWhere, string strOrderBy)
        {
            List <RaceLanguage> RaceLanguages = new List <RaceLanguage>();

            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())
                {
                    RaceLanguage objRaceLanguage = new RaceLanguage();
                    SetReaderToObject(ref objRaceLanguage, ref result);
                    RaceLanguages.Add(objRaceLanguage);
                }
            }
            catch
            {
                Exception e = new Exception();
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(RaceLanguages);
        }
Exemple #4
0
        /// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="objRace">The object race.</param>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref Race objRace, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                try
                {
                    objRace.RaceID           = (int)result.GetValue(result.GetOrdinal("RaceID"));
                    objRace.RaceName         = result.GetValue(result.GetOrdinal("RaceName")).ToString();
                    objRace.RaceDescription  = result.GetValue(result.GetOrdinal("RaceDescription")).ToString();
                    objRace.OtherDescription = result.GetValue(result.GetOrdinal("OtherDescription")).ToString();
                    objRace.Sex               = result.GetValue(result.GetOrdinal("Sex")).ToString();
                    objRace.RageAbility       = (bool)result.GetValue(result.GetOrdinal("RageAbility"));
                    objRace.ShapeShiftAbility = (bool)result.GetValue(result.GetOrdinal("ShapeShiftAbility"));
                    objRace.Primitive         = (bool)result.GetValue(result.GetOrdinal("Primitive"));
                    objRace.BonusFeat         = (bool)result.GetValue(result.GetOrdinal("BonusFeat"));
                    objRace.BonusSkill        = (bool)result.GetValue(result.GetOrdinal("BonusSkill"));
                    objRace.AverageHeight     = (decimal)result.GetValue(result.GetOrdinal("AverageHeight"));
                    objRace.AverageWeight     = (decimal)result.GetValue(result.GetOrdinal("AverageWeight"));
                    objRace.SizeID            = (int)result.GetValue(result.GetOrdinal("SizeID"));
                    objRace.SpeedID           = (int)result.GetValue(result.GetOrdinal("SpeedID"));

                    List <RaceAbilityModifier> objRaceAbilityModifiers = new List <RaceAbilityModifier>();
                    RaceAbilityModifier        objRaceAbilityModifier  = new RaceAbilityModifier();
                    Speed objSpeed = new Speed();

                    if (!(objRace.RaceID == 0))
                    {
                        objRaceAbilityModifiers = objRaceAbilityModifier.GetRaceAbilityModifiers(" RaceID=" + objRace.RaceID.ToString(), "");
                    }
                    objRace.objRaceAbilityModifiers = objRaceAbilityModifiers;

                    List <Skill> objRaceSkills = new List <Skill>();
                    Skill        objSkill      = new Skill();
                    if (!(objRace.RaceID == 0))
                    {
                        objRaceSkills = objSkill.GetSkillsForRace(" RaceID=" + objRace.RaceID.ToString(), "");
                    }
                    objRace.lstRaceSkills = objRaceSkills;


                    List <Speed> objSpeeds = new List <Speed>();
                    if (!(objRace.SpeedID == 0))
                    {
                        objSpeeds = objSpeed.GetRaceSpeeds(objRace.RaceID);
                    }
                    objRace.objSpeeds = objSpeeds;


                    RaceDefenseTypeModifier objRaceDefenseTypeModifier = new RaceDefenseTypeModifier();
                    lstRaceDefenseTypeModifier = objRaceDefenseTypeModifier.GetRaceDefenseTypeModifiersByRace(objRace.RaceID, "");

                    RaceFeatConditionalFeat objRaceFeatConditionalFeat = new RaceFeatConditionalFeat();
                    lstConditionalFeatsByFeat = objRaceFeatConditionalFeat.GetRaceFeatConditionalFeatsByRaceID(objRace.RaceID);

                    RaceSkillConditionalFeat objRaceSkillConditionalFeat = new RaceSkillConditionalFeat();
                    lstConditionalFeatsBySkill = objRaceSkillConditionalFeat.GetRaceSkillConditionalFeatsByRaceID(objRace.RaceID);

                    Language objLanguage = new Language();
                    lstLanguages = objLanguage.GetRaceLanguages(objRace.RaceID, "");

                    RaceLanguage objRaceLang = new RaceLanguage();
                    lstRaceLanguages = objRaceLang.GetRaceLanguages("RaceID=" + objRace.RaceID.ToString(), "");

                    RaceSpecialAbility objRSA = new RaceSpecialAbility();
                    lstRaceSpecialAbilities = objRSA.GetRaceSpecialAbilitysByRace(objRace.RaceID);

                    objRace._objComboBoxData.Add(objRace.RaceID, objRace.RaceName);
                }
                catch
                {
                    Exception e = new Exception();
                    throw e;
                }
            }
        }
Exemple #5
0
        /// <summary>
        /// Clones the specified object RaceLanguage.
        /// </summary>
        /// <param name="objRaceLanguage">The object RaceLanguage.</param>
        /// <returns>RaceLanguage</returns>
        static public RaceLanguage Clone(RaceLanguage objRaceLanguage)
        {
            RaceLanguage objCRaceLanguage = new RaceLanguage(objRaceLanguage.RaceID, objRaceLanguage.LanguageID);

            return(objCRaceLanguage);
        }