/// <summary>
        /// 加载发信箱
        /// </summary>
        /// <returns></returns>
        public ActionResult SendBoxMenu()
        {
            MODEL.T_MemberInformation user = OperateContext.Current.Usr;//Session["user"] as MODEL.T_MemberInformation;

            MODEL.Tbl_User_Message userMessage = new MODEL.Tbl_User_Message();
            MODEL.Tbl_Message message = new MODEL.Tbl_Message();
            List<MODEL.ViewModel.SendBox> sendBoxList = new List<MODEL.ViewModel.SendBox>();
            MODEL.ViewModel.PageModelInMsg pageModel = new MODEL.ViewModel.PageModelInMsg();
            string sendId = user.StuNum;
            int pageIndex = 1;
            int count = 1;
            string flage = Request.QueryString["flage"] == null ? null : Request.QueryString["flage"].ToString();
            if (flage == "next")
            {
                pageIndex = Request.QueryString["pageIndex"] == null ? 1 : int.Parse(Request.QueryString["pageIndex"]) + 1;
            }
            else if (flage == "front")
            {
                pageIndex = Request.QueryString["pageIndex"] == null ? 1 : int.Parse(Request.QueryString["pageIndex"]) - 1;
            }

            int pageSize = Request.QueryString["PageSize"] == null ? 5 : int.Parse(Request.QueryString["PageSize"]);
            pageModel.PageIndex = pageIndex;
            count =  OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.SendId == sendId && u.SendIsDelete == false && u.IsDraft == false && (u.SendTrueDel == false || u.SendTrueDel == null)).Count();
            pageModel.MessageCount = count;
            pageModel.PageCount = (int)Math.Ceiling(count / (float)pageSize) == 0 ? 1 : (int)Math.Ceiling(count / (float)pageSize);

            if (pageModel.PageIndex > pageModel.PageCount)
            {
                pageModel.PageIndex = pageModel.PageCount;
            }

            List<MODEL.Tbl_User_Message> list = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetPagedList(pageModel.PageIndex, pageSize, u => u.SendId == sendId && u.SendIsDelete == false && u.IsDraft == false && (u.SendTrueDel == false || u.SendTrueDel == null), u => u.Id);
            foreach (MODEL.Tbl_User_Message userModel in list)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List<MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.ReceiveId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.ReceiveName = menberModel.StuName;

                    List<MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime = mes.SendTime.ToString();
                        sendBoxModel.MessageId = mes.Id;
                    }
                }
                sendBoxModel.ReceiveId = userModel.ReceiveId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead = userModel.IsRead;
                sendBoxModel.IsDraft = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete = userModel.SendIsDelete;

                sendBoxList.Add(sendBoxModel);
            }
            ViewData["sendBoxList"] = sendBoxList;
            ViewData["pageModel"] = pageModel;
            return View();
        }
        public ActionResult RecycleBoxMenu()
        {
            MODEL.T_MemberInformation user = OperateContext.Current.Usr;//Session["user"] as MODEL.T_MemberInformation;

            MODEL.Tbl_User_Message sendUserMessage = new MODEL.Tbl_User_Message();
            MODEL.Tbl_Message sendMessage = new MODEL.Tbl_Message();

            List<MODEL.ViewModel.SendBox> sendBoxList = new List<MODEL.ViewModel.SendBox>();
            List<MODEL.ViewModel.SendBox> receiveBoxList = new List<MODEL.ViewModel.SendBox>();
            MODEL.ViewModel.PageModelInMsg sendPpageModel = new MODEL.ViewModel.PageModelInMsg();
            MODEL.ViewModel.PageModelInMsg receivePageModel = new MODEL.ViewModel.PageModelInMsg();

            string sendId = user.StuNum;
            string receiveId = user.StuNum;

            //分页查询处理
            int sendPageIndex = 1;
            int receivePageIndex = 1;
            int sendCount = 1;
            int receiveCount = 1;

            string sendFlage = Request.QueryString["sendFlage"] == null ? null : Request.QueryString["sendFlage"].ToString();
            string receiveFlage = Request.QueryString["receiveFlage"] == null ? null : Request.QueryString["receiveFlage"].ToString();

            if (sendFlage == "next")
            {
                sendPageIndex = Request.QueryString["sendPageIndex"] == null ? 1 : int.Parse(Request.QueryString["sendPageIndex"]) + 1;
            }
            else if (sendFlage == "front")
            {
                sendPageIndex = Request.QueryString["sendPageIndex"] == null ? 1 : int.Parse(Request.QueryString["sendPageIndex"]) - 1;
            }

            if (receiveFlage == "next")
            {
                receivePageIndex = Request.QueryString["receivPageIndex"] == null ? 1 : int.Parse(Request.QueryString["receivPageIndex"]) + 1;
            }
            else if (receiveFlage == "front")
            {
                receivePageIndex = Request.QueryString["receivPageIndex"] == null ? 1 : int.Parse(Request.QueryString["receivPageIndex"]) - 1;
            }

            sendPpageModel.PageIndex = sendPageIndex;
            receivePageModel.PageIndex = receivePageIndex;

            sendCount = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.SendId == sendId && u.SendIsDelete == true && (u.SendTrueDel == false || u.SendTrueDel == null)).Count();
            receiveCount = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.ReceiveId == receiveId && u.ReceiveIsDelete == true && (u.RecTrueDel == false || u.RecTrueDel == null)).Count();

            sendPpageModel.MessageCount = sendCount;
            receivePageModel.MessageCount = receiveCount;

            int sendPageSize = Request.QueryString["sendPageSize"] == null ? 3 : int.Parse(Request.QueryString["sendPageSize"]);
            int receivePageSize = Request.QueryString["receivePageSize"] == null ? 3 : int.Parse(Request.QueryString["receivePageSize"]);

            sendPpageModel.PageCount = (int)Math.Ceiling(sendCount / (float)sendPageSize) == 0 ? 1 : (int)Math.Ceiling(sendCount / (float)sendPageSize);
            receivePageModel.PageCount = (int)Math.Ceiling(receiveCount / (float)receivePageSize) == 0 ? 1 : (int)Math.Ceiling(receiveCount / (float)receivePageSize);

            if (sendPpageModel.PageIndex > sendPpageModel.PageCount)
            {
                sendPpageModel.PageIndex = sendPpageModel.PageCount;
            }
            if (receivePageModel.PageIndex > receivePageModel.PageCount)
            {
                receivePageModel.PageIndex = receivePageModel.PageCount;
            }

            //开始分页查询
            List<MODEL.Tbl_User_Message> sendList = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetPagedList(sendPpageModel.PageIndex, sendPageSize, u => u.SendId == sendId && u.SendIsDelete == true && (u.SendTrueDel == false || u.SendTrueDel == null), u => u.Id);
            List<MODEL.Tbl_User_Message> receiveList = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetPagedList(receivePageModel.PageIndex, receivePageSize, u => u.ReceiveId == receiveId && u.ReceiveIsDelete == true && (u.RecTrueDel == false || u.RecTrueDel == null), u => u.Id);

            foreach (MODEL.Tbl_User_Message userModel in sendList)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List<MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.ReceiveId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.ReceiveName = menberModel.StuName;

                    List<MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime = mes.SendTime.ToString();
                        sendBoxModel.MessageId = mes.Id;
                    }
                }
                sendBoxModel.ReceiveId = userModel.ReceiveId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead = userModel.IsRead;
                sendBoxModel.IsDraft = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete = userModel.SendIsDelete;

                sendBoxList.Add(sendBoxModel);
            }

            foreach (MODEL.Tbl_User_Message userModel in receiveList)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List<MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.SendId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.SendName = menberModel.StuName;

                    List<MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime = mes.SendTime.ToString();
                        sendBoxModel.MessageId = mes.Id;
                    }
                }
                sendBoxModel.SendId = userModel.SendId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead = userModel.IsRead;
                sendBoxModel.IsDraft = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete = userModel.SendIsDelete;

                receiveBoxList.Add(sendBoxModel);
            }

            ViewData["sendBoxList"] = sendBoxList;
            ViewData["receiveBoxList"] = receiveBoxList;
            ViewData["sendPpageModel"] = sendPpageModel;
            ViewData["receivePageModel"] = receivePageModel;
            return View();
        }
Esempio n. 3
0
        public ActionResult DraftBoxMenu()
        {
            MODEL.T_MemberInformation user = OperateContext.Current.Usr;//Session["user"] as MODEL.T_MemberInformation;

            MODEL.Tbl_User_Message         userMessage = new MODEL.Tbl_User_Message();
            MODEL.Tbl_Message              message     = new MODEL.Tbl_Message();
            List <MODEL.ViewModel.SendBox> sendBoxList = new List <MODEL.ViewModel.SendBox>();

            MODEL.ViewModel.PageModelInMsg pageModel = new MODEL.ViewModel.PageModelInMsg();
            string sendId    = user.StuNum;
            int    pageIndex = 1;
            int    count     = 1;
            string flage     = Request.QueryString["flage"] == null ? null : Request.QueryString["flage"].ToString();

            if (flage == "next")
            {
                pageIndex = Request.QueryString["pageIndex"] == null ? 1 : int.Parse(Request.QueryString["pageIndex"]) + 1;
            }
            else if (flage == "front")
            {
                pageIndex = Request.QueryString["pageIndex"] == null ? 1 : int.Parse(Request.QueryString["pageIndex"]) - 1;
            }

            int pageSize = Request.QueryString["PageSize"] == null ? 5 : int.Parse(Request.QueryString["PageSize"]);

            pageModel.PageIndex = pageIndex;
            count = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.SendId == sendId && u.SendIsDelete == false && u.IsDraft == true && (u.SendTrueDel == false || u.SendTrueDel == null)).Count();
            pageModel.MessageCount = count;
            pageModel.PageCount    = (int)Math.Ceiling(count / (float)pageSize) == 0 ? 1 : (int)Math.Ceiling(count / (float)pageSize);

            if (pageModel.PageIndex > pageModel.PageCount)
            {
                pageModel.PageIndex = pageModel.PageCount;
            }


            List <MODEL.Tbl_User_Message> list = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetPagedList(pageModel.PageIndex, pageSize, u => u.SendId == sendId && u.SendIsDelete == false && u.IsDraft == true && (u.SendTrueDel == false || u.SendTrueDel == null), u => u.Id);

            foreach (MODEL.Tbl_User_Message userModel in list)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List <MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.ReceiveId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.ReceiveName = menberModel.StuName;

                    List <MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime     = mes.SendTime.ToString();
                        sendBoxModel.MessageId    = mes.Id;
                    }
                }
                sendBoxModel.ReceiveId     = userModel.ReceiveId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead          = userModel.IsRead;
                sendBoxModel.IsDraft         = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete    = userModel.SendIsDelete;

                sendBoxList.Add(sendBoxModel);
            }
            ViewData["sendBoxList"] = sendBoxList;
            ViewData["pageModel"]   = pageModel;
            return(View());
        }
        public ActionResult Index()
        {
            MODEL.T_MemberInformation user = OperateContext.Current.Usr;// as MODEL.T_MemberInformation;

            #region 真正把消息人和接收人都彻底删除的消息彻底删除
            //用户进入模块主页时,才真正把消息人和接收人都彻底删除的消息彻底删除
            List<MODEL.Tbl_User_Message> trueDel = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => (u.SendId == user.StuNum || u.ReceiveId == user.StuNum) && u.RecTrueDel == true && u.SendTrueDel == true);
            foreach (var del in trueDel)
            {
                OperateContext.Current.BLLSession.Il_User_MessageBLL.DelBy(u => u.Id == del.Id); //删除发送接收表
                OperateContext.Current.BLLSession.Il_MessageBLL.DelBy(u => u.Id == del.MessageId); //删除信息表
            }
            #endregion

            MODEL.Tbl_User_Message userMessage = new MODEL.Tbl_User_Message();
            MODEL.Tbl_Message message = new MODEL.Tbl_Message();
            List<MODEL.ViewModel.SendBox> sendBoxList = new List<MODEL.ViewModel.SendBox>();
            MODEL.ViewModel.PageModelInMsg pageModel = new MODEL.ViewModel.PageModelInMsg();
            string receiveId = user.StuNum;

            int pageIndex = 1;
            string flage = Request.QueryString["flage"] == null ? null : Request.QueryString["flage"].ToString();
            if (flage == "next")
            {
                pageIndex = Request.QueryString["pageIndex"] == null ? 1 : int.Parse(Request.QueryString["pageIndex"]) + 1;
            }
            else if (flage == "front")
            {
                pageIndex = Request.QueryString["pageIndex"] == null ? 1 : int.Parse(Request.QueryString["pageIndex"]) - 1;
            }

            int pageSize = Request.QueryString["PageSize"] == null ? 5 : int.Parse(Request.QueryString["PageSize"]);
            pageModel.PageIndex = pageIndex;

            List<MODEL.Tbl_User_Message> list = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.ReceiveId == receiveId && u.ReceiveIsDelete == false && (u.RecTrueDel == false || u.RecTrueDel == null));

            int count =list.Count();

            pageModel.MessageCount = count;
            pageModel.PageCount = (int)Math.Ceiling(count / (float)pageSize) == 0 ? 1 : (int)Math.Ceiling(count / (float)pageSize);

            if (pageModel.PageIndex > pageModel.PageCount)
            {
                pageModel.PageIndex = pageModel.PageCount;
            }

            foreach (MODEL.Tbl_User_Message userModel in list)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List<MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.SendId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.SendName = menberModel.StuName;

                    List<MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime = mes.SendTime.ToString();
                        sendBoxModel.MessageId = mes.Id;
                    }
                }
                sendBoxModel.SendId = userModel.SendId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead = userModel.IsRead;
                sendBoxModel.IsDraft = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete = userModel.SendIsDelete;

                sendBoxList.Add(sendBoxModel);
            }

            List<MODEL.ViewModel.SendBox> sendBoxList2 = sendBoxList.OrderByDescending(s => Convert.ToDateTime(s.SendTime)).ToList();
            List<MODEL.ViewModel.SendBox> sendBoxList3 = new List<MODEL.ViewModel.SendBox>();

            int p = pageModel.PageIndex * pageSize <= pageModel.MessageCount ? pageModel.PageIndex * pageSize : pageModel.MessageCount;
            for (int i = ( pageModel.PageIndex -1 ) * pageSize ; i < p ; i++)
            {
                sendBoxList3.Add(sendBoxList2[i]);
            }

            ViewData["sendBoxList"] = sendBoxList3;
            ViewData["pageModel"] = pageModel;
            return View();
        }
Esempio n. 5
0
        public ActionResult RecycleBoxMenu()
        {
            MODEL.T_MemberInformation user = OperateContext.Current.Usr;//Session["user"] as MODEL.T_MemberInformation;

            MODEL.Tbl_User_Message sendUserMessage = new MODEL.Tbl_User_Message();
            MODEL.Tbl_Message      sendMessage     = new MODEL.Tbl_Message();

            List <MODEL.ViewModel.SendBox> sendBoxList    = new List <MODEL.ViewModel.SendBox>();
            List <MODEL.ViewModel.SendBox> receiveBoxList = new List <MODEL.ViewModel.SendBox>();

            MODEL.ViewModel.PageModelInMsg sendPpageModel   = new MODEL.ViewModel.PageModelInMsg();
            MODEL.ViewModel.PageModelInMsg receivePageModel = new MODEL.ViewModel.PageModelInMsg();

            string sendId    = user.StuNum;
            string receiveId = user.StuNum;


            //分页查询处理
            int sendPageIndex    = 1;
            int receivePageIndex = 1;
            int sendCount        = 1;
            int receiveCount     = 1;

            string sendFlage    = Request.QueryString["sendFlage"] == null ? null : Request.QueryString["sendFlage"].ToString();
            string receiveFlage = Request.QueryString["receiveFlage"] == null ? null : Request.QueryString["receiveFlage"].ToString();

            if (sendFlage == "next")
            {
                sendPageIndex = Request.QueryString["sendPageIndex"] == null ? 1 : int.Parse(Request.QueryString["sendPageIndex"]) + 1;
            }
            else if (sendFlage == "front")
            {
                sendPageIndex = Request.QueryString["sendPageIndex"] == null ? 1 : int.Parse(Request.QueryString["sendPageIndex"]) - 1;
            }

            if (receiveFlage == "next")
            {
                receivePageIndex = Request.QueryString["receivPageIndex"] == null ? 1 : int.Parse(Request.QueryString["receivPageIndex"]) + 1;
            }
            else if (receiveFlage == "front")
            {
                receivePageIndex = Request.QueryString["receivPageIndex"] == null ? 1 : int.Parse(Request.QueryString["receivPageIndex"]) - 1;
            }

            sendPpageModel.PageIndex   = sendPageIndex;
            receivePageModel.PageIndex = receivePageIndex;

            sendCount    = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.SendId == sendId && u.SendIsDelete == true && (u.SendTrueDel == false || u.SendTrueDel == null)).Count();
            receiveCount = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetListBy(u => u.ReceiveId == receiveId && u.ReceiveIsDelete == true && (u.RecTrueDel == false || u.RecTrueDel == null)).Count();

            sendPpageModel.MessageCount   = sendCount;
            receivePageModel.MessageCount = receiveCount;

            int sendPageSize    = Request.QueryString["sendPageSize"] == null ? 3 : int.Parse(Request.QueryString["sendPageSize"]);
            int receivePageSize = Request.QueryString["receivePageSize"] == null ? 3 : int.Parse(Request.QueryString["receivePageSize"]);

            sendPpageModel.PageCount   = (int)Math.Ceiling(sendCount / (float)sendPageSize) == 0 ? 1 : (int)Math.Ceiling(sendCount / (float)sendPageSize);
            receivePageModel.PageCount = (int)Math.Ceiling(receiveCount / (float)receivePageSize) == 0 ? 1 : (int)Math.Ceiling(receiveCount / (float)receivePageSize);

            if (sendPpageModel.PageIndex > sendPpageModel.PageCount)
            {
                sendPpageModel.PageIndex = sendPpageModel.PageCount;
            }
            if (receivePageModel.PageIndex > receivePageModel.PageCount)
            {
                receivePageModel.PageIndex = receivePageModel.PageCount;
            }

            //开始分页查询
            List <MODEL.Tbl_User_Message> sendList    = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetPagedList(sendPpageModel.PageIndex, sendPageSize, u => u.SendId == sendId && u.SendIsDelete == true && (u.SendTrueDel == false || u.SendTrueDel == null), u => u.Id);
            List <MODEL.Tbl_User_Message> receiveList = OperateContext.Current.BLLSession.Il_User_MessageBLL.GetPagedList(receivePageModel.PageIndex, receivePageSize, u => u.ReceiveId == receiveId && u.ReceiveIsDelete == true && (u.RecTrueDel == false || u.RecTrueDel == null), u => u.Id);

            foreach (MODEL.Tbl_User_Message userModel in sendList)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List <MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.ReceiveId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.ReceiveName = menberModel.StuName;

                    List <MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime     = mes.SendTime.ToString();
                        sendBoxModel.MessageId    = mes.Id;
                    }
                }
                sendBoxModel.ReceiveId     = userModel.ReceiveId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead          = userModel.IsRead;
                sendBoxModel.IsDraft         = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete    = userModel.SendIsDelete;

                sendBoxList.Add(sendBoxModel);
            }

            foreach (MODEL.Tbl_User_Message userModel in receiveList)
            {
                MODEL.ViewModel.SendBox sendBoxModel = new MODEL.ViewModel.SendBox();

                List <MODEL.T_MemberInformation> menber = OperateContext.Current.BLLSession.IMemberInformationBLL.GetListBy(u => u.StuNum == userModel.SendId);
                foreach (MODEL.T_MemberInformation menberModel in menber)
                {
                    sendBoxModel.SendName = menberModel.StuName;

                    List <MODEL.Tbl_Message> messageModel = OperateContext.Current.BLLSession.Il_MessageBLL.GetListBy(m => m.Id == userModel.MessageId);
                    foreach (MODEL.Tbl_Message mes in messageModel)
                    {
                        sendBoxModel.MessageTitle = mes.Title;
                        sendBoxModel.SendTime     = mes.SendTime.ToString();
                        sendBoxModel.MessageId    = mes.Id;
                    }
                }
                sendBoxModel.SendId        = userModel.SendId;
                sendBoxModel.UserMessageId = userModel.Id;

                sendBoxModel.IsRead          = userModel.IsRead;
                sendBoxModel.IsDraft         = userModel.IsDraft;
                sendBoxModel.ReceiveIsDelete = userModel.ReceiveIsDelete;
                sendBoxModel.SendIsDelete    = userModel.SendIsDelete;

                receiveBoxList.Add(sendBoxModel);
            }

            ViewData["sendBoxList"]      = sendBoxList;
            ViewData["receiveBoxList"]   = receiveBoxList;
            ViewData["sendPpageModel"]   = sendPpageModel;
            ViewData["receivePageModel"] = receivePageModel;
            return(View());
        }