Beispiel #1
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if (member == null)
            {
                return;
            }


            Next2Friends.Data.Message message = new Next2Friends.Data.Message();

            message.FromNickName = "Next2Friends Team";
            message.IsDeleted    = false;
            message.IsFetched    = false;
            message.IsTrash      = false;
            message.MemberIDTo   = 0;
            message.MemberIDFrom = member.MemberID;
            message.Body         = SafeHTML(txtMessage.Text);
            message.DTCreated    = DateTime.Now;

            List <Member> allMembers = GetAllMembers();

            foreach (Member currMember in allMembers)
            {
                message.MessageID    = 0;
                message.WebMessageID = Next2Friends.Misc.UniqueID.NewWebID();
                message.MemberIDTo   = currMember.MemberID;
                message.Save();

                message.InReplyToID = message.MessageID;

                message.Save();
            }
        }
Beispiel #2
0
        protected void btnTestSend_Click(object sender, EventArgs e)
        {
            if (member == null)
            {
                return;
            }

            Member targetMember = Member.GetMemberViaNickname(txtNick.Text);

            if (targetMember == null)
            {
                return;
            }

            Next2Friends.Data.Message message = new Next2Friends.Data.Message();

            message.FromNickName = "Next2Friends Team";
            message.WebMessageID = Next2Friends.Misc.UniqueID.NewWebID();
            message.IsDeleted    = false;
            message.IsFetched    = false;
            message.IsTrash      = false;
            message.MemberIDTo   = targetMember.MemberID;
            message.MemberIDFrom = member.MemberID;
            message.Body         = SafeHTML(txtMessage.Text);
            message.DTCreated    = DateTime.Now;

            message.Save();

            message.InReplyToID = message.MessageID;

            message.Save();
        }
        protected void btnSend_Click(object sender, EventArgs e)
        {
            if (member == null)
                return;


            Next2Friends.Data.Message message = new Next2Friends.Data.Message();

            message.FromNickName = "Next2Friends Team";
            message.IsDeleted = false;
            message.IsFetched = false;
            message.IsTrash = false;
            message.MemberIDTo = 0;
            message.MemberIDFrom = member.MemberID;
            message.Body = SafeHTML(txtMessage.Text);
            message.DTCreated = DateTime.Now;

            List<Member> allMembers = GetAllMembers();

            foreach (Member currMember in allMembers)
            {
                message.MessageID = 0;
                message.WebMessageID = Next2Friends.Misc.UniqueID.NewWebID();
                message.MemberIDTo = currMember.MemberID;
                message.Save();

                message.InReplyToID = message.MessageID;

                message.Save();
            }   
        }
        protected void btnTestSend_Click(object sender, EventArgs e)
        {
            if (member == null)
                return;

            Member targetMember = Member.GetMemberViaNickname(txtNick.Text);

            if (targetMember == null)
                return;

            Next2Friends.Data.Message message = new Next2Friends.Data.Message();

            message.FromNickName = "Next2Friends Team";
            message.WebMessageID = Next2Friends.Misc.UniqueID.NewWebID();
            message.IsDeleted = false;
            message.IsFetched = false;
            message.IsTrash = false;
            message.MemberIDTo = targetMember.MemberID;
            message.MemberIDFrom = member.MemberID;
            message.Body = SafeHTML(txtMessage.Text);
            message.DTCreated = DateTime.Now;

            message.Save();

            message.InReplyToID = message.MessageID;

            message.Save();

        }
        /// <summary>
        /// Takes an prepopulated IDataReader and creates an array of Messages
        /// </summary>
        public static List<Message> PopulateObject(IDataReader dr)
        {
            ColumnFieldList list = new ColumnFieldList(dr);

            List<Message> arr = new List<Message>();

            Message obj;

            while (dr.Read())
            {
                obj = new Message();
                if (list.IsColumnPresent("MessageID")) { obj._messageID = (int)dr["MessageID"]; }
                if (list.IsColumnPresent("WebMessageID")) { obj._webMessageID = (string)dr["WebMessageID"]; }
                if (list.IsColumnPresent("VideoMessageResourceFileID")) { obj._videoMessageResourceFileID = (int)dr["VideoMessageResourceFileID"]; }
                if (list.IsColumnPresent("VideoMessageToken")) { obj._videoMessageToken = (string)dr["VideoMessageToken"]; }
                if (list.IsColumnPresent("MemberIDFrom")) { obj._memberIDFrom = (int)dr["MemberIDFrom"]; }
                if (list.IsColumnPresent("MemberIDTo")) { obj._memberIDTo = (int)dr["MemberIDTo"]; }
                if (list.IsColumnPresent("ExternalEmailTo")) { obj._externalEmailTo = (string)dr["ExternalEmailTo"]; }
                if (list.IsColumnPresent("InReplyToID")) { obj._inReplyToID = (int)dr["InReplyToID"]; }
                if (list.IsColumnPresent("Body")) { obj._body = (string)dr["Body"]; }
                if (list.IsColumnPresent("IsRead")) { obj._isRead = (bool)dr["IsRead"]; }
                if (list.IsColumnPresent("IsFetched")) { obj._isFetched = (bool)dr["IsFetched"]; }
                if (list.IsColumnPresent("IsSentTrash")) { obj._isSentTrash = (bool)dr["IsSentTrash"]; }
                if (list.IsColumnPresent("IsTrash")) { obj._isTrash = (bool)dr["IsTrash"]; }
                if (list.IsColumnPresent("IsDeleted")) { obj._isDeleted = (bool)dr["IsDeleted"]; }
                if (list.IsColumnPresent("DTCreated")) { obj._dTCreated = (DateTime)dr["DTCreated"]; }
                if (list.IsColumnPresent("IsSentDeleted")) { obj._isSentDeleted = (bool)dr["IsSentDeleted"]; }
                if (list.IsColumnPresent("PassKey")) { obj._passKey = (string)dr["PassKey"]; }

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }
Beispiel #6
0
        public static List<Message> PopulateMessageWithJoin(IDataReader dr)
        {
            List<Message> arr = new List<Message>();

            Message obj;

            while (dr.Read())
            {
                obj = new Message();
                obj._messageID = (int)dr["MessageID"];
                obj._webMessageID = (string)dr["WebMessageID"];
                obj._videoMessageResourceFileID = (int)dr["VideoMessageResourceFileID"];
                obj._videoMessageToken = (string)dr["VideoMessageToken"];
                obj._memberIDFrom = (int)dr["MemberIDFrom"];
                obj._inReplyToID = (int)dr["InReplyToID"];
                obj.FromNickName = (string)dr["NickName"];
                obj._memberIDTo = (int)dr["MemberIDTo"];
                obj._body = (string)dr["Body"];
                obj._isRead = (bool)dr["IsRead"];
                obj._isDeleted = (bool)dr["IsDeleted"];
                obj._isFetched = (bool)dr["IsFetched"];
                obj._dTCreated = (DateTime)dr["DTCreated"];
                obj.WebMemberIDFrom = (string)dr["WebMemberIDFrom"];

                arr.Add(obj);
            }

            dr.Close();

            return arr;
        }