using Muchinfo.MTPClient.Data.Model.News; using Muchinfo.MTPClient.IService; using System.Collections.Generic; using System.Collections.ObjectModel; namespace Muchinfo.MTPClient.Service { public class NewsService : INewsService { /// /// 获取新闻分类信息 /// /// List{NewsCategory}. /// public List GetNewsCategories() { return null; //try //{ // var url = LinkerHelper.GetNewsUrl(); // if (string.IsNullOrWhiteSpace(url)) return null; // var categroyAddress = ConfigurationManager.AppSettings["News_CategoryAddress"]; // categroyAddress = categroyAddress.TrimStart('/'); // url = url.TrimEnd('/'); // url = url + @"/" + categroyAddress; // var result = HttpUtility.HttpGet(url); // var adapter = new NewsEntityAdapter(); // return adapter.ToNewsCategories(result); //} //catch (Exception e) //{ // return null; // //throw new MuchinfoException(ExceptionManager.UnknownServiceErrorCode, e); //} } /// /// 获取新闻标题(滚动信息) /// /// /// public ObservableCollection GetNewsTitle(string classCode) { return null; //ObservableCollection newsTitleList = new ObservableCollection(); //var url = LinkerHelper.GetNewsUrl(); //if (string.IsNullOrWhiteSpace(url)) return null; //var categroyAddress = ConfigurationManager.AppSettings["News_NewsTitle"]; //categroyAddress = categroyAddress.TrimStart('/'); //url = url.TrimEnd('/'); //url = url + @"/" + categroyAddress + "?classcode=" + classCode + "&topnum=20"; //var result = HttpUtility.HttpGet(url); //var adapter = new NewsEntityAdapter(); //var list = adapter.ToNewsTitleCategories(result); //return newsTitleList = list.ToObservableCollection(); } } }