あなたの助けが必要です。
私はこの方法を持っています:
protected void btnDocumentType_Click(object sender, EventArgs e)
{
DocumentApplicationCategoryManager DACM = new DocumentApplicationCategoryManager();
IkubInfo.NE.Domain.DocumentApplicationCategory DAC = new Domain.DocumentApplicationCategory();
DAC.DocumentType = new DocumentTypeManager().GetById(new Guid(cboDocumentType.SelectedValue));
DAC.ApplicationCategory = Entity;
Entity.DocumentApplicationCategory.Add(DAC);
DACM.Save(DAC);
DACM.Session.CommitChanges();
SetUIValues();
}
これは、ユーザーがグリッドに値を追加できるようにする [ADD] ボタンのメソッドです。ユーザーが追加しようとしている値が 1 回保存されると、2 回保存できないことを確認する必要があります。検証してユーザーにエラー メッセージを表示する必要がありますが、その方法がわかりません。この行の前に「if」条件を付ける必要があると思います。
DAC.DocumentType = new DocumentTypeManager().GetById(new Guid(cboDocumentType.SelectedValue));
何か案が ?あなたの助けをいただければ幸いです。前もって感謝します :)