コード例 #1
0
        public totOutFree VerifyFree([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] inputVerifyFree inFree, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string key)
        {
            object[] results = this.Invoke("VerifyFree", new object[] {
                inFree,
                key
            });

            return((totOutFree)(results[0]));
        }
コード例 #2
0
 /// <remarks/>
 public void VerifyFreeAsync(inputVerifyFree inFree, string key, object userState)
 {
     if ((this.VerifyFreeOperationCompleted == null))
     {
         this.VerifyFreeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnVerifyFreeOperationCompleted);
     }
     this.InvokeAsync("VerifyFree", new object[] {
         inFree,
         key
     }, this.VerifyFreeOperationCompleted, userState);
 }
コード例 #3
0
 /// <remarks/>
 public void VerifyFreeAsync(inputVerifyFree inFree, string key)
 {
     this.VerifyFreeAsync(inFree, key, null);
 }
        protected void btnCallVerifyFree_Click(object sender, EventArgs e)
        {
            outArea.Style["Border"]       = "none";
            outArea.Style["Border-color"] = "#336600";

            // oggetto client per l'utilizzo del ws FILL
            var verifyFreeObj = new VerifyFreeWS.verify_free();

            // classe di input
            var inVerify = new VerifyFreeWS.inputVerifyFree
            {
                // valorizzazione input
                cap       = txtCap.Text,
                provincia = txtProv.Text,
                localita  = txtComune.Text,
                localita2 = txtFrazione.Text
            };

            // chiamata al servizio
            var outCall = verifyFreeObj.VerifyFree(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;
                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 (VerifyFreeWS.outVerifyFree 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;
                }
            }
            outArea.Style["Border"] = "groove";
        }