private void bt_Excel_Click(object sender, EventArgs e) { try { if (iasyncresultExcel != null && !iasyncresultExcel.IsCompleted) { MessageBoxEx.Show("程序还在运作中,请稍后...."); return; } FrmPartInfo fpi = new FrmPartInfo(this); if (fpi.ShowDialog() != DialogResult.Yes) { return; } OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "请选择转换后的Excel"; ofd.Filter = "Excel_2003|*.xls"; ofd.Multiselect = true; ofd.ShowDialog(); eventsaveExcelsmtsoftkplist = new delegatesaveExcelsmtsoftkplist(SaveExcelSmtSoftKpList); iasyncresultExcel = eventsaveExcelsmtsoftkplist.BeginInvoke(ofd.FileNames, null, null); } catch (Exception ex) { this.ShowMsg(LogMsgType.Error, ex.Message); } }
private void btsmtsoft_Click(object sender, EventArgs e) { try { if (iasyncresult != null && !iasyncresult.IsCompleted) { MessageBoxEx.Show("程序还在运作中,请稍后...."); return; } this.mProductname = string.Empty; this.mPartnumber = string.Empty; this.mLineId = string.Empty; FrmPartInfo fpi = new FrmPartInfo(this); if (fpi.ShowDialog() != DialogResult.Yes) { return; } OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "请选择SMT程式"; ofd.Filter = "(*.txt 文本文件)|*.txt|(*.CSV 文件)|*.CSV"; ofd.Multiselect = true; //ofd.InitialDirectory = "c:\\"; DialogResult dlr = ofd.ShowDialog(); if (dlr == DialogResult.Yes || dlr == DialogResult.OK) { //string Err = string.Empty; //this.dataGridView2.DataSource = FrmBLL.publicfuntion.LoadCSV(ofd.FileNames, "080106",out Err); eventsavesmtsoftkplist = new delegatesavesmtsoftkplist(SaveSmtSoftKpList); iasyncresult = eventsavesmtsoftkplist.BeginInvoke(ofd.FileNames, this.mLineId, null, null); } } catch (Exception ex) { this.ShowMsg(LogMsgType.Error, ex.Message); } }