Ejemplo n.º 1
0
        private void newTypeClick(object sender, EventArgs e)
        {
            if (m_customReportCounter >= Configuration.PreDefinedCustomizeTypeCount)
            {
                MessageForm.Show(this,
                                 string.Format(Resources.infoCustomerTypeLimit, Configuration.PreDefinedCustomizeTypeCount),
                                 Resources.report_center);
                return;
            }
            frmInputBox newType = new frmInputBox(Resources.infoNewTypePrompt, Resources.infoNewTypeTitle, Resources.infoNewTypeDefaultValue);

            newType.ShowDialog();
            if (newType.DialogResult == DialogResult.OK)
            {
                string typeName = newType.InputValue;
                if (typeName.Length > Configuration.PreDefinedCustomizeTypeNameLength)
                {  //we truncate the name
                    typeName = typeName.Substring(0, Configuration.PreDefinedCustomizeTypeNameLength);
                }
                UserReportTypeTreeNode addedNode = new UserReportTypeTreeNode(typeName, true);
                customReportTreeView.Nodes.Add(addedNode);
                customReportTreeView.SelectedNode = addedNode;
                saveButton.Enabled = true;
            }
        }
Ejemplo n.º 2
0
        private void newGroupClick(object sender, EventArgs e)
        {
            frmInputBox newGroup = new frmInputBox(Resources.infoNewGroupPrompt, Resources.infoNewGroupTitle, Resources.infoNewGroupDefaultValue);

            newGroup.ShowDialog();
            if (newGroup.DialogResult == DialogResult.OK)
            {
                UserReportGroupTreeNode addedNode = new UserReportGroupTreeNode(newGroup.InputValue, true);
                customReportTreeView.SelectedNode.Nodes.Add(addedNode);
                customReportTreeView.SelectedNode.Expand();
                customReportTreeView.SelectedNode = addedNode;
                saveButton.Enabled = true;
            }
        }