Exemplo n.º 1
0
 public GameMailMessage()
 {
     m_mailID         = -1;
     m_senderID       = -1;
     m_receiverID     = -1;
     m_timeSent       = DateTime.Now;
     m_subject        = "";
     m_body           = "";
     m_attachment     = false;
     m_readByReceiver = false;
     m_mailAttachment = null;
     m_allowForward   = true;
     m_allowReply     = true;
 }
Exemplo n.º 2
0
        public void DeleteMailAttachment(GameMailAttachment attachment)
        {
            if (AllMailAttachments.Contains(attachment))
            {
                AllMailAttachments.Remove(attachment);
            }

            if (attachment.ItemID == Item.ID_COINS)
            {
                NumberOfCoinAttachments--;
            }

            DAL.DBMail.DeleteMailAttachment(attachment.MailID);
        }
Exemplo n.º 3
0
        public GameMailMessage(System.Data.DataRow dr) : base()
        {
            m_mailID         = Convert.ToInt64(dr["mailID"]);
            m_senderID       = Convert.ToInt32(dr["senderID"]);
            m_receiverID     = Convert.ToInt32(dr["receiverID"]);
            m_timeSent       = Convert.ToDateTime(dr["timeSent"]);
            m_subject        = dr["subject"].ToString();
            m_body           = dr["body"].ToString();
            m_attachment     = Convert.ToBoolean(dr["attachment"]);
            m_readByReceiver = Convert.ToBoolean(dr["readByReceiver"]);

            if (HasAttachment)
            {
                m_mailAttachment = DAL.DBMail.GetMailAttachment(MailID);
            }
        }
Exemplo n.º 4
0
        private void LoadUnreadMessagesAndMailAttachments()
        {
            m_unreadMessages.Clear();
            AllMailAttachments.Clear();
            NumberOfCoinAttachments = 0;

            foreach (GameMailMessage message in m_allMailMessages)
            {
                if (!message.HasBeenReadByReceiver && message.ReceiverID == m_mailboxOwnerID)
                {
                    m_unreadMessages.Add(message);
                }

                if (message.HasAttachment)
                {
                    GameMailAttachment attachment = DAL.DBMail.GetMailAttachment(message.MailID);
                    AllMailAttachments.Add(attachment);
                    if (attachment.ItemID == Item.ID_COINS)
                    {
                        NumberOfCoinAttachments++;
                    }
                }
            }
        }