public static MemberInfo GetFullInfo(string userId, MemberType userType)
        {
            MemberInfo model = null;
            MemberInfo mbll  = null;

            switch (userType)
            {
            case MemberType.Personal:
                mbll = new PersonMemberInfo();
                break;

            case MemberType.Famly:
                mbll = new FamlyMemberInfo();
                break;

            case MemberType.Company:
                mbll = new CompanyMemberInfo();
                break;

            case MemberType.School:
                mbll = new SchoolMemberInfo();
                break;
            }
            if (mbll != null)
            {
                model = mbll.GetFullUserInfo(userId);
            }
            return(model);
        }
Exemple #2
0
        private PersonMemberInfo ReaderBind(IDataReader dataReader)
        {
            PersonMemberInfo model = new PersonMemberInfo();
            object           ojb;

            model.UserId    = dataReader["UserId"].ToString();
            model.UserEmail = dataReader["UserEmail"].ToString();
            model.Password  = dataReader["Password"].ToString();
            model.UserName  = dataReader["UserName"].ToString();
            ojb             = dataReader["AllScore"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.AllScore = (int)ojb;
            }
            ojb = dataReader["CurScore"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CurScore = (int)ojb;
            }
            ojb = dataReader["LastLogin"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.LastLogin = (DateTime)ojb;
            }
            model.LoginIp = dataReader["LoginIP"].ToString();
            ojb           = dataReader["RegisterTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.RegisterTime = (DateTime)ojb;
            }
            ojb = dataReader["ModifyTime"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.ModifyTime = (DateTime)ojb;
            }
            ojb = dataReader["UserType"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UserType = (MemberType)(Convert.ToInt32(ojb));
            }
            ojb = dataReader["status"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.Status = (MemberStatus)(Convert.ToInt32(ojb));
            }

            model.IdCard    = dataReader["idcard"].ToString();
            model.Mobile    = dataReader["Mobile"].ToString();
            model.Telephone = dataReader["TelePhone"].ToString();
            ojb             = dataReader["UserLevel"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.UserLevel = (UserLevel)(Convert.ToInt32(ojb));
            }
            return(model);
        }