Beispiel #1
0
        public bool UpdateTutorInfoByUserInfo(Model.UserInfo user)
        {
            Model.TutorInfo tutor         = GetTutorInfo(user.UserID);
            BLLUserExpand   bllUserExpand = new BLLUserExpand();
            BLLUser         bllUser       = new BLLUser();

            if (tutor == null)
            {
                tutor              = new Model.TutorInfo();
                tutor.UserId       = user.UserID;
                tutor.Email        = user.Email;
                tutor.TutorImg     = user.WXHeadimgurl;
                tutor.TutorName    = user.TrueName;
                tutor.Gender       = bllUser.GetSex(user);
                tutor.ProvinceCode = user.ProvinceCode;
                tutor.CityCode     = user.CityCode;
                tutor.City         = user.City;
                tutor.Digest       = bllUserExpand.GetUserExpandValue(BLLJIMP.Enums.UserExpandType.UserIntroduction, user.UserID);
                tutor.Company      = user.Company;
                tutor.Position     = user.Postion;
                tutor.WZNums       = GetCount <Model.JuActivityInfo>(string.Format(" UserId ='{0}' And IsDelete=0 And IsHide=0  And WebsiteOwner='{1}'", user.UserID, WebsiteOwner));
                var reviewTypeKey = CommonPlatform.Helper.EnumStringHelper.ToString(Enums.ReviewTypeKey.Answer);
                tutor.TutorAnswers = GetCount <Model.ReviewInfo>(string.Format(" UserId ='{0}' And ReviewType='{1}' AND WebsiteOwner='{2}'", user.UserID, reviewTypeKey, WebsiteOwner));
                tutor.RDataTime    = DateTime.Now;
                tutor.websiteOwner = WebsiteOwner;
                return(Add(tutor));
            }
            else
            {
                tutor.TutorImg     = user.WXHeadimgurl;
                tutor.TutorName    = user.TrueName;
                tutor.Gender       = bllUser.GetSex(user);
                tutor.ProvinceCode = user.ProvinceCode;
                tutor.CityCode     = user.CityCode;
                tutor.City         = user.City;
                tutor.Digest       = bllUserExpand.GetUserExpandValue(BLLJIMP.Enums.UserExpandType.UserIntroduction, user.UserID);
                tutor.Company      = user.Company;
                tutor.Position     = user.Postion;
                return(Update(tutor));
            }
        }
Beispiel #2
0
 public bool DelTutor(string userId)
 {
     Model.TutorInfo tutor = GetTutorInfo(userId);
     return(Delete(tutor) > 0);
 }
Beispiel #3
0
 /// <summary>
 /// 关系是否已存在
 /// </summary>
 /// <param name="rtype"></param>
 /// <param name="mainId"></param>
 /// <param name="relationId"></param>
 /// <returns></returns>
 public bool ExistTutor(string userId)
 {
     Model.TutorInfo tutor = GetTutorInfo(userId);
     return(tutor == null ?false : true);
 }