private void btnConvert_Click(object sender, EventArgs e) { try { cloud.bzu.Currency res; if (!Enum.TryParse <cloud.bzu.Currency>(txtFrom.Text, out res)) { throw new ArgumentException("Please Fill a Valid Currency Simbole"); } if (!Enum.TryParse <cloud.bzu.Currency>(txtTo.Text, out res)) { throw new ArgumentException("Please Fill a Valid Currency Simbole"); } var service = new cloud.bzu.ExService(); var currencies = new cloud.bzu.currencies { FromCurrency = (cloud.bzu.Currency)Enum.Parse(typeof(cloud.bzu.Currency), txtFrom.Text), ToCurrency = (cloud.bzu.Currency)Enum.Parse(typeof(cloud.bzu.Currency), txtTo.Text) }; var result = service.CalculateExRate(currencies); lblRate.Text = txtFrom.Text + "->" + txtTo.Text + "=" + result.ToString(CultureInfo.InvariantCulture); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public float CalculateExRate([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://bzu.cloud:8080/ExProj/services/")] currencies parameters) { object[] results = this.Invoke("CalculateExRate", new object[] { parameters }); return((float)(results[0])); }
/// <remarks/> public void CalculateExRateAsync(currencies parameters, object userState) { if ((this.CalculateExRateOperationCompleted == null)) { this.CalculateExRateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCalculateExRateOperationCompleted); } this.InvokeAsync("CalculateExRate", new object[] { parameters }, this.CalculateExRateOperationCompleted, userState); }
/// <remarks/> public void CalculateExRateAsync(currencies parameters) { this.CalculateExRateAsync(parameters, null); }