Esempio n. 1
0
    private void showResults(ReturnValue rv)
    {
      this.pnlSuccess.Visibility = ((rv == null) || (!rv.Success)) ? Visibility.Collapsed : Visibility.Visible;
      this.pnlError.Visibility = ((rv == null) || (string.IsNullOrEmpty(rv.ErrorMessage))) ? Visibility.Collapsed : Visibility.Visible;
      this.pnlEOR.Visibility = ((rv == null) || (string.IsNullOrEmpty(rv.UniqueInvoiceID))) ? Visibility.Collapsed : Visibility.Visible;
      this.pnlZOI.Visibility = ((rv == null) || (string.IsNullOrEmpty(rv.ProtectedID))) ? Visibility.Collapsed : Visibility.Visible;
      this.pnlBarcode.Visibility = ((rv == null) || (rv.BarCodes == null)) ? Visibility.Collapsed : Visibility.Visible;
      this.pnlBarcode1.Visibility = this.pnlBarcode.Visibility;

      this.pnlResult.Visibility = ((this.pnlSuccess.Visibility == Visibility.Visible) ||
                                   (this.pnlError.Visibility == Visibility.Visible) ||
                                   (this.pnlEOR.Visibility == Visibility.Visible) ||
                                   (this.pnlZOI.Visibility == Visibility.Visible) ||
                                   (this.pnlBarcode.Visibility == Visibility.Visible)) ? Visibility.Visible : Visibility.Collapsed;
    }
Esempio n. 2
0
    private void procesReturnValue(ReturnValue rv)
    {
      if (rv.MessageSendToFurs != null) this.tbToFurs.Text = this.prettyXml(rv.MessageSendToFurs);
      if (rv.MessageReceivedFromFurs != null) this.tbFromFurs.Text = this.prettyXml(rv.MessageReceivedFromFurs);

      this.tbError.Text = rv.ErrorMessage;
      this.tbEOR.Text = rv.UniqueInvoiceID;
      this.tbZOI.Text = rv.ProtectedID;
      this.tbBarcode.Text = string.Empty;

      if (rv.BarCodes != null)
      {
        this.tbBarcode.Text = rv.BarCodes.BarCodeValue;

        //// in xaml this is better option, but with rv.BarCodes.DrawQRCode, the usage case of the library is clearer
        //// this.imgBarcode.Text = this.tbBarcode.Text;

        Image img = rv.BarCodes.DrawQRCode(180, ImageFormat.Png);
        this.imgBarcode.Source = this.convertDrawingImageToWPFImage(img);
      }

      this.showResults(rv);
    }