Ejemplo n.º 1
0
        /// <summary>
        /// Clones the specified LST SizeSkillModifier.
        /// </summary>
        /// <param name="lstSizeSkillModifier">The LST SizeSkillModifier.</param>
        /// <returns>List<SizeSkillModifier></returns>
        static public List <SizeSkillModifier> Clone(List <SizeSkillModifier> lstSizeSkillModifier)
        {
            List <SizeSkillModifier> lstCSizeSkillModifier = new List <SizeSkillModifier>();

            foreach (SizeSkillModifier objSizeSkillModifier in lstSizeSkillModifier)
            {
                lstCSizeSkillModifier.Add(SizeSkillModifier.Clone(objSizeSkillModifier));
            }

            return(lstCSizeSkillModifier);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="objSizeSkillModifier">The object size skill modifier.</param>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref SizeSkillModifier objSizeSkillModifier, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objSizeSkillModifier.SizeID     = (int)result.GetValue(result.GetOrdinal("SizeID"));
                objSizeSkillModifier.SkillID    = (int)result.GetValue(result.GetOrdinal("SkillID"));
                objSizeSkillModifier.ModifierID = (int)result.GetValue(result.GetOrdinal("ModifierID"));

                Skill    objSkill    = new Skill();
                Modifier objModifier = new Modifier();

                objSizeSkillModifier.objSkill    = objSkill.GetSkill(objSizeSkillModifier.SkillID);
                objSizeSkillModifier.objModifier = objModifier.GetModifier(objSizeSkillModifier.ModifierID);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets the reader to object.
        /// </summary>
        /// <param name="objSize">Size of the object.</param>
        /// <param name="result">The result.</param>
        private void SetReaderToObject(ref Size objSize, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objSize.SizeID       = (int)result.GetValue(result.GetOrdinal("SizeID"));
                objSize.SizeName     = result.GetValue(result.GetOrdinal("SizeName")).ToString();
                objSize.SizeModifier = (int)result.GetValue(result.GetOrdinal("SizeModifier"));

                SizeSkillModifier   objSizeSkillModifier   = new SizeSkillModifier();
                SizeDefenseModifier objSizeDefenseModifier = new SizeDefenseModifier();

                objSize.objSizeSkillModifier   = objSizeSkillModifier.GetSizeSkillModifier(objSize.SizeID);
                objSize.objSizeDefenseModifier = objSizeDefenseModifier.GetSizeDefenseModifier(objSize.SizeID);

                objSize._objComboBoxData.Add(objSize.SizeID, objSize.SizeName);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the size skill modifier 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 SizeSkillModifier objects</returns>
        private List <SizeSkillModifier> GetSizeSkillModifierList(string strSprocName, string strWhere, string strOrderBy)
        {
            List <SizeSkillModifier> sizeSkillModifiers = new List <SizeSkillModifier>();

            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())
                {
                    SizeSkillModifier objSizeSkillModifier = new SizeSkillModifier();
                    SetReaderToObject(ref objSizeSkillModifier, ref result);
                    sizeSkillModifiers.Add(objSizeSkillModifier);
                }
            }
            catch
            {
                Exception e = new Exception();
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(sizeSkillModifiers);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Clones the specified object SizeSkillModifier.
        /// </summary>
        /// <param name="objSizeSkillModifier">The object SizeSkillModifier.</param>
        /// <returns>SizeSkillModifier</returns>
        static public SizeSkillModifier Clone(SizeSkillModifier objSizeSkillModifier)
        {
            SizeSkillModifier objCSizeSkillModifier = new SizeSkillModifier(objSizeSkillModifier.SizeID, objSizeSkillModifier.SkillID, objSizeSkillModifier.ModifierID);

            return(objCSizeSkillModifier);
        }