Esempio n. 1
0
        public string[] GetNxtPre(int messageID, string condition)
        {
            MessagesDAL test   = new MessagesDAL();
            Member      member = new Member();

            member.MemberId = Context.Session["memberID"].ToString();
            m.MemberId      = Session["memberID"].ToString();
            inbox           = test.getInboxList(m);

            Messages message = new Messages();



            message.MessageId = messageID;
            int[] index = test.GetMessageIndex(message, member);
            //int[] index = { 0, 0 };



            if (condition == "pre")
            {
                inbox = test.GetPreviousMessage(message, member);
            }
            else
            {
                inbox = test.GetNextMessage(message, member);
            }

            string concatinater = BuildSingleMessage(inbox);

            if (concatinater == "")
            {
                Message msg = new Message(messageID);

                inbox        = test.GetAMessage(msg);
                concatinater = BuildSingleMessage(inbox);
            }

            string[] singleView = new string[] { index[0].ToString(), index[1].ToString(), concatinater };

            return(singleView);
        }
Esempio n. 2
0
        public string[] GetNxtPre(int messageID, string condition)
        {
            MessagesDAL test = new MessagesDAL();
            Member member = new Member();
            member.MemberId = Context.Session["memberID"].ToString();
            m.MemberId = Session["memberID"].ToString();
            inbox = test.getInboxList(m);

            Messages message = new Messages();

            message.MessageId = messageID;
            int[] index = test.GetMessageIndex(message, member);
            //int[] index = { 0, 0 };

            if (condition == "pre")
            {

                inbox = test.GetPreviousMessage(message, member);
            }
            else
            {
                inbox = test.GetNextMessage(message, member);
            }

            string concatinater = BuildSingleMessage(inbox);

            if (concatinater == "")
            {
                Message msg = new Message(messageID);

                inbox = test.GetAMessage(msg);
                concatinater = BuildSingleMessage(inbox);

            }

            string[] singleView = new string[] { index[0].ToString(), index[1].ToString(), concatinater };

            return singleView;
        }