Exemplo n.º 1
0
        private void loadCustomScript(TreeNode treeNode)
        {
            if ((treeNode.Level == 2 && treeNode.Text == "scriptFile") || (treeNode.Level == 3 && treeNode.Parent.Text == "scriptLibraries"))
            {
                string scriptFile1InternalId = "0";
                string scriptFile2InternalId = "0";

                commonClient commonClient = new commonClient();

                TreeNode customScriptFile1Node = commonClient.getNodeFromPath(tvEnvironment1Scripts.Nodes[0], treeNode.FullPath);
                TreeNode customScriptFile2Node = commonClient.getNodeFromPath(tvEnvironment2Scripts.Nodes[0], treeNode.FullPath);

                if (compared)
                {
                    scriptFile1InternalId = customScriptFile1Node.Nodes[0].Nodes[0].Text;
                    scriptFile2InternalId = customScriptFile2Node.Nodes[0].Nodes[0].Text;
                }

                if (scriptFile1InternalId == "0" || scriptFile2InternalId == "0")
                {
                    if (!compared)
                    {
                        MessageBox.Show(haveNotComparedText);
                    }
                    else
                    {
                        MessageBox.Show(missingScriptFileText);
                    }

                    return;
                }

                netsuiteClient netsuiteClient1 = new netsuiteClient(txtUrl1.Text, txtAccount1.Text, txtSuffix1.Text, txtEmail1.Text, txtSignature1.Text, txtRole1.Text);
                netsuiteClient netsuiteClient2 = new netsuiteClient(txtUrl2.Text, txtAccount2.Text, txtSuffix2.Text, txtEmail2.Text, txtSignature2.Text, txtRole2.Text);

                netsuiteFile netsuiteCustomScriptFile1 = netsuiteClient1.getCustomScriptFile(scriptFile1InternalId);
                netsuiteFile netsuiteCustomScriptFile2 = netsuiteClient2.getCustomScriptFile(scriptFile2InternalId);

                FileViewer scriptFileViewer = new FileViewer();

                scriptFileViewer.netsuiteClient1 = netsuiteClient1;
                scriptFileViewer.netsuiteClient2 = netsuiteClient2;

                scriptFileViewer.netsuiteCustomScriptFile1 = netsuiteCustomScriptFile1;
                scriptFileViewer.netsuiteCustomScriptFile2 = netsuiteCustomScriptFile2;

                scriptFileViewer.Show();
            }
            else if (treeNode.Level > 2 && treeNode.Text == "content")
            {
                loadCustomScript(treeNode.Parent);
            }
        }
Exemplo n.º 2
0
 private void tvEnvironment2Scripts_AfterExpand(object sender, TreeViewEventArgs e)
 {
     try
     {
         commonClient commonClient = new commonClient();
         commonClient.getNodeFromPath(tvEnvironment1Scripts.Nodes[0], e.Node.FullPath).Expand();
     }
     catch (Exception ex)
     {
     }
 }
Exemplo n.º 3
0
 private void tvEnvironment2Records_AfterCollapse(object sender, TreeViewEventArgs e)
 {
     try
     {
         commonClient commonClient = new commonClient();
         commonClient.getNodeFromPath(tvEnvironment1Records.Nodes[0], e.Node.FullPath).Collapse();
     }
     catch (Exception ex)
     {
     }
 }