private void exports(string categoryname) { ExportBean exportBean = new ExportBean(); if (this.inst == null || this.inst.Id == null) { MessageBox.Show("无法获取当前机构信息!"); return; } if (this.user == null || this.user.Id == null) { MessageBox.Show("无法获取当前用户信息!"); return; } if (this.client == null || this.client.Id == null) { MessageBox.Show("请选择客户信息!"); return; } if (this.accountcycle == null || this.accountcycle.Sn == null) { MessageBox.Show("请选择月份!"); return; } exportBean.Instid = this.inst.Id; exportBean.Clientid = this.client.Id; exportBean.Accountcyclesn = this.accountcycle.Sn; exportBean.Createby = this.user.Id; exportBean.Categoryname = categoryname; SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.InitialDirectory = "c:\\";//注意这里写路径时要用c:\\而不是c:\ saveFileDialog.Filter = "DBF文件 (*.dbf)|*.dbf"; saveFileDialog.RestoreDirectory = true; saveFileDialog.FilterIndex = 1; if (saveFileDialog.ShowDialog() == DialogResult.OK) { exportBean.Path = System.IO.Path.GetDirectoryName(saveFileDialog.FileName); exportBean.FileName = System.IO.Path.GetFileName(saveFileDialog.FileName); } else { return; } try { exportKis.exports(exportBean); }catch (Exception e) { MessageBox.Show("导出凭证时出现错误:" + e.Message); } }
private void exports(string categoryname) { ExportBean exportBean = new ExportBean(); if (this.inst == null || this.inst.Id == null) { MessageBox.Show("无法获取当前机构信息"); } if (this.client == null || this.client.Id == null) { MessageBox.Show("无法获取当前客户信息"); } if (this.accountcycle == null || this.accountcycle.Id == null) { MessageBox.Show("无法获取当前月份信息"); } if (this.user == null || this.user.Id == null) { MessageBox.Show("无法获取当前用户信息"); } if (this.accset == null) { MessageBox.Show("请选择账套信息"); } if (accset.CAcc_Name != client.Name && accset.CAcc_Name != client.Fullname) { DialogResult dr = MessageBox.Show("选择的客户与账套名称不一致,是否继续导入?", "系统提示", MessageBoxButtons.OKCancel); if (dr != DialogResult.OK) { return; } } exportBean.Instid = this.inst.Id; exportBean.Clientid = this.client.Id; exportBean.Categoryname = categoryname; exportBean.Createby = this.user.Id; exportBean.Accountcyclesn = this.accountcycle.Sn; try { this.InformationTextBox.Text = "正在导出凭证,请稍等……"; this.InformationTextBox.Visible = true; this.InformationTextBox.Font = new Font("宋体", 12); if (this.InformationTextBox.Visible == true) { YYT3Factory yYT3Factory = new YYT3Factory(); yYT3Factory.exports(exportBean, this.accset, this.inst, this.client, this.user, this.accountcycle, categoryname); } this.InformationTextBox.Visible = false; MessageBox.Show("凭证导出成功!请登录财务系统查看结果!"); } catch (Exception e) { this.InformationTextBox.Visible = false; Console.WriteLine(e.StackTrace); MessageBox.Show(e.Message); } }
public void exports(ExportBean exportBean) { try { KisVoucherFactory kvf = new KisVoucherFactory(); List <KisVoucherInfo> vouchers = kvf.getKisVoucher(exportBean.Instid, exportBean.Clientid, exportBean.Accountcyclesn, exportBean.Createby, exportBean.Categoryname); this.Create(exportBean.Path, exportBean.FileName); this.Save(exportBean.Path, exportBean.FileName, vouchers); MessageBox.Show("导出成功!"); } catch (Exception e) { Console.WriteLine(e.StackTrace); MessageBox.Show("导出错误:" + e.Message); } }
public void exports(ExportBean exportBean) { try { JObject results = getData(exportBean.Instid, exportBean.Clientid, exportBean.Accountcyclesn, exportBean.Createby, exportBean.Categoryname); JObject datas = (JObject)results["datas"]; List <KisVoucherInfo> vouchers = buildData(results); this.Create(exportBean.Path, exportBean.FileName); this.Save(exportBean.Path, exportBean.FileName, vouchers); MessageBox.Show("导出成功!"); } catch (Exception e) { Console.WriteLine(e.StackTrace); MessageBox.Show("导出错误:" + e.Message); } }
private void exports(string categoryname) { ExportBean exportBean = new ExportBean(); if (this.inst == null || this.inst.Id == null) { MessageBox.Show("无法获取当前机构信息!"); return; } if (this.user == null || this.user.Id == null) { MessageBox.Show("无法获取当前用户信息!"); return; } if (this.client == null || this.client.Id == null) { MessageBox.Show("请选择客户信息!"); return; } if (this.accountcycle == null || this.accountcycle.Sn == null) { MessageBox.Show("请选择月份!"); return; } if (this.accset == null) { MessageBox.Show("请选择账套!"); return; } if (this.accset.Corpname != this.client.Fullname) { DialogResult dr = MessageBox.Show("选择的客户与账套名称不一致,是否继续导入?", "系统提示", MessageBoxButtons.OKCancel); if (dr != DialogResult.OK) { return; } } exportBean.Instid = this.inst.Id; exportBean.Clientid = this.client.Id; exportBean.Accountcyclesn = this.accountcycle.Sn; exportBean.Createby = this.user.Id; exportBean.Categoryname = categoryname; try { Sd3000Factory factory = new Sd3000Factory(); factory.exports(exportBean, this.accset); MessageBox.Show("凭证导出成功!请登录财务系统查看结果!"); } catch (Exception e) { Console.WriteLine(e.StackTrace); MessageBox.Show(e.Message); } }
private void exportSubject() { ExportBean exportBean = new ExportBean(); if (this.inst == null || this.inst.Id == null) { MessageBox.Show("无法获取当前机构信息!"); return; } if (this.user == null || this.user.Id == null) { MessageBox.Show("无法获取当前用户信息!"); return; } if (this.client == null || this.client.Id == null) { MessageBox.Show("请选择客户信息!"); return; } if (this.accountcycle == null || this.accountcycle.Sn == null) { MessageBox.Show("请选择月份!"); return; } if (this.accset == null) { MessageBox.Show("请选择账套!"); return; } if (this.accset.Corpname != this.client.Fullname) { DialogResult dr = MessageBox.Show("选择的客户与账套名称不一致,是否继续导入?", "系统提示", MessageBoxButtons.OKCancel); if (dr != DialogResult.OK) { return; } } exportBean.Instid = this.inst.Id; exportBean.Clientid = this.client.Id; exportBean.Accountcyclesn = this.accountcycle.Sn; exportBean.Createby = this.user.Id; try { Sd3000Factory factory = new Sd3000Factory(); factory.exportsSubject(exportBean, this.accset); ClientSubjectFactory csf = new ClientSubjectFactory(); csf.updateIsNew(this.clientSubjects, 0); this.queryClientNewSubject(this.client.Id); MessageBox.Show("科目导出成功!请登录财务系统查看结果!"); } catch (Exception e) { MessageBox.Show(e.Message); } }