Пример #1
0
        private void initSubjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.accset == null)
            {
                MessageBox.Show("请先选择账套!");
                return;
            }

            if (this.client == null)
            {
                MessageBox.Show("请先选择客户!");
                return;
            }

            try
            {
                Sd3000Factory sdf = new Sd3000Factory();
                sdf.initSubjectBySd3000(this.accset, this.client, Session.GetInstance().User);
                MessageBox.Show("初始化成功,请打开小微服查看!");
            }
            catch (Exception e1)
            {
                Console.WriteLine(e1.StackTrace);
                MessageBox.Show(e1.Message);
            }
        }
Пример #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (this.dbIpTextBox.Text == "" || this.dbIpTextBox.Text == null)
            {
                MessageBox.Show("请输入账套服务器地址!");
                return;
            }

            if (this.dbUserTextBox.Text == "" || this.dbUserTextBox.Text == null)
            {
                MessageBox.Show("请输入账套数据库用户名!");
                return;
            }
            if (this.dbPasswordTextBox.Text == null)
            {
                this.dbPasswordTextBox.Text = "";
            }

            Sd3000Factory sdfactory = new Sd3000Factory();

            try
            {
                List <Sd3000Accset> accsetList = sdfactory.queryAccset(this.dbUserTextBox.Text, this.dbPasswordTextBox.Text, this.dbIpTextBox.Text, "SD11001N_");
                this.accset = CommonManager.selectAccset(accsetList);
                if (this.accset != null)
                {
                    this.accsetNameTextBox.Text = this.accset.Corpname + "[" + this.accset.DbName + "]";
                }
            }
            catch (Exception e1)
            {
                Console.WriteLine(e1.StackTrace);
                MessageBox.Show(e1.Message);
            }
        }
Пример #3
0
        private void connectTest()
        {
            if (this.accset == null)
            {
                MessageBox.Show("请选择账套!");
                return;
            }

            try
            {
                Sd3000Factory factory = new Sd3000Factory();
                factory.connectTest(this.accset);
                MessageBox.Show("连接成功!");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Пример #4
0
        private void initSubjectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.accset == null)
            {
                MessageBox.Show("请先选择账套!");
                return;
            }

            if (this.client == null)
            {
                MessageBox.Show("请先选择客户!");
                return;
            }
            if (this.accset.Corpname != this.client.Fullname)
            {
                DialogResult dr = MessageBox.Show("选择的客户与账套名称不一致,是否继续初始化?", "系统提示", MessageBoxButtons.OKCancel);

                if (dr != DialogResult.OK)
                {
                    return;
                }
            }

            try
            {
                this.InformationTextBox.Visible = true;               //打开提示框
                this.InformationTextBox.Text    = "正在初始化会计科目!请稍等……";  //提示文本
                this.InformationTextBox.Font    = new Font("宋体", 12); //提示字体

                Sd3000Factory sdf = new Sd3000Factory();
                sdf.initSubjectBySd3000(this.accset, this.client, Session.GetInstance().User);

                this.InformationTextBox.Visible = false;//关闭提示框

                MessageBox.Show("初始化成功,请打开小微服查看!");
            }
            catch (Exception e1)
            {
                Console.WriteLine(e1.StackTrace);
                this.InformationTextBox.Visible = false;//关闭提示框
                MessageBox.Show(e1.Message);
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
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);
            }
        }