Esempio n. 1
0
        /// <summary>
        /// Insert private message
        /// </summary>
        public static int InsertPrivateMessage(PrivateMessage pm)
        {
            SqlParameter prmSubject = new SqlParameter("@Subject", SqlDbType.VarChar, 100);
              prmSubject.Value = pm.Subject;

              SqlParameter prmSenderUserID = new SqlParameter("@FromUserID", SqlDbType.Int, 4);
              prmSenderUserID.Value = pm.SenderUserID;

              SqlParameter prmRecipientUserName = new SqlParameter("@ToUserName", SqlDbType.VarChar, 50);
              prmRecipientUserName.Value = pm.RecipientUserName;

              SqlParameter prmMessage = new SqlParameter("@Message", SqlDbType.VarChar, 4000);
              prmMessage.Value = pm.Message;

              return DataAccess.Execute("spInsertPrivateMessage", prmSubject, prmSenderUserID, prmRecipientUserName, prmMessage);
        }
Esempio n. 2
0
        /// <summary>
        /// Delete user sent private message
        /// </summary>
        public static int DeleteSentPrivateMessage(PrivateMessage pm)
        {
            SqlParameter prmUserID = new SqlParameter("@UserID", SqlDbType.Int, 4);
              prmUserID.Value = pm.SenderUserID;

              SqlParameter prmID = new SqlParameter("@ID", SqlDbType.Int, 4);
              prmID.Value = pm.ID;

              return DataAccess.Execute("spDeletePrivateMessageSent", prmUserID, prmID);
        }