public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (OtherDescription?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (IntermediaryType?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Company?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EMail?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (GUID?.GetHashCode() ?? 0);
            return(hashCode);
        }
Esempio n. 2
0
        /// <summary>
        /// Saves the force power descriptor.
        /// </summary>
        /// <returns>Race Object</returns>
        public Race SaveRace()
        {
            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 = "InsertUpdate_Race";

                command.Parameters.Add(dbconn.GenerateParameterObj("@RaceID", SqlDbType.Int, RaceID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@RaceName", SqlDbType.VarChar, RaceName.ToString(), 50));
                command.Parameters.Add(dbconn.GenerateParameterObj("@RaceDescription", SqlDbType.VarChar, RaceDescription.ToString(), 1000));
                command.Parameters.Add(dbconn.GenerateParameterObj("@OtherDescription", SqlDbType.VarChar, OtherDescription.ToString(), 1000));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SizeID", SqlDbType.Int, SizeID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Sex", SqlDbType.Char, Sex.ToString(), 1));
                command.Parameters.Add(dbconn.GenerateParameterObj("@RageAbility", SqlDbType.Bit, RageAbility.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ShapeShiftAbility", SqlDbType.Bit, ShapeShiftAbility.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Primitive", SqlDbType.Bit, Primitive.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@BonusSkill", SqlDbType.Bit, BonusSkill.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@BonusFeat", SqlDbType.Bit, BonusFeat.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@AverageHeight", SqlDbType.Decimal, AverageHeight.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@AverageWeight", SqlDbType.Decimal, AverageWeight.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@SpeedID", SqlDbType.Int, SpeedID.ToString(), 0));

                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message + "                     Inner Exception= " + e.InnerException);
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }