Esempio n. 1
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
            {
                MessageBox.Show("请选择公司");
                comboBox1.Focus();
                return;
            }
            if (dateStart.Value == null || dateStart.Value.ToString() == "")
            {
                MessageBox.Show("请选择开始日期");
                dateStart.Focus();
                return;
            }
            if (dateEnd.Value == null || dateEnd.Value.ToString() == "")
            {
                MessageBox.Show("请选择开结束日期");
                dateEnd.Focus();
                return;
            }

            DataRowView row = comboBox1.SelectedItem as DataRowView;

            if (row == null)
            {
                return;
            }
            string strNSRSBH          = row["NSRSBH"].ToString();
            string strSKPBH           = row["SKPBH"].ToString();;
            string strSKPPwd          = row["SKPPwd"].ToString();;
            string strCertPwd         = row["CertPwd"].ToString();;
            string strFPLXDM          = "1";//row["FPLXDM"].ToString(); ;
            int    nQueryType         = 1;
            string strQueryCondition  = dateStart.Value.ToString("yyyyMMdd") + dateEnd.Value.ToString("yyyyMMdd");
            int    nInvoiceUploadType = 0;

            string invoiceXml = string.Empty;

            try
            {
                string s = Invoice.GetInvoices(strNSRSBH, strSKPBH, strSKPPwd, strCertPwd
                                               , strFPLXDM, nQueryType, strQueryCondition, nInvoiceUploadType, sam);
                //String str2 = sam.GetInvoiceInfo("500102010001497", "499000116076", "88888888", "12345678", "025", 1, "2016110120161130", 0);
                //MessageBox.Show(str2, "系统提示3");
            }
            catch (Exception ex)
            {
                MessageBox.Show("获取发票异常:\r\n" + ex.Message);
                return;
            }


            //_DataSet = XmlConvertor.XmlToDataSet(invoiceXml);
            _DataSet = XmlConvertor.XmlToDataSet_Hei(textBox1.Text);
            dataGridView_Mst.DataSource = _DataSet.Tables["Mst"];
            dataGridView2.DataSource    = _DataSet.Tables["Item"];
        }
Esempio n. 2
0
        private void TbtnImport_HeiXml_Click(object sender, EventArgs e)
        {
            DataSet dataSet = XmlConvertor.ImportXmlToDataTable_Hei();

            if (dataSet != null)
            {
                dataGridView_Mst.DataSource = dataSet.Tables[0];
                dataGridView2.DataSource    = dataSet.Tables[1];

                toolStripStatusLabel1.Text = string.Format("记录数:{0}   总金额:{1}"
                                                           , dataSet.Tables[0].Rows.Count
                                                           , dataSet.Tables[0].Compute("sum(jshj)", ""));
            }
        }
Esempio n. 3
0
        public FormInvoiceExport()
        {
            InitializeComponent();
            InitialToolsTrip();

            try
            {
                sam = new BWJF_SKOP_ATLLib.SKControlLogic();
            }
            catch (Exception ex)
            {
                MessageBox.Show("加载税控盘接口失败:\r\n" + ex.Message);
            }

            comboBox1.DataSource    = Company.GetData();
            comboBox1.DisplayMember = "company";
            comboBox1.ValueMember   = "NSRSBH";

            dataGridView_Mst.SelectionChanged += DataGridView1_SelectionChanged;

            _DataSet = XmlConvertor.InitInvoiceDataTable();
        }