コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the WinningNumbers class and fills it with the data from the IDataRecord
        /// </summary>
        /// <param name="myDataRecord"></param>
        /// <returns></returns>
        private static WinningNumbers FillDataRecord(IDataRecord myDataRecord)
        {
            WinningNumbers myWinningNumsObject = new WinningNumbers();

            myWinningNumsObject.GameId = myDataRecord.GetInt32(myDataRecord.GetOrdinal("GameId"));

            if (!myDataRecord.IsDBNull(myDataRecord.GetOrdinal("GameId")))
            {
                myWinningNumsObject.GameName = myDataRecord.GetString(myDataRecord.GetOrdinal("GameName"));
                myWinningNumsObject.DrawingDate = myDataRecord.GetDateTime(myDataRecord.GetOrdinal("DrawingDate"));
                myWinningNumsObject.NumberValue = myDataRecord.GetInt32(myDataRecord.GetOrdinal("NumberValue"));

            }

            return myWinningNumsObject;
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the WinningNumbers class and fills it with the data from the IDataRecord
        /// </summary>
        /// <param name="myDataRecord"></param>
        /// <returns></returns>
        private static WinningNumbers FillDataRecord(IDataRecord myDataRecord)
        {
            WinningNumbers myWinningNumsObject = new WinningNumbers();

            //myWinningNumsObject.DrawingDateId = myDataRecord.GetInt32(myDataRecord.GetOrdinal("DrawingDateId"));
            //myWinningNumsObject.GameId = myDataRecord.GetInt32(myDataRecord.GetOrdinal("GameId"));

            if (!myDataRecord.IsDBNull(myDataRecord.GetOrdinal("NumberValue")))
            {
                myWinningNumsObject.NumberValue = myDataRecord.GetInt32(myDataRecord.GetOrdinal("NumberValue"));
            }
            myWinningNumsObject.WinningNumbersId = myDataRecord.GetInt32(myDataRecord.GetOrdinal("WinningNumbersId"));
            return myWinningNumsObject;
        }