Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

InitPhoneAdapter : パート 2

InitPhoneAdapter のパート 2 では以下の作業を行います。

  1. アダプタの Update コマンドを作成します。

  2. AddInputParams ヘルパー・メソッドを使用して、入力パラメータを Update コマンドに追加します。

  3. アダプタの Delete コマンドを作成します。

  4. AddInputParams ヘルパー・メソッドを使用して、入力パラメータを Delete コマンドに追加します。

このメソッドの本文を、PhoneForm.csInitPhoneAdapter スタブに追加します。


...
 //Create UpdateCommand
 phoneAdapter.UpdateCommand = cnCache.CreateCommand();
 phoneAdapter.UpdateCommand.CommandText = updateSQL;

 //Add input parameters for UpdateCommand
 AddInputParams(phoneAdapter.UpdateCommand, "Number", "PhoneNumberType", "ID");

 //Create DeleteCommand
 phoneAdapter.DeleteCommand = cnCache.CreateCommand();
 phoneAdapter.DeleteCommand.CommandText = deleteSQL;

 //Add input parameters for DeleteCommand
 AddInputParams(phoneAdapter.DeleteCommand, "ID");
 }

FeedbackOpens in a new tab