Esempio n. 1
0
        /// <summary>
        /// 对用户发送应用邀请
        /// </summary>
        /// <param name="userAppInviteInfo"></param>
        /// <returns></returns>
        public static int SendApplicationInvite(UserApplicationInviteInfo userAppInviteInfo)
        {
            int inviteId = Data.ManyouApplications.SendApplicationInvite(userAppInviteInfo);

            if (inviteId > 0)
            {
                int olId = OnlineUsers.GetOlidByUid(userAppInviteInfo.ToUid);
                if (olId > 0) //更新在线表信息
                    OnlineUsers.UpdateNewApplicationRequest(olId, ManyouApplications.GetApplicationInviteCount(userAppInviteInfo.ToUid));
            }
            return inviteId;
        }
Esempio n. 2
0
        public string Send()
        {
            SendApplicationInviteParams actionParams = JavaScriptConvert.DeserializeObject<SendApplicationInviteParams>(UnicodeToString(JsonParams));

            Dictionary<string,int> inviteTable = new Dictionary<string,int>();

            foreach (string toUid in actionParams.RecipientIds)
            {
                UserApplicationInviteInfo userAppInviteInfo = new UserApplicationInviteInfo();
                userAppInviteInfo.AppId = int.Parse(actionParams.AppId);
                userAppInviteInfo.FromUid = actionParams.UId;
                userAppInviteInfo.Hash = 1;
                userAppInviteInfo.MYML = actionParams.MYML;
                userAppInviteInfo.ToUid = int.Parse(toUid);
                userAppInviteInfo.Type = actionParams.Type == "invite" ? 0 : 1;
                userAppInviteInfo.TypeName = actionParams.RequestName;
                inviteTable.Add(toUid, ManyouApplications.SendApplicationInvite(userAppInviteInfo));
            }

            return GetResult(inviteTable);
        }
 /// <summary>
 /// 对用户发送应用邀请
 /// </summary>
 /// <param name="userAppInviteInfo"></param>
 /// <returns></returns>
 public static int SendApplicationInvite(UserApplicationInviteInfo userAppInviteInfo)
 {
     return DatabaseProvider.GetInstance().SendApplicationInvite(userAppInviteInfo);
 }