/// <summary>削除処理</summary> async private void button9_Click(object sender, RoutedEventArgs e) { // 引数1:コンテキスト string context = "User1"; // 引数2:アクションタイプ string actionType = ((ComboBoxItem)this.ddlDap.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode1.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode2.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlExRollback.SelectedItem).Value; // Soap & Bean の個別WebメソッドのWeb参照 SbServiceReference.ServiceForSbSoapClient client = new SbServiceReference.ServiceForSbSoapClient(); // 非同期呼出しを行う SbServiceReference.DeleteResponse response = await client.DeleteAsync(context, actionType, int.Parse(this.textBox1.Text)); if (response.Body.DeleteResult != "") { // 例外発生時 WSErrorInfo wse = new WSErrorInfo(response.Body.DeleteResult); this.labelMessage.Text = response.Body.DeleteResult + " , " + response.Body.returnValue + " , " + wse.MessageID + " , " + wse.Message + " , " + wse.Information; } else { // 結果(正常系) this.labelMessage.Text = response.Body.returnValue + "件削除"; } }
/// <summary>参照処理</summary> /// <remarks> /// 非同期フレームワークを使用してB層の呼び出し処理を非同期化 /// (結果表示にだけ匿名デリゲードを使用するパターン) /// </remarks> async private void button6_Click(object sender, RoutedEventArgs e) { // 引数1:コンテキスト string context = "User1"; // 引数2:アクションタイプ string actionType = ((ComboBoxItem)this.ddlDap.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode1.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode2.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlExRollback.SelectedItem).Value; // Soap & Bean の個別WebメソッドのWeb参照 SbServiceReference.ServiceForSbSoapClient client = new SbServiceReference.ServiceForSbSoapClient(); // 非同期呼出しを行う SbServiceReference.SelectResponse response = await client.SelectAsync(context, actionType, int.Parse(this.textBox1.Text)); if (response.Body.SelectResult != "") { // 例外発生時 WSErrorInfo wse = new WSErrorInfo(response.Body.SelectResult); this.labelMessage.Text = response.Body.SelectResult + " , " + response.Body.returnValue + " , " + wse.MessageID + " , " + wse.Message + " , " + wse.Information; } else { // 結果(正常系) // データバインド(ToDataSourceでは、削除行を除いたリストを返す) SbServiceReference.Shipper shipper = response.Body.returnValue; this.textBox2.Text = shipper.CompanyName; this.textBox3.Text = shipper.Phone; } }
/// <summary>一覧取得(動的sql)</summary> async private void button5_Click(object sender, RoutedEventArgs e) { // 引数1:コンテキスト string context = "User1"; // 引数2:アクションタイプ string actionType = ((ComboBoxItem)this.ddlDap.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode1.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode2.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlExRollback.SelectedItem).Value; // Soap & Bean の個別WebメソッドのWeb参照 SbServiceReference.ServiceForSbSoapClient client = new SbServiceReference.ServiceForSbSoapClient(); // 非同期呼出しを行う SbServiceReference.SelectAll_DSQLResponse response = await client.SelectAll_DSQLAsync(context, actionType, ((ComboBoxItem)this.ddlOrderColumn.SelectedItem).Value, ((ComboBoxItem)this.ddlOrderSequence.SelectedItem).Value); if (response.Body.SelectAll_DSQLResult != "") { // 例外発生時 WSErrorInfo wse = new WSErrorInfo(response.Body.SelectAll_DSQLResult); this.labelMessage.Text = response.Body.SelectAll_DSQLResult + " , " + response.Body.returnValue + " , " + wse.MessageID + " , " + wse.Message + " , " + wse.Information; } else { // 結果(正常系) // データバインド(ToDataSourceでは、削除行を除いたリストを返す) this.ListView1.ItemsSource = response.Body.returnValue; } }
/// <summary>更新処理</summary> private void button8_Click(object sender, RoutedEventArgs e) { // 引数1:コンテキスト string context = "User1"; // 引数2:アクションタイプ string actionType = ((ComboBoxItem)this.ddlDap.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode1.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode2.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlExRollback.SelectedItem).Value; // Soap & Bean の個別WebメソッドのWeb参照 SbServiceReference.ServiceForSbSoapClient client = new SbServiceReference.ServiceForSbSoapClient(); SbServiceReference.Shipper shipper = new SbServiceReference.Shipper(); shipper.ShipperID = int.Parse(this.textBox1.Text); shipper.CompanyName = this.textBox2.Text; shipper.Phone = this.textBox3.Text; // 呼び出しが完了した場合のイベントハンドラを設定する。 client.UpdateCompleted += new EventHandler <SbServiceReference.UpdateCompletedEventArgs>(client_Update_CallCompleted); // 非同期呼出しを行う(Silverlightは非同期呼び出しのみサポートする)。 client.UpdateAsync(context, actionType, shipper); }
/// <summary>追加処理</summary> private void button7_Click(object sender, RoutedEventArgs e) { // 引数1:コンテキスト string context = "User1"; // 引数2:アクションタイプ string actionType = ((ComboBoxItem)this.ddlDap.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode1.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode2.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlExRollback.SelectedItem).Value; // Soap & Bean の個別WebメソッドのWeb参照 SbServiceReference.ServiceForSbSoapClient client = new SbServiceReference.ServiceForSbSoapClient(); // 呼び出しが完了した場合のイベントハンドラを設定する。 client.InsertCompleted += new EventHandler <SbServiceReference.InsertCompletedEventArgs>(client_Insert_CallCompleted); // 非同期呼出しを行う(Silverlightは非同期呼び出しのみサポートする)。 client.InsertAsync(context, actionType, this.textBox2.Text, this.textBox3.Text); }
/// <summary>削除処理</summary> private void button9_Click(object sender, RoutedEventArgs e) { // 引数1:コンテキスト string context = "User1"; // 引数2:アクションタイプ string actionType = ((ComboBoxItem)this.ddlDap.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode1.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlMode2.SelectedItem).Value + "%" + ((ComboBoxItem)this.ddlExRollback.SelectedItem).Value; // Soap & Bean の個別WebメソッドのWeb参照 SbServiceReference.ServiceForSbSoapClient client = new SbServiceReference.ServiceForSbSoapClient(); // 呼び出しが完了した場合のイベントハンドラを設定する。 client.DeleteCompleted += new EventHandler<SbServiceReference.DeleteCompletedEventArgs>(client_Delete_CallCompleted); // 非同期呼出しを行う(Silverlightは非同期呼び出しのみサポートする)。 client.DeleteAsync(context, actionType, int.Parse(this.textBox1.Text)); }