private void llAddFootnoteMainTValue_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { PxMainTable pxMainTable = SelectedMainTable; PxVariable variable = SelectedVariable; PxValue value = SelectedValue; if (variable != null && value != null) { var contentMainTableValueFootnoteArray = (from mtvf in pxMainTable.MainTableValueFootnotes where mtvf.Variable.Variable == variable.Variable && mtvf.Value.ValuePool == value.ValuePool && mtvf.Value.ValueCode == value.ValueCode select mtvf).ToArray(); FootnoteDialog frmFootnote = new FootnoteDialog(); frmFootnote.Context = pxMainTable; pxMainTable.MarkAsDirty(); if (contentMainTableValueFootnoteArray.Count() == 0) { PxMainTableValueFootnote mainTableValueFootnote = (PxMainTableValueFootnote)CreateMainTableValueFootnote(pxMainTable); contentMainTableValueFootnoteArray = (from vf in pxMainTable.MainTableValueFootnotes where vf.Variable == variable && vf.Value == value select vf).ToArray(); } frmFootnote.SetDataSource((PxFootnote[])contentMainTableValueFootnoteArray); frmFootnote.AddFotnoteHandler = CreateMainTableValueFootnote; frmFootnote.RemoveFootnoteHandler = RemoveMainTableValueFootnote; frmFootnote.ShowDialog(); } else { MessageBox.Show("Select a content, a variable and a value first!"); } }
public PxMainTableValueFootnote CreateMainTableValueFootnote(PxObject context) { PxMainTableValueFootnote mtvf = new PxMainTableValueFootnote(); mtvf.FootnoteNo = FootnoteNo; FootnoteNo++; mtvf.FootnoteText = "Shenim i ri"; mtvf.FootnoteTextEnglish = "New Footnote"; mtvf.MandOption = "O"; mtvf.ShowFootnote = "B"; mtvf.IsNew = true; mtvf.Variable = SelectedVariable; mtvf.Value = SelectedValue; SelectedMainTable.MainTableValueFootnotes.Add(mtvf); SelectedMainTable.MarkAsDirty(); SelectedValue.MarkAsDirty(); return(mtvf); }