private void llCreateFootonoteForSelectedTimePeriod_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PxTime pxTime = (PxTime)lbTimePeriods.SelectedItem;

            if (pxTime != null)
            {
                var timeFootnoteArray = (from tf in pxTime.TimeFootnotes
                                         select tf).ToArray();
                FootnoteDialog frmFootnote = new FootnoteDialog();

                frmFootnote.Context         = pxTime;
                pxTime.Content.FootnoteTime = "B";

                if (timeFootnoteArray.Count() == 0)
                {
                    PxTimeFootnote timeFootnote = (PxTimeFootnote)CreateTimeFootnote(pxTime);
                    timeFootnoteArray = (from tf in pxTime.TimeFootnotes
                                         select tf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])timeFootnoteArray);

                frmFootnote.AddFotnoteHandler     = CreateTimeFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveTimeFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a time period first!");
            }
        }
        private void llAddFootnoteInSelectedVariableForSelectedContent_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PxContent  pxContent = (PxContent)lbContents.SelectedItem;
            PxVariable variable  = (PxVariable)lbVariables.SelectedItem;

            if (pxContent != null && variable != null)
            {
                var contentVariableFootnoteArray = (from vf in pxContent.ContentVariableFootnotes
                                                    where vf.Variable == variable
                                                    select vf).ToArray();
                FootnoteDialog frmFootnote = new FootnoteDialog();

                frmFootnote.Context        = pxContent;
                pxContent.FootnoteVariable = "B";
                if (contentVariableFootnoteArray.Count() == 0)
                {
                    PxContentVariableFootnote contentVariableFootnote = (PxContentVariableFootnote)CreateContentVariableFootnote(pxContent);
                    contentVariableFootnoteArray = (from vf in pxContent.ContentVariableFootnotes
                                                    where vf.Variable == variable
                                                    select vf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])contentVariableFootnoteArray);

                frmFootnote.AddFotnoteHandler     = CreateContentVariableFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveContentVariableFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content and a variable first!");
            }
        }
        private void llAddFootnoteInSelectedVariable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PxVariable pxVariable = (PxVariable)lbVariables.SelectedItem;

            if (pxVariable != null)
            {
                var variableFootnoteArray = (from vf in pxVariable.VariableFootnotes
                                             select vf).ToArray();
                FootnoteDialog frmFootnote = new FootnoteDialog();

                frmFootnote.Context = pxVariable;

                //TODO a better solution for Footnote
                pxVariable.Footnote = "B";

                if (variableFootnoteArray.Count() == 0)
                {
                    PxVariableFootnote variableFootnote = (PxVariableFootnote)CreateVariableFootnote(pxVariable);
                    variableFootnoteArray = (from vf in pxVariable.VariableFootnotes
                                             select vf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])variableFootnoteArray);

                frmFootnote.AddFotnoteHandler     = CreateVariableFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveVariableFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content and a variable first!");
            }
        }
Ejemplo n.º 4
0
        private void llAddValueFootnote_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

        {
            if (SelectedValue != null)
            {
                var valueFootnoteArray = (from vf in SelectedValue.ValueFootnotes
                                          select vf).ToArray();

                FootnoteDialog frmFootnote = new FootnoteDialog();
                frmFootnote.Context    = SelectedValue;
                SelectedValue.Footnote = "B";
                if (valueFootnoteArray.Count() == 0)
                {
                    PxValueFootnote mainTableValueFootnote = (PxValueFootnote)CreateValueFootnote(SelectedValue);
                    valueFootnoteArray = (from vf in SelectedValue.ValueFootnotes
                                          select vf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])valueFootnoteArray);

                frmFootnote.AddFotnoteHandler     = CreateValueFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveValueFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content, a variable and a value first!");
            }
        }
Ejemplo n.º 5
0
        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!");
            }
        }
        private void btnAddMainTableFootnote_Click(object sender, EventArgs e)

        {
            FootnoteDialog frmFootnote = new FootnoteDialog();

            frmFootnote.Context = _table;

            if (_table.Footnotes.Count == 0)
            {
                PxMainTableFootnote f = (PxMainTableFootnote)CreateMainTableFootnote(frmFootnote.Context);
            }

            frmFootnote.SetDataSource((PxFootnote[])_table.Footnotes.ToArray());

            frmFootnote.AddFotnoteHandler     = CreateMainTableFootnote;
            frmFootnote.RemoveFootnoteHandler = RemoveMainTableFootnote;
            frmFootnote.ShowDialog();
        }
        private void btnAddContentFootnote_Click(object sender, EventArgs e)
        {
            PxContent pxContent = (PxContent)lbContents.SelectedItem;

            if (pxContent != null)
            {
                FootnoteDialog frmFootnote = new FootnoteDialog();
                frmFootnote.Context        = pxContent;
                pxContent.FootnoteContents = "B";
                if (pxContent.Footnotes.Count == 0)
                {
                    PxContentFootnote contentFootnote = (PxContentFootnote)CreateContentFootnote(pxContent);
                }
                frmFootnote.SetDataSource((PxFootnote[])(pxContent).Footnotes.ToArray());

                frmFootnote.AddFotnoteHandler     = CreateContentFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveContentFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content first!");
            }
        }
        private void llCreateFootonoteForSelectedTimePeriod_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PxTime pxTime = (PxTime)lbTimePeriods.SelectedItem;

            if (pxTime != null)
            {
                var timeFootnoteArray = (from tf in pxTime.TimeFootnotes
                                             select tf).ToArray();
                FootnoteDialog frmFootnote = new FootnoteDialog();

                frmFootnote.Context = pxTime;
                pxTime.Content.FootnoteTime = "B";

                if (timeFootnoteArray.Count() == 0)
                {
                    PxTimeFootnote timeFootnote = (PxTimeFootnote)CreateTimeFootnote(pxTime);
                    timeFootnoteArray = (from tf in pxTime.TimeFootnotes
                                             select tf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])timeFootnoteArray);

                frmFootnote.AddFotnoteHandler = CreateTimeFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveTimeFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a time period first!");

            }
        }
Ejemplo n.º 9
0
        private void llAddValueFootnote_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (SelectedValue != null)
            {

                var valueFootnoteArray = (from vf in SelectedValue.ValueFootnotes
                                                          select vf).ToArray();

                FootnoteDialog frmFootnote = new FootnoteDialog();
                frmFootnote.Context = SelectedValue;
                SelectedValue.Footnote = "B";
                if (valueFootnoteArray.Count() == 0)
                {
                    PxValueFootnote mainTableValueFootnote = (PxValueFootnote)CreateValueFootnote(SelectedValue);
                    valueFootnoteArray = (from vf in SelectedValue.ValueFootnotes
                                                 select vf).ToArray();

                }
                frmFootnote.SetDataSource((PxFootnote[])valueFootnoteArray);

                frmFootnote.AddFotnoteHandler = CreateValueFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveValueFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content, a variable and a value first!");

            }
        }
Ejemplo n.º 10
0
        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!");

            }
        }
Ejemplo n.º 11
0
        private void llAddFootnoteInSelectedVariable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PxVariable pxVariable = (PxVariable)lbVariables.SelectedItem;

            if (pxVariable != null)
            {
                var variableFootnoteArray = (from vf in pxVariable.VariableFootnotes
                                                    select vf).ToArray();
                FootnoteDialog frmFootnote = new FootnoteDialog();

                frmFootnote.Context = pxVariable;

                //TODO a better solution for Footnote
                pxVariable.Footnote = "B";

                if (variableFootnoteArray.Count() == 0)
                {
                    PxVariableFootnote variableFootnote = (PxVariableFootnote)CreateVariableFootnote(pxVariable);
                    variableFootnoteArray = (from vf in pxVariable.VariableFootnotes
                                             select vf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])variableFootnoteArray);

                frmFootnote.AddFotnoteHandler = CreateVariableFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveVariableFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content and a variable first!");

            }
        }
Ejemplo n.º 12
0
        private void llAddFootnoteInSelectedVariableForSelectedContent_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PxContent pxContent = (PxContent)lbContents.SelectedItem;
            PxVariable variable = (PxVariable)lbVariables.SelectedItem;

            if (pxContent != null && variable != null)
            {
                var contentVariableFootnoteArray = (from vf in pxContent.ContentVariableFootnotes
                                                    where vf.Variable == variable
                                                    select vf).ToArray();
                FootnoteDialog frmFootnote = new FootnoteDialog();

                frmFootnote.Context = pxContent;
                pxContent.FootnoteVariable = "B";
                if (contentVariableFootnoteArray.Count() == 0)
                {
                    PxContentVariableFootnote contentVariableFootnote = (PxContentVariableFootnote)CreateContentVariableFootnote(pxContent);
                    contentVariableFootnoteArray = (from vf in pxContent.ContentVariableFootnotes
                                                    where vf.Variable == variable
                                                    select vf).ToArray();
                }
                frmFootnote.SetDataSource((PxFootnote[])contentVariableFootnoteArray);

                frmFootnote.AddFotnoteHandler = CreateContentVariableFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveContentVariableFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content and a variable first!");

            }
        }
Ejemplo n.º 13
0
        private void btnAddMainTableFootnote_Click(object sender, EventArgs e)
        {
            FootnoteDialog frmFootnote = new FootnoteDialog();
            frmFootnote.Context = _table;

            if (_table.Footnotes.Count == 0)
            {
                PxMainTableFootnote f = (PxMainTableFootnote)CreateMainTableFootnote(frmFootnote.Context);
            }

            frmFootnote.SetDataSource((PxFootnote[])_table.Footnotes.ToArray());

            frmFootnote.AddFotnoteHandler = CreateMainTableFootnote;
            frmFootnote.RemoveFootnoteHandler = RemoveMainTableFootnote;
            frmFootnote.ShowDialog();
        }
Ejemplo n.º 14
0
        private void btnAddContentFootnote_Click(object sender, EventArgs e)
        {
            PxContent pxContent = (PxContent)lbContents.SelectedItem;
            if (pxContent != null)
            {
                FootnoteDialog frmFootnote = new FootnoteDialog();
                frmFootnote.Context = pxContent;
                pxContent.FootnoteContents = "B";
                if (pxContent.Footnotes.Count == 0)
                {
                    PxContentFootnote contentFootnote = (PxContentFootnote)CreateContentFootnote(pxContent);
                }
                frmFootnote.SetDataSource((PxFootnote[])(pxContent).Footnotes.ToArray());

                frmFootnote.AddFotnoteHandler = CreateContentFootnote;
                frmFootnote.RemoveFootnoteHandler = RemoveContentFootnote;
                frmFootnote.ShowDialog();
            }
            else
            {
                MessageBox.Show("Select a content first!");
            }
        }