public async static Task <List <InformationListModel> > GetInformationListByUserNameAsync(int pageIndex, int pageSize, string userName)
        {
            try
            {
                HttpService http     = new HttpService();
                string      response = await http.SendGetRequest(
                    InterfaceUrl.GetInformationListByUserName(pageIndex, pageSize, userName));

                if (response != string.Empty)
                {
                    JArray jsonArray = JArray.Parse(response);
                    List <InformationListModel> lstInformationList = new List <InformationListModel>();
                    foreach (var json in jsonArray)
                    {
                        InformationListModel model = new InformationListModel();
                        model.informationId  = json["informationId"].ToString();
                        model.userId         = json["userId"].ToString();
                        model.avatorUri      = json["avatorUri"].ToString();
                        model.userName       = json["userName"].ToString();
                        model.title          = json["title"].ToString();
                        model.summary        = json["summary"].ToString();
                        model.viewCount      = json["viewCount"].ToString();
                        model.publishTime    = json["publishTime"].ToString();
                        model.publishAddress = json["publishAddress"].ToString();
                        lstInformationList.Add(model);
                    }
                    return(lstInformationList);
                }
                return(null);
            }
            catch
            {
                return(null);
            }
        }
            public IList <InformationListModel> GetInformationListByAddress(int pageIndex, int pageSize, string address = "")
            {
                StringBuilder strSql = new StringBuilder();

                strSql.Append("SELECT ");
                if (pageSize > 0)
                {
                    strSql.Append("TOP " + pageSize);
                }
                strSql.Append(" dbo.Information.Id AS InformationId,dbo.Users.Id AS UserId,dbo.Users.AvatorUri,dbo.Users.UserName,dbo.Information.Title,dbo.Information.Content,dbo.Information.ViewCount,dbo.Information.AddTime,dbo.Information.Address");
                strSql.Append(" FROM dbo.Information INNER JOIN dbo.Users ON dbo.Information.UserName=dbo.Users.UserName");
                if (pageIndex > 0 && pageSize > 0)
                {
                    strSql.Append(" WHERE dbo.Information.Id NOT IN");
                    strSql.Append("(SELECT TOP " + pageSize * (pageIndex - 1));
                    strSql.Append(" Id FROM dbo.Information ORDER BY dbo.Information.AddTime DESC)");
                }
                if (address != "")
                {
                    strSql.Append(" AND Address LIKE '%");
                    strSql.Append(address + "%'");
                }
                strSql.Append(" AND IsAcceptOrder=0");
                strSql.Append(" ORDER BY dbo.Information.AddTime DESC");

                IList <InformationListModel> lstInformation = new List <InformationListModel>();

                using (SqlDataReader sdr = DBHelper.ExecuteSqlReader(strSql.ToString()))
                {
                    while (sdr.Read())
                    {
                        InformationListModel model = new InformationListModel();
                        model.informationId = sdr["InformationId"].ToString();

                        model.avatorUri = sdr["AvatorUri"].ToString();
                        model.userId    = sdr["UserId"].ToString();
                        model.title     = sdr["Title"].ToString();
                        string      xmlContent  = sdr["Content"].ToString();
                        XmlDocument xmlDocument = new XmlDocument();
                        xmlDocument.LoadXml(xmlContent);
                        XmlNode contentNode = xmlDocument.FirstChild;
                        string  content     = contentNode.InnerText;
                        if (content.Length > 30)
                        {
                            model.summary = content.Substring(0, 30);//截取30个字符作为summamry
                        }
                        else
                        {
                            model.summary = content;
                        }
                        model.viewCount      = sdr["ViewCount"].ToString();
                        model.publishTime    = sdr["AddTime"].ToString();
                        model.publishAddress = sdr["Address"].ToString();
                        lstInformation.Add(model);
                    }
                }
                return(lstInformation);
            }
 /// <summary>
 /// 初始化页面内容
 /// </summary>
 /// <param name="parameters">页面传参</param>
 private void InitPageContent(object[] parameters)
 {
     if (parameters != null)
     {
         if (parameters.Length == 1 && parameters[0] is InformationListModel)
         {
             //InformationModel中不含发布者的AvatorUri,故用InformationListModel来初始化UserAvator
             InformationListModel model  = parameters[0] as InformationListModel;
             BitmapImage          bitmap = new BitmapImage(new Uri(model.avatorUri));
             this.imgAvatar.Source = bitmap;
             inforModel            = InformationHelper.GetInformationByIdAsync(model.informationId).Result;
             if (inforModel != null)
             {
                 this.wvConent.NavigateToString(inforModel.content);
                 tbTitle.Text         = taskTitle = inforModel.title;
                 tbWage.Text          = " ¥ " + inforModel.wage;
                 linkUserName.Content = infoAuthorName = inforModel.userName;
                 tbPublishTime.Text   = " 发布于 " + inforModel.addTime;
                 tbViewCount.Text     = "(" + inforModel.viewCount + ")";
             }
         }
     }
 }