public FileDB LoadFileDB() { if (db == null) { FileInfo fileInfo = new FileInfo(this.fileDbPath); var bytes = fileInfo.ReadBinary(); db = FormatterMg.XMLDerObjectFromBytes(typeof(FileDB), bytes) as FileDB; } return db; }
public FileRepositoryBase(FileDBMgr fileDbmgr) { this.fileDbmgr = fileDbmgr; FileDB = fileDbmgr.LoadFileDB(); }
private void QueryMain_Shown(object sender, EventArgs e) { fileDbMgr = new FileDBMgr(); this.fileDb = fileDbMgr.LoadFileDB(); var recipient = this.fileDb.RecipientList.Single(x => x.ID == AppInputParameters.Current.RecipientID); this.label2.Text = string.Format("{0} {1} {2} {3} {4}", recipient.Name, recipient.CnAddress, recipient.PostCode, recipient.MainTel, recipient.OtherTels ); string bpostTempalte = "http://www.bpost2.be/bpi/track_trace/find.php?search=s&lng=en&trackcode={0}"; string dhlTemplate = "http://nolp.dhl.de/nextt-online-public/set_identcodes.do?lang=en&idc={0}&rfn=&extendedSearch=true"; this.webBrowser1.Navigate("http://www.ems.com.cn/mailtracking/you_jian_cha_xun.html"); this.wbBpost.Navigate(string.Format(bpostTempalte, AppInputParameters.Current.BpostCode)); this.wbDhl.Navigate(string.Format(dhlTemplate, AppInputParameters.Current.DHLCode)); }