Esempio n. 1
0
        /// <summary>
        /// Populates the fields of a single objects from the columns found in an open reader.
        /// </summary>
        /// <param name="obj" type="ADUser">Object of ADUser to populate</param>
        /// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
        ///
        /// <remarks>
        ///
        /// <RevisionHistory>
        /// Author				Date			Description
        /// DLGenerator			3/7/2015 2:37:27 PM		Created function
        ///
        /// </RevisionHistory>
        ///
        /// </remarks>
        ///
        internal static void PopulateObjectFromReader(ADUserBase obj, IDataReader rdr)
        {
            obj.UserID       = rdr.GetInt32(rdr.GetOrdinal(ADUserFields.UserID));
            obj.UserFullName = rdr.GetString(rdr.GetOrdinal(ADUserFields.UserFullName));
            obj.UserName     = rdr.GetString(rdr.GetOrdinal(ADUserFields.UserName));
            if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Password)))
            {
                obj.Password = rdr.GetString(rdr.GetOrdinal(ADUserFields.Password));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.GroupID)))
            {
                obj.GroupID = rdr.GetInt32(rdr.GetOrdinal(ADUserFields.GroupID));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Email)))
            {
                obj.Email = rdr.GetString(rdr.GetOrdinal(ADUserFields.Email));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Address)))
            {
                obj.Address = rdr.GetString(rdr.GetOrdinal(ADUserFields.Address));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Phone)))
            {
                obj.Phone = rdr.GetString(rdr.GetOrdinal(ADUserFields.Phone));
            }

            if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Mobile)))
            {
                obj.Mobile = rdr.GetString(rdr.GetOrdinal(ADUserFields.Mobile));
            }
        }
Esempio n. 2
0
		/// <summary>
		/// Populates the fields of a single objects from the columns found in an open reader.
		/// </summary>
		/// <param name="obj" type="ADUser">Object of ADUser to populate</param>
		/// <param name="rdr" type="IDataReader">An object that implements the IDataReader interface</param>
		///
		/// <remarks>
		///
		/// <RevisionHistory>
		/// Author				Date			Description
		/// DLGenerator			3/7/2015 2:37:27 PM		Created function
		/// 
		/// </RevisionHistory>
		///
		/// </remarks>
		///
		internal static void PopulateObjectFromReader(ADUserBase obj,IDataReader rdr) 
		{

			obj.UserID = rdr.GetInt32(rdr.GetOrdinal(ADUserFields.UserID));
			obj.UserFullName = rdr.GetString(rdr.GetOrdinal(ADUserFields.UserFullName));
			obj.UserName = rdr.GetString(rdr.GetOrdinal(ADUserFields.UserName));
			if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Password)))
			{
				obj.Password = rdr.GetString(rdr.GetOrdinal(ADUserFields.Password));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.GroupID)))
			{
				obj.GroupID = rdr.GetInt32(rdr.GetOrdinal(ADUserFields.GroupID));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Email)))
			{
				obj.Email = rdr.GetString(rdr.GetOrdinal(ADUserFields.Email));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Address)))
			{
				obj.Address = rdr.GetString(rdr.GetOrdinal(ADUserFields.Address));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Phone)))
			{
				obj.Phone = rdr.GetString(rdr.GetOrdinal(ADUserFields.Phone));
			}
			
			if (!rdr.IsDBNull(rdr.GetOrdinal(ADUserFields.Mobile)))
			{
				obj.Mobile = rdr.GetString(rdr.GetOrdinal(ADUserFields.Mobile));
			}
			

		}