Beispiel #1
0
 private void SetReaderToObject(ref ModificationType objModificationType, ref SqlDataReader result)
 {
     if (result.HasRows)
     {
         objModificationType.ModificationTypeID          = (int)result.GetValue(result.GetOrdinal("ModificationTypeID"));
         objModificationType.ModificationTypeName        = result.GetValue(result.GetOrdinal("ModificationTypeName")).ToString();
         objModificationType.ModificationTypeDescription = result.GetValue(result.GetOrdinal("ModificationTypeDescription")).ToString();
     }
 }
Beispiel #2
0
        /// <summary>
        /// Clones the specified object ModificationType.
        /// </summary>
        /// <param name="objModificationType">The object ModificationType.</param>
        /// <returns>ModificationType</returns>
        static public ModificationType Clone(ModificationType objModificationType)
        {
            ModificationType objCModificationType = new ModificationType(objModificationType.ModificationTypeID);

            objCModificationType.ModificationTypeID          = objModificationType.ModificationTypeID;
            objCModificationType.ModificationTypeName        = objModificationType.ModificationTypeName;
            objCModificationType.ModificationTypeDescription = objModificationType.ModificationTypeDescription;

            return(objCModificationType);
        }
Beispiel #3
0
        /// <summary>
        /// Clones the specified LST ModificationType.
        /// </summary>
        /// <param name="lstModificationType">The LST ModificationType.</param>
        /// <returns>List<ModificationType></returns>
        static public List <ModificationType> Clone(List <ModificationType> lstModificationType)
        {
            List <ModificationType> lstCModificationType = new List <ModificationType>();

            foreach (ModificationType objModificationType in lstModificationType)
            {
                lstCModificationType.Add(ModificationType.Clone(objModificationType));
            }

            return(lstCModificationType);
        }
        private void SetReaderToObject(ref Modification objModification, ref SqlDataReader result)
        {
            if (result.HasRows)
            {
                objModification.ModificationID          = (int)result.GetValue(result.GetOrdinal("ModificationID"));
                objModification.ModificationName        = result.GetValue(result.GetOrdinal("ModificationName")).ToString();
                objModification.ModificationDescription = result.GetValue(result.GetOrdinal("ModificationDescription")).ToString();
                objModification.UpgradePoints           = (int)result.GetValue(result.GetOrdinal("UpgradePoints"));
                //objModification.ModificationTypeID = (int)result.GetValue(result.GetOrdinal("ModificationTypeID"));
                objModification.ModificationCost = (int)result.GetValue(result.GetOrdinal("ModificationCost"));

                ModificationType objModType = new ModificationType();
                objModification.lstModificationType = objModType.GetModificationTypesByModfication(objModification.ModificationID);
            }
        }
        /// <summary>
        /// Clones the specified object Modification.
        /// </summary>
        /// <param name="objModification">The object Modification.</param>
        /// <returns>Modification</returns>
        static public Modification Clone(Modification objModification)
        {
            Modification objCModification = new Modification(objModification.ModificationID);

            objCModification.ModificationID          = objModification.ModificationID;
            objCModification.ModificationName        = objModification.ModificationName;
            objCModification.ModificationDescription = objModification.ModificationDescription;
            //objCModification.ModificationTypeID = objModification.ModificationTypeID;
            objCModification.ModificationCost = objModification.ModificationCost;
            objCModification.UpgradePoints    = objModification.UpgradePoints;

            objCModification.lstModificationType = ModificationType.Clone(objModification.lstModificationType);

            return(objCModification);
        }
Beispiel #6
0
        private List <ModificationType> GetModificationTypeList(string strSprocName, string strWhere, string strOrderBy)
        {
            List <ModificationType> ModificationTypes = new List <ModificationType>();

            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())
                {
                    ModificationType objModificationType = new ModificationType();
                    SetReaderToObject(ref objModificationType, ref result);
                    ModificationTypes.Add(objModificationType);
                }
            }
            catch
            {
                Exception e = new Exception();
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(ModificationTypes);
        }