コード例 #1
0
ファイル: Form1.cs プロジェクト: marcosgerene/Gerene.SigepWeb
        private void BtnFechaPlp_Click(object sender, EventArgs e)
        {
            string xml            = string.Empty;
            string idplpcliente   = string.Empty; // Código gerado pelo cliente para identificação da PLP.
            string cartaopostagem = "0067599079";
            string faixaetiquetas = "SZ99996640 BR,SZ99996640 BR";

            xml            = InputBox("Informe o xml da plp", xml);
            idplpcliente   = InputBox("Informe o idplp cliente", idplpcliente);
            cartaopostagem = InputBox("Informe o cartão postal", cartaopostagem);
            faixaetiquetas = InputBox("Informe a faixa de etiquetas", faixaetiquetas);

            if (string.IsNullOrEmpty(xml) || string.IsNullOrEmpty(idplpcliente) || string.IsNullOrEmpty(cartaopostagem) || string.IsNullOrEmpty(faixaetiquetas))
            {
                return;
            }

            using (var client = GetClient())
            {
                var request = new FechaPlpRequest(client)
                {
                    XmlPlp         = xml,
                    IdPlpCliente   = long.Parse(idplpcliente.ToString()),
                    CartaoPostagem = cartaopostagem,
                    FaixaEtiquetas = faixaetiquetas
                };

                _ = client.FechaPlp(request);

                TextXmlEnvio.Text    = client.XmlEnvio;
                TextXmlResposta.Text = client.XmlResposta;
            }
        }
コード例 #2
0
        public long FechaPlp(FechaPlpRequest request)
        {
            Executar("fechaPlp", request);

            var response = FechaPlpResponse.Load(XmlResposta);

            return(response.Result);
        }