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?

AddContact

AddContact メソッドを使用すると、現在 [連絡先情報の編集] パネルに表示されているデータを使用して、新しい Contact インスタンスを作成できます。このメソッドは、[作成] ボタンのイベント・ハンドラによって呼び出されます。 具体的には、AddContact は、次のような動作をします。

  1. curContactContact オブジェクトを参照した場合は、オブジェクトを閉じ、その参照を NULL に設定します。

  2. 新しい Contact オブジェクトをインスタンス化します。

  3. Update メソッドを呼び出します。

完成したメソッドは以下のとおりです。このメソッドの本文を、PhoneFormObj.csAddContact スタブに追加します。


private void AddContact
{
  if (curContact != null)
  {
    curContact.Close();
    curContact = null;
   }
  curContact = new Contact(cnCache);
  UpdateContact();
}  

FeedbackOpens in a new tab