예제 #1
0
        protected virtual void EPActivity_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            var row = e.Row as EPActivity;

            if (row == null)
            {
                return;
            }

            var activity = DefaultEmailProcessor.GetParentOriginalActivity(this, (int)row.TaskID);

            if (activity != null)
            {
                GotoParentActivity.SetVisible(true);

                PXUIFieldAttribute.SetReadOnly <EPActivity.entityDescription>(cache, e.Row);
                var isMessageFailed = row.MPStatus == MailStatusListAttribute.Failed;
                row.EntityDescription = isMessageFailed ? CacheUtility.GetErrorDescription(row.Exception) : string.Empty;
                var helper = new EntityHelper(this);
                var entity = activity.RefNoteID.With(refNoteId => helper.GetEntityRow(refNoteId.Value));
                if (entity != null)
                {
                    row.EntityDescription += CacheUtility.GetDescription(helper, entity, entity.GetType());
                }
            }
            else
            {
                GotoParentActivity.SetVisible(false);
            }
        }