Ejemplo n.º 1
0
        private void btnAddTable_Click(object sender, EventArgs e)
        {
            PxMenuSelection selectedMenu = (PxMenuSelection)tvMenuSelection.SelectedNode.Tag;
            int             levelNo;

            int.TryParse(selectedMenu.LevelNo, out levelNo);
            if (levelNo < 5)
            {
                CreateMainTable frmCreateDialog = new CreateMainTable();

                frmCreateDialog.NewMainTable.Theme = selectedMenu.GetTheme(selectedMenu);
                if (selectedMenu.GetTheme(selectedMenu) == null)
                {
                    MessageBox.Show("Can not insert a table in this node", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                frmCreateDialog.SetTheme(frmCreateDialog.NewMainTable.Theme);

                if (frmCreateDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    PxMenuSelection newMenuSelection = new PxMenuSelection();
                    newMenuSelection.Parent              = selectedMenu;
                    newMenuSelection.LevelNo             = "5";
                    newMenuSelection.PresText            = frmCreateDialog.NewMainTable.PresText;
                    newMenuSelection.PresTextEnglish     = frmCreateDialog.NewMainTable.TableTitleEnglish;
                    newMenuSelection.Menu                = frmCreateDialog.NewMainTable.TableId;
                    newMenuSelection.Presentation        = "A";
                    newMenuSelection.PresentationEnglish = "A";

                    string message = "";

                    if (!newMenuSelection.Validate(ref message))
                    {
                        MessageBox.Show(message, "Create Menu Selection", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                        return;
                    }

                    if (!VariableFacade.Save(newMenuSelection, ref message))
                    {
                        MessageBox.Show(message, "Create Menu Selection", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                        return;
                    }

                    selectedMenu.Childrens.Add(newMenuSelection);
                    TreeNode newTheme = new TreeNode();
                    newTheme.Name = newMenuSelection.Menu;
                    newTheme.Text = newMenuSelection.PresText;
                    newTheme.Tag  = newMenuSelection;

                    tvMenuSelection.SelectedNode.Nodes.Add(newTheme);
                    tvMenuSelection.SelectedNode = newTheme;
                }
            }
        }
        private void btnActivateTable_Click(object sender, EventArgs e)
        {
            string msg = "";

            _table.TableStatus = "A";
            if (!VariableFacade.Save(_table, ref msg))
            {
                MessageBox.Show(msg);
            }
            else
            {
                MessageBox.Show("The table was activated");
            }
        }
Ejemplo n.º 3
0
 private void SaveValueFootnotes()
 {
     foreach (var vs in (List <PxValueSet>)lbValuesets.DataSource)
     {
         if (vs.IsDirty)
         {
             vs.ValuePool = lbValuePools.SelectedValue.ToString();
             foreach (var v in ((List <PxValue>)dgwValues.DataSource))
             {
                 vs.Values.Add(v);
             }
             string msg = "";
             VariableFacade.Save(vs, ref msg);
         }
     }
 }
Ejemplo n.º 4
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            string message = "";

            if (!_valueSet.Validate(ref message))
            {
                MessageBox.Show(message, "Create valueset", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                return;
            }

            if (!VariableFacade.Save(_valueSet, ref message))
            {
                MessageBox.Show(message, "Create value pool", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                return;
            }
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
        private bool SaveMainTable()
        {
            string message = "";

            if (!_table.Validate(ref message))
            {
                MessageBox.Show(message, "Create Table", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                return(false);
            }

            if (!VariableFacade.Save(_table, ref message))
            {
                MessageBox.Show(message, "Create Table", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 6
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            string message = "";

            if (!NewMenuSelection.Validate(ref message))
            {
                MessageBox.Show(message, "Create Menu Selection", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                return;
            }

            if (!VariableFacade.Save(NewMenuSelection, ref message))
            {
                MessageBox.Show(message, "Create Menu Selection", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                return;
            }
            DialogResult = System.Windows.Forms.DialogResult.OK;
        }