/// <summary> /// 手动导入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barBtnManualImport_ItemClick(object sender, ItemClickEventArgs e) { ImportCsv importCsv = new ImportCsv(); if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { string msg = string.Empty; string file = string.Empty; Dictionary <string, Dictionary <string, string> > message = importCsv.ReadCsv(folderBrowserDialog1.SelectedPath); foreach (KeyValuePair <string, Dictionary <string, string> > item in message) { file = item.Key + "\r\n"; string error = string.Empty; foreach (KeyValuePair <string, string> kvp in item.Value) { error += String.Format("{0}\r\n{1}\r\n", kvp.Key, kvp.Value); } msg += file + error; } MessageForm mf = new MessageForm(msg); mf.Show(); this.searchLocal(); } }
/// <summary> /// 手动导入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barBtnManualImport_ItemClick(object sender, ItemClickEventArgs e) { ImportCsv importCsv = new ImportCsv(); if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) { this.progressBarControl1.Position = 0; string msg = string.Empty; string file = string.Empty; importCsv.ProgressDoing += new ProgressEventHandler(operate_ProgressDoing); importCsv.ProgressCountDoing += new ProgressCountEventHandel(importCsv_ProgressCountDoing); Dictionary <string, Dictionary <string, string> > message = importCsv.ReadCsv(folderBrowserDialog1.SelectedPath); foreach (KeyValuePair <string, Dictionary <string, string> > item in message) { file = item.Key + "\r\n"; string error = string.Empty; foreach (KeyValuePair <string, string> kvp in item.Value) { error += String.Format("{0}\r\n{1}\r\n", kvp.Key, kvp.Value); } msg += file + error; } MessageForm mf = new MessageForm(msg + "\r\n导入完成"); mf.Show(); this.searchLocal(); } }