コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int     iCurrentItemId = gridView1.FocusedRowHandle;
            DataRow row            = gridView1.GetDataRow(iCurrentItemId);
            string  sInvSeqId      = Convert.ToString(row["INVSEQID"]);
            string  sIvoiceCode    = Convert.ToString(row["INVOICECODE"]);
            string  sIvoiceNo      = Convert.ToString(row["INVOICENO"]);

            string sResult = "";
            string sUrl    = "http://localhost:8081";

            //string sJson = "fpdm=3200182130&fphm=64003515&qdbj=0&dysz=1";
            string sJson = "fpdm=" + sIvoiceCode + "&fphm=" + sIvoiceNo;

            sResult = PublicUtility.PostJson(sUrl, sJson);
            ToJsonMy oToJsonMy = PublicUtility.JsonMy(sResult);

            if (oToJsonMy.result == "True" && oToJsonMy.data == "成功")
            {
                PrintBill(sInvSeqId);
            }
            else
            {
                MessageBox.Show(oToJsonMy.data + "-" + oToJsonMy.result);
            }

            //PrintBill(sInvSeqId);
            //HttpRequest.PostAsyncJson(sUrl, sJson);
        }