Beispiel #1
0
        private void btnWebUltimoComprobante_Click(object sender, EventArgs e)
        {
            Cursor.Current           = Cursors.WaitCursor;
            txtWebUltimoNroComp.Text = "";
            txtWebUltimoNroComp.Refresh();
            XmlDocument xmlEmpresa = new XmlDocument();

            xmlEmpresa.Load(txtWebXmlEmpresa.Text);
            XmlDocument xmlComprobante = new XmlDocument();

            xmlComprobante.Load(txtWebXmlComprobante.Text);
            localhost.MFDWebService mfdWebService = new localhost.MFDWebService();
            //TestMFDService.LocalMFDWebService.MFDWebService mfdWebService = new TestMFDService.LocalMFDWebService.MFDWebService();
            //mfdWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            int?ultimoNro = mfdWebService.GetUltimoNroComprobante(xmlEmpresa, xmlComprobante);

            if (ultimoNro.HasValue)
            {
                txtWebUltimoNroComp.Text = ultimoNro.Value.ToString();
            }
            else
            {
                txtWebUltimoId.Text = "No se pudo obtener el último Id";
            }
            Cursor.Current = Cursors.Default;
        }
Beispiel #2
0
        private void btnWebCAE_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            try
            {
                XmlDocument xmlEmpresa = new XmlDocument();
                xmlEmpresa.Load(txtWebXmlEmpresa.Text);
                XmlDocument xmlComprobante = new XmlDocument();
                xmlComprobante.Load(txtWebXmlComprobante.Text);

                string error, nroComprobante, cae;
                txtWebCAE.Text            = "";
                txtWebError.Text          = "";
                txtWebNroComprobante.Text = "";

                //TestMFDService.LocalMFDWebService.MFDWebService mfdWebService = new TestMFDService.LocalMFDWebService.MFDWebService();
                localhost.MFDWebService mfdWebService  = new localhost.MFDWebService();
                localhost1.Service1     mfdWebService1 = new localhost1.Service1();
                mfdWebService1.Credentials = System.Net.CredentialCache.DefaultCredentials;


                //localhost.MFDWebService mfdWebService = new localhost.MFDWebService();
                mfdWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                //mfdWebService.Timeout = 1000000;
                cae = mfdWebService1.GetCAE(xmlEmpresa, xmlComprobante, out error, out nroComprobante);
                //cae = mfdWebService.GetCAE(xmlEmpresa, xmlComprobante, out error, out nroComprobante);
                txtWebCAE.Text            = cae;
                txtWebError.Text          = error;
                txtWebNroComprobante.Text = nroComprobante;
            }
            catch (Exception ex) {
                txtWebError.Text = ex.Message;
            }
            Cursor.Current = Cursors.Default;
        }