public static ExtendedCollection<PrivateMessage> GetBlockListedUsers()
        {
            ExtendedCollection<PrivateMessage> list = new ExtendedCollection<PrivateMessage>();

            IDataReader dr = GetData;

            while (dr.Read())
            {
                PrivateMessage item = new PrivateMessage();

                if (dr["ID"] != DBNull.Value)
                {
                    item.ID = (int)dr["ID"];
                }
                if (dr["UID"] != DBNull.Value)
                {
                    item.SenderUserID = (int)dr["UID"];
                }
                if (dr["UserName"] != DBNull.Value)
                {
                    item.SenderUserName = (string)dr["UserName"];
                }
                if (dr["Date"] != DBNull.Value)
                {
                    item.DateCreated = (DateTime)(dr["Date"]);
                }

                list.Add(item);
            }

            dr.Close();

            return list;
        }
Ejemplo n.º 2
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 prmLyricUserName = new SqlParameter("@ToUserName", SqlDbType.VarChar, 50);
            prmLyricUserName.Value = pm.LyricUserName;

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

            return DataAccess.Execute("spInsertPrivateMessage", prmSubject, prmSenderUserID, prmLyricUserName, prmMessage);
        }
Ejemplo n.º 3
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);
        }
        public ExtendedCollection<PrivateMessage> GetMessages()
        {
            ExtendedCollection<PrivateMessage> list = new ExtendedCollection<PrivateMessage>();

            IDataReader dr = GetData;

            while (dr.Read())
            {
                PrivateMessage item = new PrivateMessage();

                if (dr["M_ID"] != DBNull.Value)
                {
                    item.ID = (int)dr["M_ID"];
                }
                if (dr["M_Subject"] != DBNull.Value)
                {
                    item.Subject = (string)dr["M_Subject"];
                }
                if (dr["M_From"] != DBNull.Value)
                {
                    item.SenderUserID = (int)dr["M_From"];
                }
                if (dr["M_To"] != DBNull.Value)
                {
                    item.LyricUserID = (int)dr["M_To"];
                }
                if (dr["UserName"] != DBNull.Value)
                {
                    item.SenderUserName = (string)dr["UserName"];
                }
                if (dr["M_Sent"] != DBNull.Value)
                {
                    item.DateSent = (DateTime)(dr["M_Sent"]);
                }
                if (dr["M_Read"] != DBNull.Value)
                {
                    item.Read = (int)(dr["M_Read"]);
                }
                if (dr["PM_Message"] != DBNull.Value)
                {
                    item.Message = (string)(dr["PM_Message"]);
                }

                list.Add(item);
            }

            dr.Close();

            return list;
        }
Ejemplo n.º 5
0
 public virtual int DeleteSentPM(PrivateMessage pm)
 {
     return 0;
 }
Ejemplo n.º 6
0
 public virtual int Add(PrivateMessage pm)
 {
     return 0;
 }
 /// <summary>
 /// Perform Delete Sent by user PM
 /// </summary>
 /// <returns></returns>
 public override int DeleteSentPM(PrivateMessage pm)
 {
     return Blogic.DeleteSentPrivateMessage(pm);
 }
 /// <summary>
 /// Perform Insert to Database
 /// </summary>
 /// <returns></returns>
 public override int Add(PrivateMessage pm)
 {
     return Blogic.InsertPrivateMessage(pm);
 }