public string GetNoticeList(int pageIndex, int pageSize, string username) { try { WebSecurityService wsClient = new WebSecurityService(); object userId = wsClient.GetUserId(username); if (userId == null) { return(""); } int totalRecords = 0; Notice bll = new Notice(); var list = bll.GetMyNotice(pageIndex, pageSize, out totalRecords, userId); if (list == null || list.Count == 0) { return(""); } StringBuilder sb = new StringBuilder(); sb.Append("<Rsp>"); foreach (var model in list) { sb.Append("<N>"); sb.AppendFormat("<Id>{0}</Id><Title>{1}</Title><AdTime>{2}</AdTime><Descr>{3}</Descr>", model.Id, model.Title, model.LastUpdatedDate.ToString("yyyy-MM-dd HH:mm"), model.Descr); sb.Append("</N>"); } sb.Append("</Rsp>"); return(sb.ToString()); } catch { return(""); } }