当前位置: 首页>>代码示例>>C#>>正文


C# Messages.Save方法代码示例

本文整理汇总了C#中Messages.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Messages.Save方法的具体用法?C# Messages.Save怎么用?C# Messages.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Messages的用法示例。


在下文中一共展示了Messages.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SendMessage

 public static void SendMessage(Messages message)
 {
     message.Save();
     Messages.SendPushMessageToEvent(message);
 }
开发者ID:Hookem22,项目名称:Mayfly-Web,代码行数:5,代码来源:Default.aspx.cs

示例2: SendInvitations

        public string SendInvitations(Account sender, string ToEmailArray, string Message)
        {
            string resultMessage = Message;
            foreach (string s in ToEmailArray.Split(new char[] { ',', ';' }))
            {
                FriendInvitation friendInvitation = new FriendInvitation();
                friendInvitation.AccountID = sender.AccountID;
                friendInvitation.Email = s;
                friendInvitation.GUID = Guid.NewGuid();
                friendInvitation.BecameAccountID = 0;
                FriendInvitation.SaveFriendInvitation(friendInvitation);

                //add alert to existing users alerts
                Account account = Account.GetAccountByEmail(s);
                if (account != null)
                {
                    _alertService.AddFriendRequestAlert(_userSession.CurrentUser, account, friendInvitation.GUID,
                                                        Message);
                }

                //CHAPTER 6
                //TODO: MESSAGING - if this email is already in our system add a message through messaging system
                //if(email in system)
                //{
                //      add message to messaging system
                //}
                //else
                //{
                //      send email
                SendFriendInvitation(s, sender.FirstName, sender.LastName, friendInvitation.GUID.ToString(), Message);
                //send into mailbox
                Message = sender.FirstName + " " + sender.LastName +
          "Muốn kết bạn với bạn!<HR><a href=\"" + _configuration.RootURL +
          "Friends/ConfirmFriendInSite.aspx?InvitationKey=" + friendInvitation.GUID.ToString() + "\">" + _configuration.RootURL +
          "Friends/ConfirmFriendInSite.aspx?InvitationKey=" + friendInvitation.GUID.ToString() + "</a><HR>" + Message;
                Messages m = new Messages();
                m.Body = Message;
                m.Subject = "Thư mời kết bạn";
                m.CreateDate = DateTime.Now;
                m.MessageTypeID = (int)MessageTypes.FriendRequest;
                m.SentByAccountID = _userSession.CurrentUser.AccountID;
                m.MessageID = 0;
                m.Save();

                Int64 messageID = m.MessageID;

                MessageRecipient sendermr = new MessageRecipient();
                sendermr.AccountID = _userSession.CurrentUser.AccountID;
                sendermr.MessageFolderID = (int)MessageFolders.Sent;
                sendermr.MessageRecipientTypeID = (int)MessageRecipientTypes.TO;
                sendermr.MessageID = messageID;
                sendermr.MessageStatusTypeID = (int)MessageStatusTypes.Unread;
                sendermr.MessageRecipientID = 0;
                sendermr.Save();

                Account toAccount = Account.GetAccountByEmail(s);
                if (toAccount != null)
                {
                    MessageRecipient mr = new MessageRecipient();
                    mr.AccountID = toAccount.AccountID;
                    mr.MessageFolderID = (int)MessageFolders.Inbox;
                    mr.MessageID = messageID;
                    mr.MessageRecipientTypeID = (int)MessageRecipientTypes.TO;
                    mr.MessageRecipientID = 0;
                    mr.MessageStatusTypeID = 1;
                    mr.Save();
                    //_email.SendNewMessageNotification(toAccount, toAccount.Email);
                }
                //}
                resultMessage += "• " + s + "<BR>";
            }
            return resultMessage;
        }
开发者ID:lengocluyen,项目名称:pescode,代码行数:73,代码来源:Email.cs


注:本文中的Messages.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。