Ejemplo n.º 1
0
        public static MemberInfo CopyMemberToBO(OleDbDataReader rdr)
        {
            MemberInfo member = null;
            try
            {
                member = new MemberInfo();

                member.Id = rdr.GetInt32(0);
                member.Status = rdr.GetInt16(1);
                member.Username = rdr.GetString(2);
                member.NTUsername = rdr.SafeGetString(3);
                member.Email = rdr.SafeGetString(4);
                member.Country = rdr.SafeGetString(5);
                member.HomePage = rdr.SafeGetString(6);
                member.Signature = rdr.SafeGetString(7);
                member.MemberLevel = rdr.GetInt16(8);
                member.AIM = rdr.SafeGetString(9);
                member.Yahoo = rdr.SafeGetString(10);
                member.ICQ = rdr.SafeGetString(11);
                member.Skype = rdr.SafeGetString(12);
                member.PostCount = rdr.SafeGetInt32(13) ?? 0;
                member.MemberSince = rdr.GetSnitzDate(14) == null ? DateTime.UtcNow : rdr.GetSnitzDate(14).Value;
                member.LastVisitDate = rdr.GetSnitzDate(15);
                member.LastPostDate = rdr.GetSnitzDate(16);
                member.Title = rdr.SafeGetString(17); //member.MemberTitle(rdr.SafeGetString(17));
                member.AllowSubscriptions = rdr.SafeGetInt16(18) == 1;
                member.HideEmail = rdr.SafeGetInt16(19) == 1;
                member.ReceiveEmails = rdr.SafeGetInt16(20) == 1;
                member.MembersIP = rdr.SafeGetString(21);
                member.ViewSignatures = rdr.SafeGetInt16(22) == 1;
                member.UseSignature = rdr.SafeGetInt16(23) == 1;
                member.Voted = rdr.SafeGetInt32(24) == 1;
                member.AllowEmail = rdr.SafeGetInt16(25) == 1;
                member.Avatar = rdr.SafeGetString(26);
                member.Theme = rdr.SafeGetString(27);
                member.TimeOffset = rdr.SafeGetDouble(28);
                member.DateOfBirth = rdr.SafeGetString(29);
                member.Age = rdr.SafeGetString(30);
                member.Password = rdr.GetString(31);
                member.ValidationKey = rdr.SafeGetString(32);
                member.IsValid = rdr.SafeGetInt32(33) == 1;
                member.LastUpdateDate = rdr.GetSnitzDate(34);
                member.MaritalStatus = rdr.SafeGetString(35);
                member.Firstname = rdr.SafeGetString(36);
                member.Lastname = rdr.SafeGetString(37);
                member.Occupation = rdr.SafeGetString(38);
                member.Gender = rdr.SafeGetString(39);
                member.Hobbies = rdr.SafeGetString(40);
                member.LatestNews = rdr.SafeGetString(41);
                member.FavouriteQuote = rdr.SafeGetString(42);
                member.Biography = rdr.SafeGetString(43);
                member.FavLink1 = rdr.SafeGetString(44);
                member.FavLink2 = rdr.SafeGetString(45);
                member.City = rdr.SafeGetString(46);
                member.State = rdr.SafeGetString(47);
                member.UseDaylightSaving = rdr.SafeGetInt16(48) == 1;
                member.TimeZone = rdr.SafeGetString(49);

            }
            catch (Exception ex)
            {
                throw new Exception("Error copying reader to BO");
                OleDbDataReader rdrtest = rdr;
                string test = ex.Message;
            }

            string title = member.Title;
            //member.Rank = new RankInfo(member.Username, ref title, member.PostCount);
            member.Title = title;
            return member;
        }