/// <summary> /// 获取数据 /// </summary> public void GetDate() { try { List <SeatManage.ClassModel.AMS_Advertisement> modelList = SeatManage.Bll.AdvertisementOperation.GetAdList(null, SeatManage.EnumType.AdType.ReaderAd); ReaderList.Clear(); foreach (SeatManage.ClassModel.AMS_Advertisement model in modelList) { SeatManage.ClassModel.ReaderAdvertInfo view = SeatManage.ClassModel.ReaderAdvertInfo.ToModel(model.AdContent); view.AdContent = model.AdContent; view.ID = model.ID; ReaderList.Add(view); } } catch (Exception ex) { ErrorMessage = ex.Message; SeatManage.SeatManageComm.WriteLog.Write("获取学校通知失败" + ex.Message); } }
public void Initialization() { ReaderList.Clear(); string filePath = (AppDomain.CurrentDomain.BaseDirectory) + @"\obj"; ReaderList.Add(new RakunNodeFor()); ReaderList.Add(new RakunNodeValue() { ModuleName = "HIGH" }); ReaderList.Add(new RakunNodeValue() { ModuleName = "LOW" }); if (System.IO.Directory.Exists(filePath) == false) { System.IO.Directory.CreateDirectory(filePath); } System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(filePath); foreach (System.IO.FileInfo f in di.GetFiles()) { if (System.IO.Path.GetExtension(f.FullName) == ".rkn") { AddRakunReader(f.FullName); } } RaisePropertyChanged("ReaderList"); //TestApplacation(); }