Exemplo n.º 1
0
 /// <summary>
 /// 根据会员用户名获取会员及详细信息
 /// </summary>
 /// <param name="username"></param>
 /// <param name="member"></param>
 /// <param name="details"></param>
 public void GetMemberDetails(string username, out Member member, out MemberDetails details)
 {
     Member m = null;
     MemberDetails d = null;
     dal.GetMemberDetailsByUsername(username, rd =>
     {
         if (rd.HasRows)
         {
             rd.Read();
             FillMemberDetails(rd, out m, out d);
         }
     });
     member = m;
     details = d;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 根据数据行为会员赋值信息
        /// </summary>
        /// <param name="dr"></param>
        /// <param name="member"></param>
        /// <param name="details"></param>
        private void FillMemberDetails(DbDataReader rd, out Member member, out MemberDetails details)
        {
            member = new Member();
            member.ID = rd.GetInt32(0);
            member.Username = rd["username"].ToString();
            member.Password = rd["password"].ToString();
            member.Avatar = rd["avatar"].ToString();
            member.Nickname = rd["nickname"].ToString();
            member.Sex =rd["sex"].ToString();
            member.TelePhone = rd["telephone"].ToString();
            member.Note = rd["note"].ToString();
            member.Email = rd["email"].ToString();

            details = new MemberDetails();
            details.UID = member.ID;
            details.Token = rd["token"].ToString();
            details.Status = rd["status"].ToString();
            details.RegIP = rd["regip"].ToString();
            details.RegTime = Convert.ToDateTime(rd["RegTime"]);
            details.LastLoginTime = Convert.ToDateTime(rd["Lastlogintime"]);
        }
Exemplo n.º 3
0
 /// <summary>
 /// 根据会员ID获取会员及详细信息
 /// </summary>
 /// <param name="id"></param>
 /// <param name="member"></param>
 /// <param name="details"></param>
 public void GetMemberDetails(int id, out Member member, out MemberDetails details)
 {
     Member m=null;
     MemberDetails d=null;
     dal.GetMemberDetailsByID(id, rd =>
     {
         if (rd.HasRows)
         {
             rd.Read();
             FillMemberDetails(rd, out m, out d);
         }
     });
     member = m;
     details = d;
 }