Пример #1
0
        private void subjectToKis()
        {
            if (this.client == null)
            {
                MessageBox.Show("请选择客户信息!");
                return;
            }

            if (this.kisDbFileParams == null || this.kisDbFileParams.DbFilePath == null)
            {
                MessageBox.Show("请选择数据库文件!");
                return;
            }
            if (this.clientSubjects == null || this.clientSubjects.Count <= 0)
            {
                MessageBox.Show("没有需要导入KIS的新科目");
                return;
            }


            KisDbFileFactory kisDbFileFactory = new KisDbFileFactory(this.kisDbFileParams);
            KisDbPref        kisDbPref        = kisDbFileFactory.getGLPref();

            try
            {
                //检查当前客户与账套信息是否一致
                if (kisDbPref.Fcompany != this.client.Fullname && kisDbPref.Fcompany != this.client.Name)
                {
                    DialogResult dr = MessageBox.Show("选择的客户与账套名称不一致,是否继续导入?", "系统提示", MessageBoxButtons.OKCancel);
                    if (dr != DialogResult.OK)
                    {
                        return;
                    }
                }
                kisDbFileFactory.exportSubject2Kis(this.clientSubjects); //引用工厂里导入新科目的方法
                ClientSubjectFactory csf = new ClientSubjectFactory();
                csf.updateIsNew(this.clientSubjects, 0);                 //引用新科目导入数据库后更新sinew和audit的状态
                this.queryClientNewSubject(this.client.Id);              //显示当前客户新会计科目的方法
                MessageBox.Show("导入新科目到KIS成功,请打开财务系统查看!");
            }
            catch (Exception e1)
            {
                MessageBox.Show("导入新科目到KIS错误!" + e1.Message);
            }
        }
Пример #2
0
 private void TestToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (this.client == null)
     {
         MessageBox.Show("请先选择客户!");
     }
     try
     {
         ClientSubjectFactory csf = new ClientSubjectFactory();
         csf.updateIsNew(this.clientSubjects, 0);
         this.queryClientNewSubject(this.client.Id);
         MessageBox.Show("设置成功!");
     }
     catch (Exception e1)
     {
         MessageBox.Show(e1.Message);
     }
 }
Пример #3
0
        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);
            }
        }