Ejemplo n.º 1
0
        public static ThirdIMAccount LoadIMAccount(UserProfile profile)
        {
            var currentProfileType = ProfileType.UserProfile;

            if (profile is OrganizationProfile)
            {
                currentProfileType = ((OrganizationProfile)profile).CurrentProfileType;
            }

            var platform  = ModuleEnvironment.IMProviderName;
            var imAccount = ThirdIMAccount.FindByPlatformAccountId(platform, ThirdIMAccount.BuildAccountName(profile.PassportId, currentProfileType));

            return(imAccount);
        }
Ejemplo n.º 2
0
        public bool SendResumeRequest(long consultantPassportId)
        {
            if (consultantPassportId < 0)
            {
                return(false);
            }
            var passport = UserPassport.FindById(consultantPassportId);

            if (null == passport || passport.ProfileType == ProfileType.UserProfile)
            {
                return(false);
            }

            var message     = string.Format("您可以将简历发送到我的邮箱:{0}", passport.Profile.Email);
            var toAccount   = ThirdIMAccount.FindByPlatformAccountId(Passports.ModuleEnvironment.IMProviderName, ThirdIMAccount.BuildAccountName(MvcContext.Current.PassportId, ProfileType.UserProfile));
            var fromAccount = ThirdIMAccount.FindByPlatformAccountId(Passports.ModuleEnvironment.IMProviderName, ThirdIMAccount.BuildAccountName(consultantPassportId, ProfileType.OrganizationProfile));
            var isSent      = ObjectIOCFactory.GetSingleton <IIMProvider>(Passports.ModuleEnvironment.IMProviderName)
                              .SendMessage(toAccount.PlatformAccountId, fromAccount.PlatformAccountId, "txt", message, null);

            return(isSent);
        }