Esempio n. 1
0
        public UserProfileAdditionalInfo GetByIdV2(int id)
        {
            string procName = "[dbo].[UserProfiles_SelectById_V3]";

            UserProfileAdditionalInfo aUserProfile = null;

            _data.ExecuteCmd(procName, delegate(SqlParameterCollection paramCol)
            {
                paramCol.AddWithValue("@Id", id);
            }, delegate(IDataReader reader, short set)
            {
                aUserProfile = MapSingleUserProfileV2(reader);
            });

            return(aUserProfile);
        }
Esempio n. 2
0
        public UserProfileAdditionalInfo GetByCreatedByV3(int userId)
        {
            string procName = "dbo.UserProfiles_SelectByCreatedByV3";

            UserProfileAdditionalInfo aUserProfile = null;

            _data.ExecuteCmd(procName, delegate(SqlParameterCollection paramCol)
            {
                paramCol.AddWithValue("@UserId", userId);
            }, delegate(IDataReader reader, short set)
            {
                aUserProfile = MapSingleUserProfileV2(reader);
            });

            return(aUserProfile);
        }
Esempio n. 3
0
        private static UserProfileAdditionalInfo MapSingleUserProfileV2(IDataReader reader)
        {
            UserProfileAdditionalInfo aUserProfile = new UserProfileAdditionalInfo();

            int initialIndex = 0;

            aUserProfile.Id            = reader.GetSafeInt32(initialIndex++);
            aUserProfile.UserId        = reader.GetSafeInt32(initialIndex++);
            aUserProfile.FirstName     = reader.GetSafeString(initialIndex++);
            aUserProfile.LastName      = reader.GetSafeString(initialIndex++);
            aUserProfile.Mi            = reader.GetSafeString(initialIndex++);
            aUserProfile.AvatarUrl     = reader.GetSafeString(initialIndex++);
            aUserProfile.DateCreated   = reader.GetSafeDateTime(initialIndex++);
            aUserProfile.DateModified  = reader.GetSafeDateTime(initialIndex++);
            aUserProfile.Email         = reader.GetSafeString(initialIndex++);
            aUserProfile.VeteranStatus = reader.GetSafeString(initialIndex++);
            aUserProfile.UserStatus    = reader.GetSafeString(initialIndex++);

            return(aUserProfile);
        }
Esempio n. 4
0
        public Paged <UserProfileAdditionalInfo> GetAllBySearch(string searchQuery, int pageIndex, int pageSize)
        {
            Paged <UserProfileAdditionalInfo> pagedList = null;

            List <UserProfileAdditionalInfo> list = null;

            UserProfileAdditionalInfo aUserProfile = null;

            int totalCount = 0;

            string procName = "[dbo].[UserProfiles_SelectAll_BySearchQuery_V2]";

            _data.ExecuteCmd(procName, inputParamMapper : delegate(SqlParameterCollection paramCol)
            {
                paramCol.AddWithValue("@PageIndex", pageIndex);
                paramCol.AddWithValue("@PageSize", pageSize);
                paramCol.AddWithValue("@SearchQuery", searchQuery);
            }, singleRecordMapper : delegate(IDataReader reader, short set)
            {
                aUserProfile = MapSingleUserProfileV3(reader);

                if (totalCount == 0)
                {
                    totalCount = reader.GetSafeInt32(12);
                }

                if (list == null)
                {
                    list = new List <UserProfileAdditionalInfo>();
                }

                list.Add(aUserProfile);
            });

            if (list != null)
            {
                pagedList = new Paged <UserProfileAdditionalInfo>(list, pageIndex, pageSize, totalCount);
            }

            return(pagedList);
        }