我想寻求帮助,关于YesNoCancel,取消不起作用,他们只工作是和否,少取消
当我按下取消时,您必须停用减损检查,如图所示,但什么也不做取消。
这是我的代码:
protected virtual void APInvoice_TBienServ_FieldUpdated(PXCache cache,PXFieldUpdatedEventArgs e)
{
APInvoice api = Base.Document.Current;
XTAPInvoice apiExt = PXCache<APInvoice>.GetExtension<XTAPInvoice>(api);
if (api.DocType == APDocType.Invoice)
{
switch (this.Base.Document.Ask("", confirma, MessageButtons.YesNoCancel, MessageIcon.Warning))
{
case WebDialogResult.Yes:
apiExt.AutoDetraccion = true;
apiExt.Detraccion = false;
PXUIFieldAttribute.SetVisible<XTAPInvoice.autodetraccion>(cache, api, true);
PXUIFieldAttribute.SetVisible<XTAPInvoice.detraccion>(cache, api, false);
break;
case WebDialogResult.No:
apiExt.Detraccion = true;
apiExt.AutoDetraccion = false;
PXUIFieldAttribute.SetVisible<XTAPInvoice.detraccion>(cache, api, true);
PXUIFieldAttribute.SetVisible<XTAPInvoice.autodetraccion>(cache, api, false);
break;
//cancel
default:
apiExt.Detraccion = false;
apiExt.AutoDetraccion = false;
break;
}
}
}