//得到所有的投诉
        public List<Complemaint> GetAllComplemaints()
        {
            ISingleResult<getAllComplaintResult> result = dc.getAllComplaint();
            List<Complemaint> complemaintList = new List<Complemaint>();

            foreach (getAllComplaintResult complaint in result)
            {
                Complemaint newComplemaint = new Complemaint();
                newComplemaint.commodityId = complaint.commodityid.Value;
                newComplemaint.content = complaint.content;
                newComplemaint.ID = complaint.id;
                newComplemaint.state = (MessageState)complaint.state.Value;

                // 获得目的用户信息
                ISingleResult<getUserByUserNameResult> resultTo = dc.getUserByUserName(complaint.userto);
                RegistedUser complaintToUser = new RegistedUser();
                foreach (getUserByUserNameResult userTo in resultTo)
                {
                    complaintToUser.Address = userTo.address;
                    complaintToUser.City = userTo.city;
                    complaintToUser.Email = userTo.email;
                    complaintToUser.NickName = userTo.nickname;
                    //complaintToUser.Password = null;
                    complaintToUser.Phone = userTo.phone;
                    complaintToUser.Portrait = userTo.portraitPath;
                    //complaintToUser.School =
                    complaintToUser.UserName = userTo.id;
                    // UserZoneStyle otherStyle = new UserZoneStyle();
                    //otherStyle.ID = null;
                    // otherStyle.FileUrl = userTo.zonestyleid;
                    //complaintToUser.ZoneStyle = otherStyle;
                }
                newComplemaint.userTo = complaintToUser;

                ///////////////
                //获取发件人信息
                ISingleResult<getUserByUserNameResult> resultFrom = dc.getUserByUserName(complaint.userfrom);
                RegistedUser complaintFromUser = new RegistedUser();
                foreach (getUserByUserNameResult userFrom in resultFrom)
                {
                    complaintFromUser.Address = userFrom.address;
                    complaintFromUser.City = userFrom.city;
                    complaintFromUser.Email = userFrom.email;
                    complaintFromUser.NickName = userFrom.nickname;
                    //complaintFromUser.Password = null;
                    complaintFromUser.Phone = userFrom.phone;
                    complaintFromUser.Portrait = userFrom.portraitPath;
                    //complaintFromUser.School =
                    complaintFromUser.UserName = userFrom.id;
                    // UserZoneStyle otherStyle = new UserZoneStyle();
                    //otherStyle.ID = null;
                    // otherStyle.FileUrl = userFrom.zonestyleid;
                    //complaintFromUser.ZoneStyle = otherStyle;
                }
                newComplemaint.userFrom = complaintFromUser;
                //////////////////////
                complemaintList.Add(newComplemaint);
            }
            return complemaintList;
        }
        //发布举报26    ok
        public bool PublishComplemaint(Complemaint Complement)
        {
            bool IsSucceed = false;
            //数据访存器
            DatabaseAccess.DataClasses1DataContext DBAccessor = new DataClasses1DataContext();

            try
            {
                DBAccessor.insertComplaint(Complement.ID, Complement.userFrom.UserName, Complement.userTo.UserName, Complement.content, Complement.commodityId);

                IsSucceed = true;
            }
            catch (Exception e)
            {
                IsSucceed = false;
            }
            return IsSucceed;
        }