Ejemplo n.º 1
0
        /// <summary>
        /// Delete private message.
        /// </summary>
        /// <param name="messageID">Message identifier.</param>
        /// <param name="type">Type of message (sended or received).</param>
        public static void DeletePrivateMessage(Guid messageID, MessageType type)
        {
            ObjectParameter pkMessageID = new ObjectParameter("pkMessageID", messageID);

            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                if (type == MessageType.Posted)
                {
                    record.spMessage(pkMessageID, null, null, null, null, null, true, null);
                }
                else
                {
                    record.spMessage(pkMessageID, null, null, null, null, null, null, true);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Delete private message.
        /// </summary>
        /// <param name="messageID">Message identifier.</param>
        /// <param name="type">Type of message (sended or received).</param>
        public static void DeletePrivateMessage(Guid messageID, MessageType type)
        {
            ObjectParameter pkMessageID = new ObjectParameter("pkMessageID", messageID);

            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                if (type == MessageType.Posted)
                {
                    record.spMessage(pkMessageID, null, null, null, null, null, true, null);
                }
                else
                {
                    record.spMessage(pkMessageID, null, null, null, null, null, null, true);
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Set status 'read' to current message.
        /// </summary>
        /// <param name="messageID">Message identifier.</param>
        public static void SetReadStatus(Guid messageID)
        {
            ObjectParameter pkMessageID = new ObjectParameter("pkMessageID", messageID);

            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                record.spMessage(pkMessageID, null, null, null, null, true, null, null);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Send message to another user.
        /// </summary>
        /// <param name="senderID">Sender identifier.</param>
        /// <param name="receiverID">Receiver identifier.</param>
        /// <param name="header">Message title.</param>
        /// <param name="text">Message text.</param>
        public static void SendPrivateMessage(Guid senderID, Guid receiverID, String header, String text)
        {
            ObjectParameter pkMessageID = new ObjectParameter("pkMessageID", typeof(Guid));

            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                record.spMessage(pkMessageID, senderID, receiverID, header, text, true, false, false);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Set status 'read' to current message.
        /// </summary>
        /// <param name="messageID">Message identifier.</param>
        public static void SetReadStatus(Guid messageID)
        {
            ObjectParameter pkMessageID = new ObjectParameter("pkMessageID", messageID);

            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                record.spMessage(pkMessageID, null, null, null, null, true, null, null);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Send message to another user.
        /// </summary>
        /// <param name="senderID">Sender identifier.</param>
        /// <param name="receiverID">Receiver identifier.</param>
        /// <param name="header">Message title.</param>
        /// <param name="text">Message text.</param>
        public static void SendPrivateMessage(Guid senderID, Guid receiverID, String header, String text)
        {
            ObjectParameter pkMessageID = new ObjectParameter("pkMessageID", typeof(Guid));

            using (SocialNetworkDBEntities record = new SocialNetworkDBEntities())
            {
                record.spMessage(pkMessageID, senderID, receiverID, header, text, true, false, false);
            }
        }