/// <summary> /// 设定导出文件 /// </summary> /// <returns></returns> private string SelectExportFile() { string tmpPath = ""; try { this.saveFileDialog1.Filter = "Excel文件(*.xls)|*.xls|dbf文件(*.dbf)|*.dbf|文本文件(*.txt)|*.txt|所有文件 (*.*)|*.*"; this.saveFileDialog1.InitialDirectory = System.Windows.Forms.Application.StartupPath; this.saveFileDialog1.RestoreDirectory = true; this.saveFileDialog1.FileName = ""; if (this.saveFileDialog1.ShowDialog() == DialogResult.OK) { if (this.saveFileDialog1.FileName == "") { MessageBox.Show("请设置到货导出文件!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(""); } return(this.saveFileDialog1.FileName); } } catch (Exception e) { EmedErrorLog.SaveLog("选择导出到货文件", e); tmpPath = ""; } return(tmpPath); }
/// <summary> /// 保存产品对照信息 /// </summary> private void SaveProductHis() { try { ArrayList list1 = new ArrayList(); for (int num1 = 0; num1 < this.dataGridView.RowCount; num1++) { DataGridViewRow row1 = this.dataGridView.Rows[num1]; Emedchina.TradeAssistant.Model.User.LogedInUser usr = ClientSession.GetInstance().CurrentUser; string boolstr; if (row1.Cells[0].Value != null && row1.Cells[0].Value.ToString().ToLower() == "true") { boolstr = "True"; } else { boolstr = "False"; } string orgId = row1.Cells["ORG_ID"].Value.ToString(); if (boolstr == "True") //&& !string.IsNullOrEmpty(orgId) { if (bll.IsExistCode(row1.Cells["CODE"].Value.ToString(), usr.UserOrg.Reg_org_id.ToString())) { list1.Add(bll.UpdateHisEnterpriseMapSQL(row1, row1.Cells["CODE"].Value.ToString(), base.CurrentUserId, usr.UserOrg.Reg_org_id.ToString())); } else { list1.Add(bll.InsertHisEnterpriseMapSQL(row1, base.CurrentUserId, usr.UserOrg.Reg_org_id.ToString())); } } } if (list1.Count < 1) { return; } string[] textArray1 = new string[list1.Count]; list1.CopyTo(textArray1); if (bll.HisOperation(textArray1)) { //this.IsSave = true; EmedMessageBox.ShowInformation("保存成功!"); } else { EmedMessageBox.ShowInformation("保存失败!"); } } catch (Exception exception1) { EmedErrorLog.SaveLog("保存失败", exception1); } }
//"进销存"对接的基础信息导出功能 2007-8-28 shangfu /// <summary> /// 设定导出成文本文件 /// </summary> /// <returns></returns> private string SelectExporFile(string txtFileName) { string strFile = ""; try { this.saveFileDialog1.Filter = "Excel文件(*.xls)|*.xls|文本文件(*.txt)|*.txt|dbf文件(*.dbf)|*.dbf|所有文件 (*.*)|*.*"; this.saveFileDialog1.FileName = txtFileName; this.saveFileDialog1.RestoreDirectory = true; //this.saveFileDialog1.FileName = ""; //this.saveFileDialog1.RestoreDirectory = true; if (this.saveFileDialog1.ShowDialog() == DialogResult.OK) { if (this.saveFileDialog1.FileName == "") { MessageBox.Show("请设置到货导出文件!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(""); } return(this.saveFileDialog1.FileName); //return this.saveFileDialog1.FileName; } else { this.saveFileDialog1.FileName = ""; } } catch (Exception e) { EmedErrorLog.SaveLog("选择导出到货文件", e); } return(this.saveFileDialog1.FileName); }