public totOutVerify Verify([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] inputCommon inVerify, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string key)
        {
            object[] results = this.Invoke("Verify", new object[] {
                inVerify,
                key
            });

            return((totOutVerify)(results[0]));
        }
 /// <remarks/>
 public void VerifyAsync(inputCommon inVerify, string key, object userState)
 {
     if ((this.VerifyOperationCompleted == null))
     {
         this.VerifyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnVerifyOperationCompleted);
     }
     this.InvokeAsync("Verify", new object[] {
         inVerify,
         key
     }, this.VerifyOperationCompleted, userState);
 }
Beispiel #3
0
        protected void btnCallVerify_Click(object sender, EventArgs e)
        {
            outArea.Style["Border"]       = "none";
            outArea.Style["Border-color"] = "#336600";

            // oggetto client per l'utilizzo del ws FILL
            var verifyObj = new VerifyWS.verify();

            // classe di input
            var inVerify = new VerifyWS.inputCommon
            {
                // valorizzazione input
                cap       = txtCap.Text,
                provincia = txtProv.Text,
                localita  = txtComune.Text,
                localita2 = txtFrazione.Text,
                indirizzo = txtIndirizzo.Text
            };

            // chiamata al servizio
            var outCall = verifyObj.Verify(inVerify, txtKey.Text);


            if (outCall.norm == 1)
            {
                // verifica OK
                txtCap.Text       = outCall.outItem[0].cap;
                txtProv.Text      = outCall.outItem[0].provincia;
                txtComune.Text    = outCall.outItem[0].comune;
                txtFrazione.Text  = outCall.outItem[0].frazione;
                txtIndirizzo.Text = outCall.outItem[0].indirizzo;
                outArea.InnerHtml = "<p><font color=\"green\">INDIRIZZO VALIDO</font></p>";
            }
            else
            {
                // verifica KO, gestione errore

                // errore di licenza
                if (outCall.codErr == 997)
                {
                    outArea.InnerHtml = "<p><font color=\"red\">LICENSE KEY NON RICONOSCIUTA</font></p>";
                }
                else if (outCall.codErr == 123)
                {
                    outArea.InnerHtml = "<p><font color=\"red\">NON E' STATO VALORIZZATO IL COMUNE</font></p>";
                }
                else if (outCall.codErr == 124)
                {
                    outArea.InnerHtml = "<p><font color=\"red\">COMUNE\\FRAZIONE NON RICONOSCIUTO</font></p>";
                }
                else if (outCall.codErr == 125)
                {
                    var htmlOut = "<p><font color=\"red\">COMUNE\\FRAZIONE AMBIGUO</font></p>";

                    htmlOut += "<table>";
                    foreach (VerifyWS.outVerify outElem in outCall.outItem)
                    {
                        htmlOut += "<tr><td>";

                        htmlOut += outElem.cap + " " + outElem.comune + " " + outElem.provincia;
                        if (outElem.frazione != string.Empty)
                        {
                            htmlOut += " - " + outElem.frazione;
                        }
                        htmlOut += "</td></tr>";
                    }
                    htmlOut          += "</table>";
                    outArea.InnerHtml = htmlOut;
                }
                else if (outCall.codErr == 466)
                {
                    txtCap.Text       = outCall.outItem[0].cap;
                    txtProv.Text      = outCall.outItem[0].provincia;
                    txtComune.Text    = outCall.outItem[0].comune;
                    txtFrazione.Text  = outCall.outItem[0].frazione;
                    outArea.InnerHtml = "<p><font color=\"red\">NON E' STATO VALORIZZATO L'INDIRIZZO</font></p>";
                }
                else if (outCall.codErr == 467)
                {
                    txtCap.Text       = outCall.outItem[0].cap;
                    txtProv.Text      = outCall.outItem[0].provincia;
                    txtComune.Text    = outCall.outItem[0].comune;
                    txtFrazione.Text  = outCall.outItem[0].frazione;
                    outArea.InnerHtml = "<p><font color=\"red\">INDIRIZZO NON RICONOSCIUTO</font></p>";
                }
                else if (outCall.codErr == 468)
                {
                    txtCap.Text    = outCall.outItem[0].cap;
                    txtProv.Text   = outCall.outItem[0].provincia;
                    txtComune.Text = outCall.outItem[0].comune;

                    var htmlOut = "<p><font color=\"red\">INDIRIZZO AMBIGUO</font></p>";
                    htmlOut += "<table>";
                    foreach (VerifyWS.outVerify outElem in outCall.outItem)
                    {
                        htmlOut += "<tr><td>";

                        htmlOut += outElem.cap + " " + outElem.indirizzo;
                        if (outElem.frazione != string.Empty)
                        {
                            htmlOut += " (" + outElem.frazione + ")";
                        }
                        htmlOut += "</td></tr>";
                    }
                    htmlOut          += "</table>";
                    outArea.InnerHtml = htmlOut;
                }
                else if (outCall.codErr == 455)
                {
                    txtCap.Text       = outCall.outItem[0].cap;
                    txtProv.Text      = outCall.outItem[0].provincia;
                    txtComune.Text    = outCall.outItem[0].comune;
                    txtFrazione.Text  = outCall.outItem[0].frazione;
                    txtIndirizzo.Text = outCall.outItem[0].indirizzo;
                    outArea.InnerHtml = "<p><font color=\"red\">CAP INCONGRUENTE SU VIA MULTICAP</font></p>";
                }
            }
            outArea.Style["Border"] = "groove";
        }
 /// <remarks/>
 public void VerifyAsync(inputCommon inVerify, string key)
 {
     this.VerifyAsync(inVerify, key, null);
 }